I have spent a few days scouring the internet and still am not able to get this issue resolved. Hoping the IBMi experts can chime in with some direction. I am on IBMi V7R3.
I can get a basic PHP page with phpinfo()
to display successfully with Nginx and PHP-FPM, however when I try a database connection using the newly installed ODBC driver I get a “502 Bad Gateway” response with the error logs below:
Nginx error:
upstream prematurely closed connection while reading response header from upstream
PHP-FPM error:
WARNING: [pool www] child #### exited on signal 11 (SIGSEGV) after 24.209474 seconds from start
One suggestion online was to enable a Core dump, but I am not sure what other configurations on the IBMi are needed to get this enabled. In the php-fpm.conf file I set rlimit_core = unlimited
but the PHP-FPM logs are still not showing the Core dump info. The log should update to “… child #### exited on signal 11 (SIGSEGV - core dumped)“, but I cannot seem to get the Core dump enabled. Any suggestions? Is this possible on the IBMi?
The other online suggestions for this issue/error were the session save_path permissions, or certain PHP extensions causing issues, but I have eliminated these suggestions as possible solutions thru troubleshooting and enabling/disabling, etc…
Let me know what other information that would be helpful in troubleshooting.
I did find a file named “core” in the same directory with my php script. So even though the log did not indicate “core dumped” I do see the core file.
I installed ‘gdb’ package via yum, and got the backtrace below:
Core was generated by `php-fpm'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0900000006867524 in std::locale::operator=(std::locale const&) () from /QOpenSys/pkgs/lib/libstdc++.so.6(shr_64.o)
(gdb) bt
#0 0x0900000006867524 in std::locale::operator=(std::locale const&) () from /QOpenSys/pkgs/lib/libstdc++.so.6(shr_64.o)
#10x090000000686d134 in std::ios_base::_M_init() () from /QOpenSys/pkgs/lib/libstdc++.so.6(shr_64.o)#20x09000000067d3128 in std::basic_ios<char, std::char_traits<char> >::init () from /QOpenSys/pkgs/lib/libstdc++.so.6(shr_64.o)#30x0900000007936d30 in global constructors keyed to 65535_0__QOpenSys_jenkins_workspace_odbc_core_source_picococo.cpp_AE91A18C_0xe63b5225263dd1() from /QOpenSys/pkgs/lib/libcwbcore.so
#40x0900000007987724 in _GLOBAL__FI_libcwbcore_so () from /QOpenSys/pkgs/lib/libcwbcore.so#50x0900000007987864 in _GLOBAL__AIXI_libcwbcore_so () from /QOpenSys/pkgs/lib/libcwbcore.so#60x0900000007812234 in _GLOBAL__FI_libcwbodbc_so () from /QOpenSys/pkgs/lib/libcwbodbc.so#70x09fffffff0002668 in mod_init1 () from /QOpenSys/sbin/usla#80x09fffffff0003848 in usl_init_mods () from /QOpenSys/sbin/usla#90x09fffffff0002204 in uload () from /QOpenSys/sbin/usla#100x09000000002bc198 in load1 () from /QOpenSys/usr/lib/libc.a(shr_64.o)#110x09000000002bd514 in load () from /QOpenSys/usr/lib/libc.a(shr_64.o)#120x0900000000315a70 in loadAndInit () from /QOpenSys/usr/lib/libc.a(shr_64.o)#130x090000000035260c in dlopen () from /QOpenSys/usr/lib/libc.a(shr_64.o)#140x090000000622089c in vm_open () from /QOpenSys/pkgs/lib/libltdl.so.7(shr_64.o)#150x090000000621a324 in tryall_dlopen () from /QOpenSys/pkgs/lib/libltdl.so.7(shr_64.o)#160x090000000621cbfc in try_dlopen () from /QOpenSys/pkgs/lib/libltdl.so.7(shr_64.o)#170x090000000621d368 in lt_dlopenadvise () from /QOpenSys/pkgs/lib/libltdl.so.7(shr_64.o)#180x090000000621d530 in lt_dlopen () from /QOpenSys/pkgs/lib/libltdl.so.7(shr_64.o)#190x09000000061bf968 in odbc_dlopen () from /QOpenSys/pkgs/lib/libodbc.so.2(shr_64.o)#200x09000000061c0278 in __connect_part_one () from /QOpenSys/pkgs/lib/libodbc.so.2(shr_64.o)#210x09000000061c7350 in SQLDriverConnect () from /QOpenSys/pkgs/lib/libodbc.so.2(shr_64.o)#220x0900000006420e50 in pdo_odbc_handle_factory () from /QOpenSys/pkgs/lib/php-7.3/extensions/pdo_odbc.so#230x090000000625697c in zim_PDO_dbh_constructor () from /QOpenSys/pkgs/lib/php-7.3/extensions/pdo.so#240x00000001000d12b8 in execute_ex (ex=0x9001000a0ac8188 <_ZN17PiSvRuntimeConfig4cfg_E+456>)at /HOME/QSECOFR/rpmbuild/BUILD/php-7.3.14/Zend/zend_execute.c:52397
#250x00000001000d3fc8 in zend_execute (op_array=0x9001000a0ac8188 <_ZN17PiSvRuntimeConfig4cfg_E+456>, return_value=0xfffffffffff48f0)at /HOME/QSECOFR/rpmbuild/BUILD/php-7.3.14/Zend/zend_execute.c:60939
#260x00000001000370b0 in zend_execute_scripts (type=-1599307384, retval=0xfffffffffff48f0, file_count=0)at /HOME/QSECOFR/rpmbuild/BUILD/php-7.3.14/Zend/zend.c:1568
#270x0000000100150c7c in php_execute_script (primary_file=0xffffffffffff650) at /HOME/QSECOFR/rpmbuild/BUILD/php-7.3.14/main/main.c:2639#280x0000000100001480 in main (argc=-2144116105, argv=0x180336277) at /HOME/QSECOFR/rpmbuild/BUILD/php-7.3.14/sapi/fpm/fpm/fpm_main.c:1950
I then entered the commands below, but didn’t get and details:
(gdb) print (char *)(executor_globals.function_state_ptr->function)->common.function_name
There is no member named function_state_ptr.
(gdb) print (char *)executor_globals.active_op_array->function_name
There is no member named active_op_array.
(gdb) print (char *)executor_globals.active_op_array->filename
There is no member named active_op_array.
I am exploring around at the frames in the backtrace currently. Let me know if there are any suggestions or indicates of what the problem may be.