Re: Apache segmentation fault when loading libphp7.so

"Christoph M. Becker" <[email protected]> Thu, 13 Aug 2020 10:31:27 +0200
Newsgroups gmane.comp.php.install
Message-ID <[email protected]>
On 12.08.2020 at 18:09, Kai F=C3=BCrstenberg wrote:

> Hello everybody,
>
> and thank you for you help so far.
>
> I played around with gdb a little bit.
>
> I re-configured php the way I did in 7.2 (just with some slight
> modifications), to use mysql, gd and some other things.
>
> But this time, httpd stops with
>
> Program received signal SIGSEGV, Segmentation fault.
> resolve_stripslashes () at
> /usr/src/apache_testing/php-7.4.9/Zend/zend_cpuinfo.h:157
> 157=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0 __builtin_cpu_init();
>
> Before I had the fault
>
> #0=C2=A0 resolve_base64_decode () at
> /usr/src/apache_testing/php-7.4.9/Zend/zend_cpuinfo.h:141
>
> Line 141 of zend_cpuinfo.h is the very same command
> __builtin_cpu_init()
>
> It seems, that exactly this command __builtin_cpu_init() fails for some
> reason...

Did you check config.log?  There is a test for __builtin_cpu_init()
availability[1] which apparently succeeds on your system, but it's worth
to actually look that up in config.log.  Maybe this test should use
AC_RUN_IFELSE instead of AC_LINK_IFELSE (and have the then and else
branch of the ternary operator swapped)?

[1]
<https://github.com/php/php-src/blob/php-7.3.21/acinclude.m4#L3261-L3278>

Christoph

> Kai
>
>
>
>
> Am 11.08.2020 um 20:24 schrieb [email protected]:
>> Hi Keith,
>>
>> Am 11.08.2020 um 16:51 schrieb Keith Roberts:
>>> You could try logging PHP startup errors:
>>>
>>> https://www.php.net/manual/en/errorfunc.configuration.php#ini.display-=
startup-errors
>>
>>
>>
>> this did not work. I have nothing on my screen or in any log.
>> php -i sais I used the correct php.ini
>>
>>> Or try running Apache daemon using valgrind:
>>>
>>> https://www.valgrind.org/docs/manual/quick-start.html
>>
>> This was REALLY strange. I don't know if this is expected behaviour,
>> but using valgrind, the server is up and running.
>>
>> I created a full output, ...
>>
>> (valgrind --leak-check=3Dfull --show-leak-kinds=3Dall -v
>> /usr/local/httpd-test/bin/httpd -k start)
>>
>> ... which you can find here:
>> https://pastebin.com/Dwgjxjgj
>>
>> Greets
>> Kai
>>
>>
>>
>>
>>
>>>
>>> HTH
>>>
>>> Keith
>>>
>>> On 11/08/2020 13:54, Kai F=C3=BCrstenberg wrote:
>>>> Hello Keith,
>>>>
>>>> no, it's not mod_alias, because debug log sais the module is loaded.
>>>> Without mod_alias it looks like below.
>>>>
>>>> When I comment out phplib7.so, the server starts and is online.
>>>>
>>>> I don't know if it helps: httpd sends a return code 139.
>>>> PHP in the CLI works.
>>>>
>>>>
>>>> [Tue Aug 11 14:49:21.635494 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module authn_file_module from
>>>> /usr/local/httpd-test/modules/mod_authn_file.so
>>>> [Tue Aug 11 14:49:21.635606 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module authn_core_module from
>>>> /usr/local/httpd-test/modules/mod_authn_core.so
>>>> [Tue Aug 11 14:49:21.635688 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module authz_host_module from
>>>> /usr/local/httpd-test/modules/mod_authz_host.so
>>>> [Tue Aug 11 14:49:21.635796 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module authz_groupfile_module from
>>>> /usr/local/httpd-test/modules/mod_authz_groupfile.so
>>>> [Tue Aug 11 14:49:21.635874 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module authz_user_module from
>>>> /usr/local/httpd-test/modules/mod_authz_user.so
>>>> [Tue Aug 11 14:49:21.666338 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module authz_core_module from
>>>> /usr/local/httpd-test/modules/mod_authz_core.so
>>>> [Tue Aug 11 14:49:21.666433 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module access_compat_module from
>>>> /usr/local/httpd-test/modules/mod_access_compat.so
>>>> [Tue Aug 11 14:49:21.666522 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module auth_basic_module from
>>>> /usr/local/httpd-test/modules/mod_auth_basic.so
>>>> [Tue Aug 11 14:49:21.666617 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module reqtimeout_module from
>>>> /usr/local/httpd-test/modules/mod_reqtimeout.so
>>>> [Tue Aug 11 14:49:21.666713 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module filter_module from
>>>> /usr/local/httpd-test/modules/mod_filter.so
>>>> [Tue Aug 11 14:49:21.666805 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module mime_module from
>>>> /usr/local/httpd-test/modules/mod_mime.so
>>>> [Tue Aug 11 14:49:21.666907 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module log_config_module from
>>>> /usr/local/httpd-test/modules/mod_log_config.so
>>>> [Tue Aug 11 14:49:21.666999 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module env_module from
>>>> /usr/local/httpd-test/modules/mod_env.so
>>>> [Tue Aug 11 14:49:21.667102 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module headers_module from
>>>> /usr/local/httpd-test/modules/mod_headers.so
>>>> [Tue Aug 11 14:49:21.667195 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module setenvif_module from
>>>> /usr/local/httpd-test/modules/mod_setenvif.so
>>>> [Tue Aug 11 14:49:21.667298 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module version_module from
>>>> /usr/local/httpd-test/modules/mod_version.so
>>>> [Tue Aug 11 14:49:21.667395 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module unixd_module from
>>>> /usr/local/httpd-test/modules/mod_unixd.so
>>>> [Tue Aug 11 14:49:21.667484 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module status_module from
>>>> /usr/local/httpd-test/modules/mod_status.so
>>>> [Tue Aug 11 14:49:21.667588 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module autoindex_module from
>>>> /usr/local/httpd-test/modules/mod_autoindex.so
>>>> [Tue Aug 11 14:49:21.667680 2020] [so:debug] [pid 25863:tid 308242579=
2]
>>>> mod_so.c(266): AH01575: loaded module dir_module from
>>>> /usr/local/httpd-test/modules/mod_dir.so
>>>> Speicherzugriffsfehler
>>>>
>>>> Kai
>>>>
>>>>
>>>> Am 11.08.2020 um 14:05 schrieb Keith Roberts:
>>>>> Hi Kai,
>>>>>
>>>>> Is it seg faulting when the mod_alias mod is loaded?
>>>>>
>>>>> Can you try to run apache and PHP module without the mod_alias
>>>>> module to
>>>>> see if it happens then?
>>>>>
>>>>> Kind Regards,
>>>>>
>>>>> Keith Roberts
>>>>>
>>>>> On 11/08/2020 11:21, Kai F=C3=BCrstenberg wrote:
>>>>>> /usr/local/httpd-test/modules/mod_dir.so
>>>>>> [Tue Aug 11 12:04:48.058215 2020] [so:debug] [pid 24664:tid
>>>>>> 3083007424]
>>>>>> mod_so.c(266): AH01575: loaded module alias_module from
>>>>>> /usr/local/httpd-test/modules/mod_alias.so
>>>>>> Speicherzugriffsfehler
>>>>>>
>>>>>> "Speicherzugrifftsfehler" =3D "Segmentation fault"