Bug #71129 [Com]: Segmentation fault on ZTS Embed SAPI

From: Date: Wed, 17 Feb 2016 14:31:01 +0000
Subject: Bug #71129 [Com]: Segmentation fault on ZTS Embed SAPI
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-199304@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
 Comment by:         maroszek at gmx dot net
 Reported by:        maroszek at gmx dot net
 Summary:            Segmentation fault on ZTS Embed SAPI
 Status:             Re-Opened
 Type:               Bug
 Package:            Reproducible crash
 Operating System:   OS X 10.11
 PHP Version:        7.0.0
 Block user comment: N
 Private report:     N

 New Comment:

Last time i tried, the segfauls weren't happening with this patch on OSX (the other error
remains). I can give it another try in the few days. Though i can only check the embed part.


Previous Comments:
------------------------------------------------------------------------
[2016-02-17 14:05:04] ab@php.net

Related To: Bug #71596

------------------------------------------------------------------------
[2016-02-16 15:16:43] ab@php.net

@maroszek, ping :) Were you able to test the patch i've linked in the previous post?

Thanks.

------------------------------------------------------------------------
[2016-01-11 17:33:36] ab@php.net

@maroszek With the segfault part, could you please check this patch? https://gist.github.com/weltling/e0922914dca8c8ee1886
If possible, please also test CLI and Apache. On my side, I was checking your embed implementation
on windows and linux with TS/NTS CLI and Apache as well, none of those shows an issue.

With the timeout part - i guess that your theory is not correct. What the while(true) loop does is
constantly processing the requests with the empty.php file. There is per se neither timeout, nor any
signal expected. It might be a race condition that block a request, so then it gets signaled after
30 seconds. I've got no OSX to investigate on this :( I guess there have to be some native OSX
tools for such cases. What I could also imagine that it could also be some OS specific issue with
the threading library, maybe if you explicitly link pthreads on OSX, it'll differ? 

Thanks.

------------------------------------------------------------------------
[2015-12-25 20:04:37] maroszek at gmx dot net

This really seems to be related to signaling, which seems to behave different on OS X. 

Disabling max_executing_time (or adding a simple return; in zend_bailout) seems to workaround the
problem.

Line for the crash.cpp sample
> php_embed_module.ini_entries = "max_execution_time=0\n\0";

Do you know if the signal handler (zend_timeout) needs to be called in the same thread as the timed
out script? (This does not seem to be the case for OS X)

There seems to be a known bug in SIGPROF on OS X, but as far as i have understood, it should be
fixes for El Capitan and therefore not the problem in my case. (http://research.swtch.com/macpprof)

------------------------------------------------------------------------
[2015-12-21 13:02:36] maroszek at gmx dot net

Most often the request does not block but throws the error immediately. Therefore OS X might be
*faster* somewhere and have a race condition, which checks for the timeout...

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


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 (#199304) next »