Really strange thing happening on PHP 8 fpm (using anything Eloquent triggers it) and unable to debug the coredump (PHP 7.3 is ok)
Environment is Debian 10 (Vagrant VM and also DO droplet)
- Vagrant php -v shows
PHP 8.0.3
- DO droplet php -v shows
PHP 8.0.5
Composer shows and just did a composer global update
...
"require": {
"php": "^7.3|^8.0",
"aws/aws-sdk-php": "^3.176",
"barryvdh/laravel-cors": "^2.0",
"barryvdh/laravel-debugbar": "^3.5",
"barryvdh/laravel-ide-helper": "^2.9",
"barryvdh/laravel-snappy": "^0.4.8",
"beyondcode/laravel-dump-server": "^1.7",
"dyrynda/laravel-nullable-fields": "^4.1",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"google/apiclient": "^2.",
"guzzlehttp/guzzle": "^7.3",
"hashids/hashids": "^4.1",
"laracasts/flash": "^3.2",
"laravel/cashier": "^12.10",
"laravel/framework": "^8.40",
"laravel/horizon": "^5.7",
"laravel/sanctum": "^2.9",
"laravel/scout": "^8.6",
"laravel/socialite": "^5.2",
"laravel/telescope": "^4.4",
"laravel/tinker": "^2.6",
"laravel/ui": "^3.2",
"laravelcollective/html": "^6.2",
"league/csv": "^9.7",
"league/flysystem-aws-s3-v3": "^1.0",
"phery/phery": "^2.7",
"php-parallel-lint/php-console-color": "^1.0",
"plivo/plivo-php": "^4.18",
"predis/predis": "^1.1",
"sofa/eloquence": "dev-master",
"vinkla/hashids": "^9.1",
"wildbit/postmark-php": "^4.0",
"wildbit/swiftmailer-postmark": "^3.3"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/breeze": "^1.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3"
},
Nginx + php7.4-fpm
Laravel (PHP) code works in php7.4-fpm (normal setup of nginx + fpm) If there is a syntax error, the browser shows a nice web page with the error (and link to telescope)
Nginx + php8.0-fpm
Most of the "simple" PHP pages work (a quick phpinfo.php also works fine) .. however it starts showing "502 Bad Gateway" (nginx) when you click on submit on the login page of https://laravel.com/docs/8.x/starter-kits#laravel-breeze (it shows the initial form)
This is only happening on php8.0-fpm (using a Vagrant VM and also replicated on a DO droplet)
Something is causing php8.0-fpm to SIGSEGV (signal 11). It doesn't even hit the laravel logs and nginx displays "502 Bad Gateway" (standard nginx error page) from the response of php8.0-fpm
On the /var/log/php8.0-fpm.log
WARNING: [pool www] child 3956 exited on signal 11 (SIGSEGV - core dumped) after 63.502325 seconds from start
I have been able to generate core dumps, however the bt
is not showing much information. The core dumps (on a vagrant VM) is over 200MB (huge file for a page refresh?) and this goes from #0 to #38286 (lots and lots of lines) with pretty much the same stuff with no function like I was expecting to see (function or frame) and it seems to be in an infinite loop ...
Reading symbols from /usr/sbin/php-fpm8.0...(no debugging symbols found)...done.
[New LWP 3956]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `php-fpm: pool www '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x000056483469fa4e in zend_is_callable_at_frame ()
(gdb) bt
#0 0x000056483469fa4e in zend_is_callable_at_frame ()
#1 0x00005648346a09a7 in zend_is_callable_ex ()
#2 0x00005648346a0adc in zend_fcall_info_init ()
#3 0x00005648345ca7ec in ?? ()
#4 0x0000564834701268 in execute_ex ()
#5 0x000056483468c5d2 in zend_call_function ()
#6 0x00005648345ca820 in ?? ()
#7 0x0000564834701268 in execute_ex ()
#8 0x000056483468c5d2 in zend_call_function ()
#9 0x00005648345ca820 in ?? ()
#10 0x0000564834701268 in execute_ex ()
#11 0x000056483468c5d2 in zend_call_function ()
#12 0x00005648345ca820 in ?? ()
...
#38280 0x00005648345ca820 in ?? ()
#38281 0x0000564834701268 in execute_ex ()
#38282 0x0000564834702c3c in zend_execute ()
#38283 0x0000564834699e0d in zend_execute_scripts ()
#38284 0x0000564834636b0b in php_execute_script ()
#38285 0x00005648344f0109 in ?? ()
#38286 0x00007f7c0e98109b in __libc_start_main (main=0x5648344ef280, argc=4, argv=0x7ffd1785e398, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd1785e388) at ../csu/libc-start.c:308
#38287 0x00005648344f0f1a in _start ()
On the code side, I have been able to isolate it to perhaps Eloquent but the database is working
The following lines work
$users = DB::table('users')->get();
//dd($users);
echo count($users); // show 31
but then adding the following gets the SIGSEGV
$user = User::find(10001);
or
$users = User::all(); // only 31 records in the database
Any ideas? Maybe downgrade back to php 7.4 (which does not seem like a good way to go)
Maybe it is how php 8 is handling the errors vs exceptions?