-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dl() segfaults when module is already loaded #9589
Comments
Indeed, I've stumbled upon this issue very recently, too. |
Smallest reproducer:
The first commit that crash is b63df3c Backtrace:
Since this commit, the module entry lives in the shared library's data segment. This crashes because
However, in this case the Line 228 in ed0f1f0
So, |
As of PHP 8.2.0, `zend_module_entry` structures are no longer copied, so when a module is permanently loaded, and users try to dynamically load that module again, the structure is corrupted[1], causing a segfault on shutdown. We catch that by checking whether any dynamically loaded module is already loaded, and bailing out in that case without modifying the `zend_module_entry` structure. [1] <php#9589 (comment)>
Description
The following code:
Resulted in this output:
But I expected this output instead:
Working example:
Failing example:
It looks like a regression to me from 8.1 to 8.2.
PHP Version
PHP 8.2.0 RC2
Operating System
FreeBSD: 12.3-RELEASE-p7
Setup
Clean Poudriere throwaway Jails from FreeBSD ports, main branch.
The text was updated successfully, but these errors were encountered: