php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78619 PHP7.4RC2 ZTS zend_signal_handler_defer crashes on apache shutdown
Submitted: 2019-10-01 10:22 UTC Modified: 2019-11-07 10:56 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: pawel dot filipczak at dynatrace dot com Assigned: krakjoe (profile)
Status: Assigned Package: Apache2 related
PHP Version: 7.4.0RC2 OS: Linux x64
Private report: No CVE-ID: None
 [2019-10-01 10:22 UTC] pawel dot filipczak at dynatrace dot com
Description:
------------
On Apache/2.4.7 (Unix) PHP/7.4.0RC2

Thread Safe

reproduction:
apache start
open phpinfo test script
send SIGINT to apache master process 


To reproduce, download and call run.sh:
https://dynatrace-my.sharepoint.com/:u:/p/pawel_filipczak/EQUzo-CajKxCn1l-WPwrXacBkyMSI183qbWOfX4gqkTtDg?e=omIyyn


Test script:
---------------
<?php

phpinfo();


Expected result:
----------------
exit code 0

Actual result:
--------------
(gdb) bt
#0  0x00007f4b8024c72b in zend_signal_handler_defer (signo=1, siginfo=0x7f4b1dffa7f0, context=0x7f4b1dffa6c0) at /php-src-php-7.4.0RC2/Zend/zend_signal.c:95
#1  <signal handler called>
#2  0x00007f4b8cbd6bb7 in epoll_wait (epfd=8, events=0x1130230, maxevents=50, timeout=100) at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
#3  0x00007f4b8d72c7e1 in impl_pollset_poll (pollset=0x1130188, timeout=<optimized out>, num=0x7f4b1dffaeb8, descriptors=0x7f4b1dffae98) at poll/unix/epoll.c:256
#4  0x00000000004687a3 in listener_thread (thd=0x1131060, dummy=<optimized out>) at event.c:1460
#5  0x00007f4b8d0b16db in start_thread (arg=0x7f4b1dffb700) at pthread_create.c:463
#6  0x00007f4b8cbd688f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-10-01 10:36 UTC] danack@php.net
Possibly relevant info - it appears that the way that PHP shuts down may have changed in PHP 7.4, and as far as I understand it, it appears that thread local storage is being destroyed before all the created threads are terminated. 

This was seen in Imagick for people using OpenMP - https://github.com/Imagick/imagick/issues/295#issuecomment-515212588 . For that, a hack appears to prevent the problem, which will be replaced by a proper solution when omp_pause_resource_all() is available on more systems.

That might be relevant, or not.
 [2019-11-07 10:56 UTC] nikic@php.net
-Assigned To: +Assigned To: krakjoe
 [2019-11-07 10:56 UTC] nikic@php.net
Possibly related to https://github.com/php/php-src/commit/68485f8ab4df0e1b3e4f446006ce25b6be358975.

Maybe krakjoe has an idea?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Oct 15 23:01:27 2024 UTC