Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segmentation fault after upgrading from 10.17.0.7 to 10.18.0.8 (phpmig) #856

Open
tbjornli opened this issue Mar 18, 2024 · 5 comments
Open
Labels
bug Something isn't working

Comments

@tbjornli
Copy link

Description

After upgrading to 10.18.0.8 our database migration tools phpmig started crashing with segmentation fault. Reverting to 10.17.0.7 and everything works as normal.

The problem seems to happen only when using the dev-master branch from phpmig and not on the 1.7.0.

Steps to Reproduce

$ mkdir newrelic && cd newrelic
$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
$ php composer-setup.php 
$ php composer.phar require davedevelopment/phpmig=dev-master
$ vendor/bin/phpmig 
Segmentation fault (core dumped)

Expected Behavior

The script should not crash with a segmentation fault.

Your Environment

Ubuntu 22.04.4 LTS
PHP 8.1.2-1ubuntu2.14

@tbjornli tbjornli added the bug Something isn't working label Mar 18, 2024
@zsistla
Copy link
Contributor

zsistla commented Mar 18, 2024

Hi @tbjornli ,
Thank you for bringing this issue to our attention. Unfortunately, we cannot guarantee support for the agent when using development branches of packages. Additionally, you note you are using PHP 8.1; however, the phpmig's commit logs only show PHP 8.0 support in the master branch.
Since you note that the agent works with the official released version of phpmig 1.7.0, is there a reason you can't use that?
Alternatively, we have released a newer version of the agent 10.19.0.9, and we recommend you try with that to see if the problem persists.

@tbjornli
Copy link
Author

Since you note that the agent works with the official released version of phpmig 1.7.0, is there a reason you can't use that?

I will look into using 1.7.0, but the dev-master branch is a few commits ahead so I believe that there might be something preventing me from using 1.7.0, which I don't remember right now.

Alternatively, we have released a newer version of the agent 10.19.0.9, and we recommend you try with that to see if the problem persists.

I tried this version now and it has the same problem.

I'm willing to do some debugging if you would like more information about this issue, because maybe it affects other packages then just phpmig.
Is there anything in particular that I could do in order to assist you in figuring out the issue?

@zsistla
Copy link
Contributor

zsistla commented Mar 19, 2024

Hi @tbjornli ,

Can you please provide the segfault stack trace?
Thanks.

@tbjornli
Copy link
Author

tbjornli commented Apr 2, 2024

Core was generated by `php vendor/bin/phpmig'.                                                                          
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00005615a2835fe3 in zend_observer_fcall_end ()                                                                    
(gdb) bt                                                  
#0  0x00005615a2835fe3 in zend_observer_fcall_end ()
#1  0x00005615a2804489 in execute_ex ()
#2  0x00007f3d8eca4664 in xdebug_execute_ex (execute_data=0x7f3d8ca14d10) at ./build-8.1/src/base/base.c:779            
#3  0x00005615a27900a4 in zend_call_function ()      
#4  0x00005615a279048d in zend_call_known_function () 
#5  0x00005615a267dce2 in ?? ()                                                                                         
#6  0x00007f3d8eca437d in xdebug_execute_internal (current_execute_data=0x7f3d8ca14cc0, return_value=0x7f3d8ca14c00) at ./build-8.1/src/base/base.c:897                                                                                         
#7  0x00005615a25d662a in ?? ()                        
#8  0x00005615a25d7313 in ?? ()                                                                                         
#9  0x00007f3d8eca4664 in xdebug_execute_ex (execute_data=0x7f3d8ca14b10) at ./build-8.1/src/base/base.c:779
#10 0x00005615a25d6595 in ?? ()                                                                                         
#11 0x00005615a25d7313 in ?? ()                                                                                         
#12 0x00007f3d8eca4664 in xdebug_execute_ex (execute_data=0x7f3d8ca14920) at ./build-8.1/src/base/base.c:779
#13 0x00005615a25d6595 in ?? ()                           
#14 0x00005615a25d7313 in ?? ()                                                                                         
#15 0x00007f3d8eca4664 in xdebug_execute_ex (execute_data=0x7f3d8ca14890) at ./build-8.1/src/base/base.c:779            
#16 0x00005615a25d6595 in ?? ()                                                                                         
#17 0x00005615a25d7313 in ?? ()                          
#18 0x00007f3d8eca4664 in xdebug_execute_ex (execute_data=0x7f3d8ca147b0) at ./build-8.1/src/base/base.c:779            
#19 0x00005615a25d6595 in ?? ()                                                                                         
#20 0x00005615a25d7313 in ?? ()              
#21 0x00007f3d8eca4664 in xdebug_execute_ex (execute_data=0x7f3d8ca14700) at ./build-8.1/src/base/base.c:779                                                                                                                                    
#22 0x00005615a25d6595 in ?? ()  
#23 0x00005615a25d7313 in ?? ()                                                                                                                                                                                                                 
#24 0x00007f3d8eca4664 in xdebug_execute_ex (execute_data=0x7f3d8ca14530) at ./build-8.1/src/base/base.c:779            
#25 0x00005615a25d6595 in ?? ()                                                                                         
#26 0x00005615a25d7313 in ?? ()    
#27 0x00007f3d8eca4664 in xdebug_execute_ex (execute_data=0x7f3d8ca144a0) at ./build-8.1/src/base/base.c:779            
#28 0x00005615a25d6595 in ?? ()  
#29 0x00005615a25d7313 in ?? ()  
#30 0x00007f3d8eca4664 in xdebug_execute_ex (execute_data=0x7f3d8ca142f0) at ./build-8.1/src/base/base.c:779                                                                                                                                    
#31 0x00005615a25d6595 in ?? ()   
#32 0x00005615a25d7313 in ?? ()                                                                                         
#33 0x00007f3d8eca4664 in xdebug_execute_ex (execute_data=0x7f3d8ca14180) at ./build-8.1/src/base/base.c:779            
#34 0x00005615a27de27c in ?? ()                                                                                         
#35 0x00005615a2804283 in execute_ex ()  
#36 0x00007f3d8eca4664 in xdebug_execute_ex (execute_data=0x7f3d8ca14020) at ./build-8.1/src/base/base.c:779            
#37 0x00005615a280e049 in zend_execute ()                                                                               
#38 0x00005615a279e9d0 in zend_execute_scripts ()                                                                       
#39 0x00005615a273a01a in php_execute_script ()      
#40 0x00005615a2886a2e in ?? ()                     
#41 0x00005615a25e1837 in ?? ()               
#42 0x00007f3d8f029d90 in __libc_start_call_main (main=main@entry=0x5615a25e1460, argc=argc@entry=2, argv=argv@entry=0x7fff56c63318) at ../sysdeps/nptl/libc_start_call_main.h:58                                                               
#43 0x00007f3d8f029e40 in __libc_start_main_impl (main=0x5615a25e1460, argc=2, argv=0x7fff56c63318, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff56c63308) at ../csu/libc-start.c:392                 
#44 0x00005615a25e2995 in _start () 

@zsistla
Copy link
Contributor

zsistla commented Apr 2, 2024

Hi @tbjornli ,

Thanks for the stack trace.

  1. Please note that we cannot guarantee functionality or provide support when our agent is used in conjunction with other monitoring software and other monitoring SWs typically also do not guarantee correctly working with other monitoring SWs.

The stack trace you provided is full of Xdebug calls, and it is another monitoring SW so we cannot guarantee the agent.
You could try removing this and see if the issue still occurs.

  1. zend_observer_fcall_end ()
    This is the last call in the stack trace. Unfortunately, there is a known PHP issue regarding this Segmentation fault when OPcache is enabled along with an extension utilising the Observer API php/php-src#13817 that we have seen cause segfaults when hooking into PHP's Observer API with an otherwise empty extension.
    PHP has enacted some fixes, you could try upgrading to PHP 8.2 to see if it is resolved.

Again, as mentioned earlier, apologies, but unfortunately, we cannot guarantee functionality or provide support for the agent when using development branches of packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants