Open dunglas opened 1 year ago
I could not reproduce on native arm64 nor in rosetta mode with both gcc and clang, would it be possible to give a bit more context ? did you try for example instead of removing opcache jit, removing zts ?
This is odd, zend_gdb_register_code
is not static
and zend_gdb.c
is compiled unconditionally.
start to wonder if this is a somewhat similar issue found here (as embed sapi involved).
did you try for example instead of removing opcache jit, removing zts ?
Good catch, removing --enable-zts
fixes the issue too!
I've written a SAPI to embed PHP in a Go binary. I can provide you a (private) repo with a reproducer if needed!
sure why not feel free to send an email if you prefer.
I upgraded to the latest commit of the PHP-8.2
branch, recompiled with the exact same flags... and the issue is gone.
Thanks for your help everybody!
This issue is back again (macOS only). I probably made a mistake while recompiling hiding the issue. I can still give access to a reproducer.
@devnexen this looks related but I'm not sure if that's precisely the same issue. Unlike #9635, I'm not loading PHP as a plugin for another app. PHP is statically compiled in the main Go binary:
+-------+-------+
|Go App |
+---------------+
| PHP |
+--+---------+--+
| |dlopen/dlsym
+--+---+ +---+--+
| PHP | | PHP |
| ext1 | | ext2 |
+------+ +------+
Basically, the main app loads directly opcache.so
.
This issue is back again (macOS only). I probably made a mistake while recompiling hiding the issue. I can still give access to a reproducer.
you can send an email however won t be able to have a proper look at it before this weekend at earliest, pretty busy atm. but if someone else wants a crack at it before me that s fine :-)
Now that FrankenPHP is public, here is a quick reproducer (on Mac):
compile PHP
./buildconf
./configure \
--enable-embed=static \
--enable-zts \
--enable-static \
--enable-shared=no \
--with-iconv=/opt/homebrew/opt/libiconv/ \
--enable-debug
make -j$(nproc)
sudo make install
Be sure that opcache is loaded in php.ini
run Franken's test suite
# Go must be installed
git clone --recursive git@github.com:dunglas/frankenphp.git
cd frankenphp
go test -v
Result:
<b>Warning</b>: Failed loading Zend extension 'opcache' (tried: /usr/local/lib/php/extensions/debug-zts-20220830/opcache (dlopen(/usr/local/lib/php/extensions/debug-zts-20220830/opcache, 0x0009): tried: '/usr/local/lib/php/extensions/debug-zts-20220830/opcache' (no such file)), /usr/local/lib/php/extensions/debug-zts-20220830/opcache.so (dlopen(/usr/local/lib/php/extensions/debug-zts-20220830/opcache.so, 0x0009): symbol not found in flat namespace (_zend_gdb_register_code))) in <b>Unknown</b> on line <b>0</b><br />
Description
When compiling PHP 8.2 on Mac OS X with the following configuration:
I get this error when loading the
opcache.so
extension:Disabling opcache JIT fixes the issue:
PHP Version
PHP 8.2-dev
Operating System
macOS 12.6