Re: Apache segmentation fault when loading libphp7.so

Kai Fürstenberg <[email protected]> Thu, 13 Aug 2020 14:47:00 +0200
Newsgroups gmane.comp.php.install
Message-ID <[email protected]>
Am 13.08.2020 um 14:34 schrieb Christoph M. Becker:
> On 13.08.2020 at 13:47, Kai F=C3=BCrstenberg wrote:
>=20
>> Am 13.08.2020 um 12:53 schrieb Christoph M. Becker:
>>
>>> On 13.08.2020 at 11:52, Kai F=C3=BCrstenberg wrote:
>>>
>>>> Am 13.08.2020 um 10:31 schrieb Christoph M. Becker:
>>>>
>>>>> 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>
>>>>
>>>> config.log:
>>>> configure:13702: checking for __builtin_cpu_init
>>>> configure:13718: cc -o conftest -g -O2 -fvisibility=3Dhidden -pthrea=
d
>>>> -D_REENTRANT  conftest.c -lm -ldl  -lpthread >&5
>>>> configure:13718: $? =3D 0
>>>> configure:13721: result: yes
>>>> configure:13741: checking for __builtin_cpu_supports
>>>> configure:13757: cc -o conftest -g -O2 -fvisibility=3Dhidden -pthrea=
d
>>>> -D_REENTRANT  conftest.c -lm -ldl  -lpthread >&5
>>>> configure:13757: $? =3D 0
>>>> configure:13760: result: yes
>>>>
>>>> I just don't understand what you mean with the link...
>>>
>>> I basically suggested to apply
>>> <https://gist.github.com/cmb69/3fd0106ce78446c9e10e54eec21a4d82>, and=
 to
>>> run ./configure again.  Would the result still be "yes"?
>>
>> OK, so far so good.
>>
>> I just wonder, which file you want me to patch, because my acinclude.m=
4
>> (in Zend subfolder, v7.3) only has about 200 lines (the mentioned part=

>> is missing in this file) and in 7.4 this file is completely missing...=

>=20
> The patch is about acinclude.m4 in the toplevel folder:
> <https://github.com/php/php-src/blob/php-7.3.21/acinclude.m4>.

This file is not available in 7.4. In 7.3 it's there, but not 7.4.
I can try 7.3 with your patch. Just gimme some time and see if this works=
=2E

root@xserv01:/usr/src/apache_testing/php-7.4.9# ls -al
insgesamt 4528
drwxrwxr-x 20 root root    4096 Aug 13 13:32 .
drwxr-xr-x  5 root root    4096 Aug 12 13:24 ..
drwxrwxr-x  2 root root    4096 Aug  4 10:28 appveyor
-rw-rw-r--  1 root root    1560 Aug  4 10:28 .appveyor.yml
drwxrwxr-x  4 root root    4096 Aug  4 10:28 azure
-rw-rw-r--  1 root root    3342 Aug  4 10:28 azure-pipelines.yml
drwxrwxr-x  2 root root    4096 Aug  4 10:28 build
-rwxrwxr-x  1 root root    4012 Aug  4 10:28 buildconf
-rw-rw-r--  1 root root     346 Aug  4 10:28 buildconf.bat
-rw-rw-r--  1 root root   12737 Aug  4 10:28 CODING_STANDARDS.md
-rw-r--r--  1 root root  732953 Aug 13 10:09 config.log
-rwxr-xr-x  1 root root     380 Aug 13 10:09 config.nice
-rwxr-xr-x  1 root root   46739 Aug 13 10:09 config.status
-rwxr-xr-x  1 root root 2392341 Aug  4 10:28 configure
-rw-rw-r--  1 root root   44159 Aug  4 10:28 configure.ac
-rw-rw-r--  1 root root   20278 Aug  4 10:28 CONTRIBUTING.md
drwxrwxr-x  2 root root    4096 Aug  4 10:28 docs
-rw-rw-r--  1 root root     733 Aug  4 10:28 .editorconfig
drwxrwxr-x 74 root root    4096 Aug  4 10:28 ext
-rw-rw-r--  1 root root   23726 Aug  4 10:28 EXTENSIONS
-rw-rw-r--  1 root root   13302 Aug  4 10:28 .gdbinit
-rw-rw-r--  1 root root     758 Aug  4 10:28 .gitattributes
-rw-rw-r--  1 root root    8549 Aug  4 10:28 .gitignore
drwxr-xr-x  2 root root    4096 Aug 10 11:22 include
-rw-r--r--  1 root root    1120 Aug 13 10:11 libphp7.la
drwxr-xr-x  2 root root    4096 Aug 13 10:11 .libs
drwxr-xr-x  2 root root    4096 Aug 13 10:11 libs
-rwxr-xr-x  1 root root  210992 Aug 13 10:09 libtool
-rw-rw-r--  1 root root    3204 Aug  4 10:28 LICENSE
drwxrwxr-x  4 root root    4096 Aug 13 10:11 main
-rw-r--r--  1 root root  261499 Aug 13 10:09 Makefile
-rw-r--r--  1 root root   13159 Aug 13 10:09 Makefile.fragments
-rw-r--r--  1 root root  216866 Aug 13 10:09 Makefile.objects
drwxr-xr-x  2 root root    4096 Aug 13 10:12 modules
-rw-rw-r--  1 root root   77479 Aug  4 10:28 NEWS
drwxrwxr-x  2 root root    4096 Aug  4 10:28 pear
-rw-rw-r--  1 root root   72278 Aug  4 10:28 php.ini-development
-rw-rw-r--  1 root root   72582 Aug  4 10:28 php.ini-production
-rw-rw-r--  1 root root    4712 Aug  4 10:28 README.md
-rw-rw-r--  1 root root   29589 Aug  4 10:28 README.REDIST.BINS
-rwxrwxr-x  1 root root  126747 Aug  4 10:28 run-tests.php
drwxrwxr-x  9 root root    4096 Aug  4 10:28 sapi
drwxrwxr-x  4 root root    4096 Aug 13 10:09 scripts
drwxrwxr-x 10 root root    4096 Aug  4 10:28 tests
drwxrwxr-x  2 root root    4096 Aug  4 10:28 travis
-rw-rw-r--  1 root root    2613 Aug  4 10:28 .travis.yml
drwxrwxr-x  3 root root    4096 Aug 12 15:00 TSRM
-rw-rw-r--  1 root root   34344 Aug  4 10:28 UPGRADING
-rw-rw-r--  1 root root   15789 Aug  4 10:28 UPGRADING.INTERNALS
drwxrwxr-x  3 root root    4096 Aug  4 10:28 win32
drwxrwxr-x  4 root root   12288 Aug 12 15:02 Zend


Kai