goodspb / pdlib

PHP extension for Dlib.
MIT License
70 stars 19 forks source link

segmentation fault in php-fpm #39

Open stavrak opened 3 years ago

stavrak commented 3 years ago

Issue: When i add the extension into the php.ini, php-fpm is not starting anymore returning segmentation fault.

Background: After seting the env variable for the pkg config (necessary for me to compile dlib, see https://discuss.getsol.us/d/5423-compiled-library-not-found/2) and installing lang/gcc before running ./configure (otherwise i got a library lstdc++ not found during make) i finally got it compiled. But if i add it to the php.ini the php-fpm service fails with segmentation fault.

System: Nextcloud plugin (12.1-RELEASE-p10) running on trueNas (TrueNAS-12.0-RELEASE) as jail (container). php version: 7.4.12

OliverPA77 commented 3 years ago

I have the same issue on TrueNAS-12.0-U1 and PHP 7.4.13, ie. seg fault when starting php. Tried as well in a separate jail without php-fpm - same result. Frustratingly even with all logging enabled in php.ini there isn't a trace of a log anywhere.

edit: Does it choke on reading a locale file?

gbd: Program received signal SIGSEGV, Segmentation fault. 0x00000008017f66d8 in vtable for cxxabiv1::si_class_type_info () from /lib/libcxxrt.so.1 (gdb) bt full

0 0x00000008017f66d8 in vtable for cxxabiv1::si_class_type_info () from /lib/libcxxrt.so.1

No symbol table info available.

1 0x0000000802ae1476 in __dynamic_cast () from /usr/local/lib/gcc9/libstdc++.so.6

No symbol table info available.

2 0x0000000802b63fae in bool std::has_facet<std::ctype >(std::locale const&) () from /usr/local/lib/gcc9/libstdc++.so.6

No symbol table info available.

3 0x0000000802b55cf4 in std::basic_ios<char, std::char_traits >::_M_cache_locale(std::locale const&) () from /usr/local/lib/gcc9/libstdc++.so.6

No symbol table info available.

4 0x0000000802b56190 in std::basic_ios<char, std::char_traits >::init(std::basic_streambuf<char, std::char_traits >*) () from /usr/local/lib/gcc9/libstdc++.so.6

No symbol table info available.

5 0x0000000802af5583 in std::ios_base::Init::Init() () from /usr/local/lib/gcc9/libstdc++.so.6

No symbol table info available.

6 0x000000080220f07e in static_initialization_and_destruction_0 (initialize_p=1, __priority=65535) at /usr/local/lib/gcc9/include/c++/iostream:74

No locals.

7 0x000000080220f0e5 in _GLOBAL__sub_I_pdlib.cc(void) () at /root/pdlib-1.0.2/pdlib.cc:308

No locals.

8 0x00000008006902fd in ?? () from /libexec/ld-elf.so.1

No symbol table info available.

9 0x00007fff00000000 in ?? ()

No symbol table info available.

10 0x0000000000000000 in ?? ()

No symbol table info available.

truss: .... open("/usr/share/locale/en_US.UTF-8/LC_CTYPE",O_RDONLY,013720646057) = 3 (0x3) fstat(3,{ mode=-r--r--r-- ,inode=5668,size=49880,blksize=50176 }) = 0 (0x0) mmap(0x0,49880,PROT_READ,MAP_PRIVATE,3,0x0) = 34409959424 (0x802fe5000) close(3) = 0 (0x0) munmap(0x802fe5000,49880) = 0 (0x0) SIGNAL 11 (SIGSEGV) code=SEGV_ACCERR trapno=12 addr=0x8017f66d8 process killed, signal = 11

rezeptpflichtig commented 3 years ago

hm, I'm stuck at the same point. I will try on a vanilla freebsd system to see if this is related to FreeNAS

adeepn commented 3 years ago

freebsd-12.2-p6 truss: .... munmap(0x801800000,2097152) = 0 (0x0) SIGNAL 11 (SIGSEGV) code=SEGV_MAPERR trapno=12 addr=0x804d255f0 process killed, signal = 11 (core dumped)

And gdb: (gdb) bt full

0 0x0000000804d255f0 in ?? ()

No symbol table info available.

1 0x0000000800e65491 in __cxa_finalize () from /lib/libc.so.7

No symbol table info available.

2 0x0000000800df7ed1 in exit () from /lib/libc.so.7

No symbol table info available.

3 0x000000000099c189 in main (argc=1, argv=0x7fffffffebe0) at sapi/cli/php_cli.c:1397

    c = -1
    exit_status = 0
    module_started = 1
    sapi_started = 1
    php_optarg = 0x0
    php_optind = 1
    use_extended_info = 0
    ini_path_override = 0x0
    ini_entries = 0x80117e000 "html_errors=0\nregister_argc_argv=1\nimplicit_flush=1\noutput_buffering=0\nmax_execution_time=0\nmax_input_time=-1\n"
    ini_entries_len = 110
    ini_ignore = 0
    sapi_module = 0xa2c240 <cli_sapi_module>
b10102016 commented 2 years ago

Hi, Is there any update on this? I encountered the same problem..

Thanks Jail version: 12.2-RELEASE-p6 image

ethnh commented 2 years ago

Hello, I am having the same issue on a vanilla FreeBSD system ( FreeBSD 13.0-RELEASE-p4 ) Are there any fixes?

qudiqudi commented 2 years ago

Performing sanity check on php-fpm configuration: Segmentation fault

no way of getting pdlib running on freebsd with php8

jasonhensler commented 2 years ago

Clean build on freebsd 13.1 with php8.0.19, dlib install from ports or from okg still showing segmentation fault for php-fpm.

qudiqudi commented 1 year ago

Still seg faults when building on freebsd. It's building fine but starting php-fpm with the extension seg faults. Using pkg dlib-cpp-19.22, php80

make test results in *** Error code 139

Lexden12 commented 1 year ago

Still seg faults when building on freebsd. It's building fine but starting php-fpm with the extension seg faults. Using pkg dlib-cpp-19.22, php80

make test results in *** Error code 139

I just ran into this issue today as well on TrueNAS-13.0-U2. Hoping there might be a fix sometime so I can get FaceRecognition installed.

brennoflavio commented 1 year ago

Could reproduce this error in freebsd with php 7.4 too

christianguenter1 commented 5 months ago

dito on php 8.2.17