You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resulted in this output:
Crash of the php-fpm child process, about 50% of the time. In the logs i could see 3 different errors depending on how i alter the XML files. The most common is:
corrupted size vs. prev_size in fastbins
I also encountered:
malloc_consolidate(): invalid chunk size
free(): double free detected in tcache 2
Followed by:
[28-Jun-2024 12:06:20] WARNING: [pool www] child 1088 exited on signal 6 (SIGABRT) after 475.706249 seconds from start
[28-Jun-2024 12:06:20] NOTICE: [pool www] child 1100 started
But I expected this output instead:
No crash!
I was able to isolate this issue on PHP 8.2 in Docker Desktop on Apple Silicon (base image php:8.2-fpm). However we encountered the same error on different servers running our XML-based CMS on PHP 7.4. We switched from SLES (SUSE Support # 00520126: PHP-FPM process crash after SLES 15 SP4 upgrade) to CentOS thinking it was a distribution bug but could not fix it. PHP 7.4 in Docker (Desktop, Mac, WSL2 or SLES) however didn't seem to be affected by the issue.
What ends up happening is that the xinclude code from libxml removes the fallback node, but the fallback node is still reference via $fallback. You can workaround this issue by doing unset($fallback); right before the call to xinclude.
A possible solution is to perform an in-tree walk and detach our node proxy in case we encounter an xinclude fallback.
Activity
devnexen commentedon Jun 28, 2024
reproducible even w/o FPM.
ndossche commentedon Jun 28, 2024
What ends up happening is that the xinclude code from libxml removes the fallback node, but the fallback node is still reference via
$fallback. You can workaround this issue by doingunset($fallback);right before the call to xinclude.A possible solution is to perform an in-tree walk and detach our node proxy in case we encounter an xinclude fallback.
Fix phpGH-14702: DOMDocument::xinclude() crash
Merge branch 'PHP-8.2' into PHP-8.3
Merge branch 'PHP-8.3'
Fix GH-14702: DOMDocument::xinclude() crash