When loading the split fields with the diff module, an author will receive 500 error if an endless loop occurs between revisions.

In which we see the following message in Drupal watchdog:

E_ERROR: Maximum execution time of 300 seconds exceeded

Stack trace
…/docroot/modules/contrib/diff/src/Controller/PluginRevisionController.php (253)
…/docroot/modules/contrib/diff/src/Controller/PluginRevisionController.php (154)
…/docroot/modules/contrib/diff/src/Controller/NodeRevisionController.php (49)

Local we see the following message `Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 58724352 bytes) in Unknown on line 0.`

Issue fork diff-3033455

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mrossi113 created an issue. See original summary.

mrossi113’s picture

brentschuddinck’s picture

I had a similar issue. When comparing 2 revisions, the page keeps loading and results in an error 500.

Drupal version: 8.6.10
Diff module version: 8.x-1.0-rc2

I haven't had the time to check this out in detail, but In my case, the problem was fixed by updating the module dependencies (without applying the patch above)
composer update drupal/diff --with-dependencies
This removed sunra/php-simple-html-dom-parser and installed kub-at/php-simple-html-dom-parser (v1.8.1) and updates caxy/php-htmldiff (v0.1.7 => v0.1.9).

moshe weitzman’s picture

Status: Active » Needs review
olli’s picture

Assigned: mrossi113 » Unassigned
Status: Needs review » Reviewed & tested by the community

I was able to reproduce this with simplytest.me:

  1. launch sandbox and login
  2. create basic page
  3. edit and save the page twice without any changes
  4. go to node/1/revisions/view/2/3/visual_inline

Patch #2 seems to fix it, thank you!

tuuuukka’s picture

#2 fixed it for us, thanks!

acbramley’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Thanks for the work on this one. I've recently taken up maintainership of this project and am looking through the RTBC issues.

I can't reproduce this issue following the steps in #5

To get this in, I'll need the patch on an MR against the latest 8.x-1.x code with tests added if possible.

Thanks!

silvi.addweb made their first commit to this issue’s fork.

silvi.addweb’s picture

Status: Needs work » Reviewed & tested by the community

Hello, I have raised MR for the same.

acbramley’s picture

Status: Reviewed & tested by the community » Needs work
berdir’s picture

Priority: Normal » Major

Stumbled over this as well, what happened in our case is that a user used the language switcher while on the diff page, but those revisions had nothing useful in the other language and are more recent than any existing revisions in that language, so it basically looped into infinity and wrote about 1GB of database logs.

Raising priority because this has the possibility to take down a site if a user is confused and tries that a few times. There's also an old I think duplicate issue that was closed incorrectly (#2939631: Infinite loop found in PluginRevisionController) and the somewhat related #3360589: TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in count()

berdir’s picture

Version: 8.x-1.x-dev » 2.x-dev
Status: Needs work » Needs review

I created a new MR with a test for 2.x. As this says, this doesn't produce an error, it's while loop into infinity, so it will hit the max execution time limit at some point, if that's actually set at all.

The result is also a bit weird, the navigation links aren't actually useful, it might be more correct to not show them. but this is certainly better than the current behavior.

heddn made their first commit to this issue’s fork.

  • heddn committed 94ea8a87 on 2.x authored by berdir
    Issue #3033455 by berdir, mrossi113, acbramley, olli, heddn: 500 error:...
heddn’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests

This has tests and multiple folks have manually tested this. LGTM.

heddn’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.