I'm running with my head against the wall on this one.
For one of my php projects, i'm using a php module which make it possible to do some astronomical calculations using the swiss ephemeris. Future development processes do depend on it. So i need to get it working in php7. This php module makes c functions available from the swiss ephemeris(a library with planet positions) for inclusion in php using a module.
The source of this php module can be found over here
When compilling this module for php5 and ubuntu 14.04 it works fine, but when i'm compilling this module for php7 and ubuntu 16.04.
I do get errors when compiling, like this one:
/home/hermes/Bureaublad/php-sweph-master/sweph.c:1098:2: error:
‘RETURN_STRING’ undeclared (first use in this function)
RETURN_STRING(name, 1);
After some trial and error, i did figure out there is one paramter to many in this functions, because somethings have been changed in php7. After removing the ", 1" paramater in quite a lot functions. I finally got the module compiled and it runs fine, but not all the functions are working correctly.
There are a lot of functions that cause a apache2 segmentation fault errror(11). Well at the same time other function are working perfectly.
So after some reading i started debugging apache2 to find out what is causing the segmentation fault, but from this point on, things are dont making any sense...
I followed this guide: "[notice] child pid XXXX exit signal Segmentation fault (11)" in apache error.log
GDB returns this, but i don't see how this has anything to do with my php module which is causing the error..
gdb attach 19966
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.04) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show
copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
attach: Bestand of map bestaat niet.
Attaching to process 19966
Reading symbols from /bin/bash...(no debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libtinfo.so.5...(no
debugging symbols found)...done.
Reading symbols from /lib/x86_64-linux-gnu/libdl.so.2...Reading
symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libdl-2.23.so...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libc.so.6...Reading
symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libc-
2.23.so...done.
done.
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols
from /usr/lib/debug//lib/x86_64-linux-gnu/ld-2.23.so...done.
done.
Reading symbols from /lib/x86_64-linux-
gnu/libnss_compat.so.2...Reading symbols from
/usr/lib/debug//lib/x86_64-linux-gnu/libnss_compat-2.23.so...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libnsl.so.1...Reading
symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libnsl-
2.23.so...done.
done.
Reading symbols from /lib/x86_64-linux-gnu/libnss_nis.so.2...Reading
symbols from /usr/lib/debug//lib/x86_64-linux-gnu/libnss_nis-
2.23.so...done.
done.
Reading symbols from /lib/x86_64-linux-
gnu/libnss_files.so.2...Reading symbols from
/usr/lib/debug//lib/x86_64-linux-gnu/libnss_files-2.23.so...done.
done.
0x00007fdc29a1f4ca in __GI___waitpid (pid=-1,
stat_loc=0x7ffe86bd85f0, options=10)
at ../sysdeps/unix/sysv/linux/waitpid.c:29
29 ../sysdeps/unix/sysv/linux/waitpid.c: Bestand of map bestaat niet.
(gdb) back
#0 0x00007fdc29a1f4ca in __GI___waitpid (pid=-1,
stat_loc=0x7ffe86bd85f0, options=10)
at ../sysdeps/unix/sysv/linux/waitpid.c:29
#1 0x0000000000446f5d in ?? ()
#2 0x000000000044843b in wait_for ()
#3 0x000000000043842f in execute_command_internal ()
#4 0x000000000043848e in execute_command ()
#5 0x000000000042139e in reader_loop ()
#6 0x000000000041fdb1 in main ()
(gdb) back full
#0 0x00007fdc29a1f4ca in __GI___waitpid (pid=-1,
stat_loc=0x7ffe86bd85f0, options=10)
at ../sysdeps/unix/sysv/linux/waitpid.c:29
resultvar = 18446744073709551104
#1 0x0000000000446f5d in ?? ()
No symbol table info available.
#2 0x000000000044843b in wait_for ()
No symbol table info available.
#3 0x000000000043842f in execute_command_internal ()
No symbol table info available.
#4 0x000000000043848e in execute_command ()
No symbol table info available.
#5 0x000000000042139e in reader_loop ()
No symbol table info available.
#6 0x000000000041fdb1 in main ()
No symbol table info available.
(gdb)
Attaching to process 19966
Reading symbols from /bin/bash...(no debugging symbols found)...done.
Looks like you've attached to a wrong pid number. Namely you attached to /bin/bash
, one of your shell instances. You want to attach to Apache2 process. Look at ps
output once again and find there your Apache2 instance as suggested in "[notice] child pid XXXX exit signal Segmentation fault (11)" in apache error.log.