Problem/Motivation
I attempted to update to 9.4.0 on a complex project. On running drush updb it crashed with this message:
// Do you wish to run the specified pending updates?: yes.
> [notice] Update started: image_post_update_image_loading_attribute
> Segmentation fault
In ProcessBase.php line 155:
Output is empty.
I have tracked the problem down as far as an endless loop caused by the field_group module calling EntityViewDisplay::load from within its implementation of hook_field_info_max_weight as that hook gets called each time EntityViewDisplay is initialiased.
I haven't (yet) been able to see any difference between 9.3 and 9.4 that would cause this to happen, but I think it's a core issue as the field_group code hasn't changed since April last year.
Steps to reproduce
TBC. I can't provide a succinct set of steps to reproduce yet, sorry.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 3290992-fix-recursion-tracking.patch | 623 bytes | tikaszvince |
| #3 | Screenshot from 2022-06-17 11-40-38.png | 14.43 KB | whiz11 |
Issue fork field_group-3290992
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
Comment #2
darvanenHere is a screenshot of the endless loop stack in xdebug after more than a dozen iterations:
Comment #3
whiz11 commentedI am also getting a segmentation fault (core dumped) when running a
drush updbafter having updating the codes from 9.3.14 to 9.4.0Could this be due to some preg_match running in a loop in the codes?
Comment #4
catchCore is loading and saving the entity view displays in an update, but it's not doing anything special otherwise.
A similar bug was reported for field_group module which was committed in 2019 #2951175: Infinite recursion on field_group_field_info_max_weight()/field_group_info_groups(). Not clear to me why the recursion check that's already there wouldn't kick in, but that seems likely to be the issue.
I'm going to move this over to Field Group, don't think we can do anything in core.
Comment #5
adam-delaney commentedI've recently encountered this issue as well. Root cause stemmed from a base field definition where the form display does not implicitly set a weight. I was not able to determine why the issue is only present when running under 9.4.0 either.
Comment #6
tikaszvince commentedHi,
I fought this all day long. I found that if we use
drupal_staticinstead of local static variable declaration this recursion is eliminated.I've attached a patch to bypass this error.
Comment #7
tikaszvince commentedComment #8
jrearickThe patch seems to be working for us. It works in both 9.3.16 and 9.4.0, so I'm willing to RTBC this
Comment #9
jrearickComment #10
darvanenThanks for checking it out and triaging appropriately @catch
@tkaszvince nice find! The change makes sense to me and I would call your patch a fix rather than a way to bypass.
+1 RTBC
Comment #11
adam-delaney commentedThis patch worked for me as well running Drupal 9.4.0 as well as 9.3.16.
+1 for RTBC, it would be great to get this addressed in a release.
Comment #12
ruuds commented+1 for RTBC. This fixes the Segmentation fault for me too.
Comment #13
jeremyskinner commentedI also ran into the same issue upgrading several sites from Drupal 8.9 to Drupal 9.4. Patch from #6 solved this for me too.
Comment #14
jfcolomer commentedThanks @tikaszvince, #6 works for me as well.
Comment #15
pbonnefoi commentedSame here. I had the issue and #6 fixed it (with Drupal 9.4.1). Well done @tikaszvince
Comment #16
tomtech commented+1 for RTBC.
Comment #17
sagesolutions commented+1 RTBC
Works on Drupal 9.4.1
Comment #18
znerol commented#6 is the correct way to fix this issue. RTBC +1.
Comment #20
nils.destoop commentedThx for the patch, it has been committed to dev
Comment #21
jrearickAwesome! Thanks nils.destoop. Any word on a release soon?
Comment #22
tobiberlinToday I run into the same issue with our quite complex project which I wanted to upgrade to Drupal 9.4. The patch resolved it - thank you so much @tikaszvince
Comment #24
karimb commentedI can confirm patch #6 has been committed into stable release 8.x-3.4 and it seems working with D9.4.8 ;)
Comment #25
charginghawk commented