|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2021-02-10 18:23 UTC] ricardo dot branco at covermg dot com
Description: ------------ We are seeing random segfaults in PDO module when running script and not able to diagnose what the issue is. Looking at where the script crashes. If we restart the script it goes does the same process again without issue. Could this be unhandled loss of DB connection in the PDO driver? ``` (gdb) bt #0 0x0000563eb45950d1 in _emalloc () #1 0x00007fb0b0318c5e in fetch_value () from /opt/remi/php74/root/usr/lib64/php/modules/pdo.so #2 0x00007fb0b031b2df in do_fetch.constprop.9 () from /opt/remi/php74/root/usr/lib64/php/modules/pdo.so #3 0x00007fb0b031c673 in zim_PDOStatement_fetchAll () from /opt/remi/php74/root/usr/lib64/php/modules/pdo.so #4 0x0000563eb4640e5c in execute_ex () #5 0x0000563eb45ac016 in zend_call_function () #6 0x0000563eb45ac215 in _call_user_function_ex () #7 0x00007fb0acc32b52 in _php_worker_function_callback () from /opt/remi/php74/root/usr/lib64/php/modules/gearman.so #8 0x00007fb0aca09167 in FunctionV1::callback(gearman_job_st*, void*) () from /lib64/libgearman.so.8 #9 0x00007fb0aca11ffc in gearman_worker_work () from /lib64/libgearman.so.8 #10 0x00007fb0acc33e9d in zif_gearman_worker_work () from /opt/remi/php74/root/usr/lib64/php/modules/gearman.so #11 0x0000563eb4640e5c in execute_ex () #12 0x0000563eb4641961 in zend_execute () #13 0x0000563eb45ba9b3 in zend_execute_scripts () #14 0x0000563eb4559170 in php_execute_script () #15 0x0000563eb4643adc in do_cli () #16 0x0000563eb43bf7cb in main () ``` PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 14:00:01 2025 UTC |
The problem does not happen 100% of the time nor is it reproducible on demand, I see it randomly without any specific reason and even when I run it against the same job it crashed on before, it does it successfully.g This machine is currently only running 3 PHP scripts, they are long running but restarted once per hour just incase of any memory leaks. The only portion of code I can track this down too is a part that just requests a single row of data from the DB, its nothing large. This is going though ZF1 Zend_Db lib but should not matter here as it seems to be going wrong in the PDO lib. MariaDB 10.4.15 memory_limit = 64M No persistent DB connections (long running script, it starts and disconnects conn within the Gearman loop as needed) Ive registered a tick handler to monitor the memory and additional logging to confirm the area it stopping on. ``` total used free shared buff/cache available Mem: 1882004 338520 275664 102100 1267820 1260372 Swap: 524284 68392 455892 ``` ``` [2244970.641111] traps: php[22014] general protection ip:56336a0fb0d1 sp:7ffe3944afc8 error:0 [2249179.087888] traps: php[24166] general protection ip:56407225f0d1 sp:7ffd703631d8 error:0 in php[564072200000+1ff000] [2249213.888219] traps: php[23898] general protection ip:55b6ea2ba492 sp:7ffe9cf2a290 error:0 [2261617.050534] traps: php[24174] general protection ip:563eb45950d1 sp:7ffd2efb4548 error:0 ```