Bug #71129 [Csd->Fbk]: Segmentation fault on ZTS Embed SAPI

From: Date: Sun, 20 Dec 2015 14:35:54 +0000
Subject: Bug #71129 [Csd->Fbk]: Segmentation fault on ZTS Embed SAPI
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-198065@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71129&edit=1

 ID:                 71129
 Updated by:         ab@php.net
 Reported by:        maroszek at gmx dot net
 Summary:            Segmentation fault on ZTS Embed SAPI
-Status:             Closed
+Status:             Feedback
 Type:               Bug
 Package:            Reproducible crash
 Operating System:   OS X 11.11
 PHP Version:        7.0.0
 Block user comment: N
 Private report:     N

 New Comment:

@maroszek thanks for the check, a patch is now commited. I'm setting the status onto feedback
as you have yet more issues.

Unfortunately I've no Mac to test it. But how it sounds like, the crash and the timeout issues
are two separate things. As from your code, the requests should not be hanging but just running
through, so no timeouts are expected. Though, as you've already said, Mac will use another
threading library, so maybe it could condition the issue, but just a guess. You probably should
debug through and check which request are not running through and why. Maybe there's a way to
reproduce this on Linux as well. 

So set this to feedback, but i'd rather suggest to indeed close this one and to open another
ticket for the exact timeout issue you experience. Please feel free to do so if you think it's
ok.

Thanks.


Previous Comments:
------------------------------------------------------------------------
[2015-12-20 14:27:37] ab@php.net

Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=4c55669caa96f6202c2047a7baf6c5d5894d5fa7
Log: Partially fix bug #71129

------------------------------------------------------------------------
[2015-12-18 15:05:45] maroszek at gmx dot net

It seems to fix the segfault for Debian :)
But unfortunately this does not fix the problem on OS X. 

If you look at the error message:
<b>Fatal error</b>:  Maximum execution time of 30 seconds exceeded in
<b>Unknown</b> on line <b>0</b><br />

This does seems more like a timing/signaling bug, doesn't it? The timeout should never be
hit...

Do you have any chance to test this issue on OS X? Can i be of any further assistance?

------------------------------------------------------------------------
[2015-12-18 13:27:45] ab@php.net

Thanks for the update. Yeah, now it works. Please check whether this fixes the issue on your side

diff --git a/Zend/zend.c b/Zend/zend.c
index ec520b8..e122b04 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -467,7 +467,7 @@ static void auto_global_copy_ctor(zval *zv) /* {{{ */
        zend_auto_global *old_ag = (zend_auto_global *) Z_PTR_P(zv);
        zend_auto_global *new_ag = pemalloc(sizeof(zend_auto_global), 1);

-       new_ag->name = old_ag->name;
+       new_ag->name = zend_string_dup(old_ag->name, 0);
        new_ag->auto_global_callback = old_ag->auto_global_callback;
        new_ag->jit = old_ag->jit;


It namely didn't crash on my side, but after some debugging valgrind showed issues. This seems
pretty matching with the recent bug #71115.

Thanks.

------------------------------------------------------------------------
[2015-12-18 12:04:33] maroszek at gmx dot net

Hi! Thanks for verifying! For Debian you need to change it a bit.

This should work:
g++ crash.cpp -Imain -ITSRM -IZend -I. --std=c++11 -Llibs -lphp7 -lxml2 -lresolv -ldl -pthread

------------------------------------------------------------------------
[2015-12-18 11:41:53] ab@php.net

Thanks for the report. Currently the code you posted does not compile with gcc, what i have is 

g++ crash.cpp -Imain -ITSRM -IZend -I. --std=c++11 -Llibs -lphp7 -lxml2 -lresolv
crash.cpp:95:1: warning: deprecated conversion from string constant to 'char*'
[-Wwrite-strings]
 };
 ^
crash.cpp:95:1: warning: deprecated conversion from string constant to 'char*'
[-Wwrite-strings]
/usr/bin/ld: libs/libphp7.a(zend_API.o): undefined reference to symbol
'dlclose@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

Same parameters as yours, Jessie 64-bit. PHP compiled with the options you gave. Could you please
check?

Thanks.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=71129


--
Edit this bug report at https://bugs.php.net/bug.php?id=71129&edit=1


Thread (32 messages)

« previous php.bugs (#198065) next »