[PHP] Segmentation fault in php agent

We are getting intermittent segmentation faults in our apache-modphp. They seem to be releated to the newrelic agent. Apport show segmentation faults and we inspected the core dump.

the apport.log shows lines like :

ERROR: apport (pid 3590860) Wed Nov 17 13:22:22 2021: called for pid 3590083, signal 11, core limit 0, dump mode 2
ERROR: apport (pid 3590860) Wed Nov 17 13:22:22 2021: not creating core for pid with dump mode of 2
ERROR: apport (pid 3590860) Wed Nov 17 13:22:22 2021: executable: /usr/sbin/apache2 (command line “/usr/sbin/apache2 -k start”)
ERROR: apport (pid 3590860) Wed Nov 17 13:22:22 2021: is_closing_session(): no DBUS_SESSION_BUS_ADDRESS in environment
ERROR: apport (pid 3590860) Wed Nov 17 13:22:22 2021: apport: report /var/crash/_usr_sbin_apache2.0.crash already exists and unseen, doing nothing to avoid disk usage DoS

Does anyone experiance these problems? We can provide the nrdiag results and the results/stackgrace of the core dump. At the moment we cannot link them to this topic since we are still marked as new users.

the stack trace of the crash starts with:

— stack trace —
#0 0x00007fbbde6508f9 in execute_ex (ex=0x7fbbd6f1b6b0) at ./Zend/zend_vm_execute.h:50486
vm_stack_data = <error reading variable vm_stack_data (Cannot access memory at address 0x7ffe43313ff0)>
#1 0x00007fbbd91f12e2 in nr_zend_call_orig_execute_special () at /home/hudson/workspace/php-release-agent/label/centos5-64-nrcamp/agent/php_user_instrument.c:70
No locals.
#2 0x00007fbbd91d5f26 in nr_php_execute_enabled () at /home/hudson/workspace/php-release-agent/label/centos5-64-nrcamp/agent/php_execute.c:1195
No locals.
#3 0x00007fbbd91d6652 in nr_php_execute () at /home/hudson/workspace/php-release-agent/label/centos5-64-nrcamp/agent/php_execute.c:1338
No locals.
#4 0x00007fbbde42c88b in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER () at ./Zend/zend_vm_execute.h:1830
call = 0x7fbbd6f1b6b0
fbc = 0x7fbbddf01210
ret =
#5 0x00007fbbde651458 in execute_ex (ex=0x7fbbd6f1b6b0) at ./Zend/zend_vm_execute.h:54283
vm_stack_data = {orig_opline = 0x4230b5f8, orig_execute_data = 0x7fbbd6f1b610, hybrid_jit_red_zone = ‘\000’ <repeats 15 times>}
#6 0x00007fbbd91f12e2 in nr_zend_call_orig_execute_special () at /home/hudson/workspace/php-release-agent/label/centos5-64-nrcamp/agent/php_user_instrument.c:70
No locals.
#7 0x00007fbbd91d5f26 in nr_php_execute_enabled () at /home/hudson/workspace/php-release-agent/label/centos5-64-nrcamp/agent/php_execute.c:1195
No locals.
#8 0x00007fbbd91d6652 in nr_php_execute () at /home/hudson/workspace/php-release-agent/label/centos5-64-nrcamp/agent/php_execute.c:1338
No locals.
#9 0x00007fbbde42c88b in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER () at ./Zend/zend_vm_execute.h:1830

Our account has been upgraded, so I can attach files now. I have attached the nrdiag output and the output of apport-retrace of the crash report, including the stack trace of the core dump.

Does anyone have an idea what could cause this?

apport-retrace.txt (714.4 KB)
nrdiag-output.json.txt (61.0 KB)

Hi @bart6

Thank you for bringing this to our attention.

As this Segfault would need some additional investigation, I’m going to send you an email with some additional information that I’d like to have.

thanks

Rodrigo