0
votes

I have written one extension for PHP in c++ with the hep of this tutorial http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/. In my extension i am creating threads and executing mysql queries. The code is running fine but after running i am getting this error "Segmentation fault (core dumped)".

I tried "gdb" debugger and i am getting this

"Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffff7eb2700 (LWP 11985)]"

let me know any way i find the causing this problem.

1
"The code is running fine but after running i am getting this error "Segmentation fault (core dumped)"." - That is an odd working definition of the word "fine". If you ran gdb it should have stopped when the exception was raised, and in doing so exposed you to the call-stack and variable conditions/values that are current at the time of the offense. You've gone through the trouble of running in a debugger (good). Now all that is left is the actual debugging. - WhozCraig
segmenation fault is coming at the end on program execution - PHP Connect

1 Answers

0
votes

You could use bt full command within gdb to examine the call stack. Please make sure that you have compiled you extension with the -O0 -g flags and have linked with the -g flag.