私はこのサイトの壁に頭を向けて走っています。カスタムPHPモジュールによって引き起こされるApache2セグメンテーションフォールト
私のPHPプロジェクトの1つとして、私はスイス天体暦を使用して天文学的計算を行うことを可能にするPHPモジュールを使用しています。将来の開発プロセスはそれに依存します。だから私はそれをphp7で動作させる必要があります。このPHPモジュールは、swiss ephemeris(惑星位置を持つライブラリ)からc関数を利用して、モジュールを使用してPHPに含めるようにします。
このPHPモジュールのソースは、PHP5とUbuntu 14.04のために、このモジュールをcompillingすると、それが正常に動作しますが、私はPHP7とUbuntu 16.04のために、このモジュールをcompillingてるとき
here上で見つけることができます。私は代がPHP7に変更されたため、この機能の多くに1 PARAMTERがある理解しました、いくつかの試行錯誤の後
/home/hermes/Bureaublad/php-sweph-master/sweph.c:1098:2: error:
‘RETURN_STRING’ undeclared (first use in this function)
RETURN_STRING(name, 1);
:
は、私はこの1つのように、コンパイル時にエラーが出ません。 "、1"のパラメタをかなり多くの機能で削除した後。私は最終的にモジュールをコンパイルしても正常に動作しますが、すべての機能が正しく動作しているわけではありません。
apache2セグメンテーション違反errror(11)を引き起こす多くの機能があります。まあ同時に他の機能が完全に動作している。
だから、いくつか読んだ後、私はセグメンテーション違反を引き起こしているかを調べるためにapache2のデバッグを開始しましたが、この時点から、物事は何の意味を作っていけないさ...
私は、このガイドに従っ:"[notice] child pid XXXX exit signal Segmentation fault (11)" in apache error.log
GDBはこれを返しますが、私は、これはエラーの原因となっている私のPHPのモジュールとは何かを持っているか表示されません。..
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)
最終的に私は問題を見つけました! Thanxはgdbに間違ったプロセスを付けていたことを指摘してくれました。 – HermesTrismegistus