Crypt::encode fails on PHP 7.3
nickhagen opened this issue · 7 comments
Crypt::encode('test', 'test');
This results in what looks to me like a seg fault, but results in a 502 Bad Gateway error and the only error that I can see is:
[pool www] child 7 exited on signal 11 (SIGSEGV - core dumped) after 133.930549 seconds from start
I tried to go through the entire crypt initialization and encode and decode, but didn't really find where it was failing.
With php 7.2 it works perfectly fine but after upgrading to 7.3 it dies, and doesn't seem to throw any errors. All the same packages are installed in my test environment just changing from 7.2 to 7.3.
Chances are it crashes in libsodium, outside PHP.
This is more likely related to an extension or a library you are using. Check your vendor libraries to see which one may be resulting this exception. The code of Crypt
class is fine.
That why I wrote, most likely libsodium, the extension Crypt is using.
I did a search that's why I couldn't point my fingers toward an exact extension. But as of PHP 7.3 some libraries may not yet received an update or he is using a deprecated extension that have been dropped as of 7.3, PHP extensions
libsodium is quite new, I don't think it is going to be dropped any time soon, most modern encryption in PHP depends on it.
It looks like you're on a bleeding edge PHP 7.3, the bug in libsodium was only reported less than a month ago: https://github.com/jedisct1/libsodium-php/issues/186
Nothing much we can do about it, you'll have to wait until PHP has updated it's libsodium.so.
It seems to be fixed 736b7d1
Yes, that is why I wrote we need to wait until the fix is in PHP, libsodium is no longer a PECL extension, it is part of the PHP build.