Bug #74714 [NEW]: serialize() crashes with multiple threads / pthreads
| From: | benjamin dot roth at jaumo dot com | Date: | Thu, 08 Jun 2017 17:47:31 +0000 |
| Subject: | Bug #74714 [NEW]: serialize() crashes with multiple threads / pthreads | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-209424@lists.php.net to get a copy of this message | ||
From: benjamin dot roth at jaumo dot com
Operating system: Linux
PHP version: 7.1.5
Package: Reproducible crash
Bug Type: Bug
Bug description:serialize() crashes with multiple threads / pthreads
Description:
------------
serialize() seems to be not thread safe. Scripts crash with SIGSEGV or
SIGABORT on a regular basis if parallel threads do serialization with
pthreads. Sometimes this happens at the end of the script on shutdown
and sometimes in the middle of script execution. As it is a race
condition there is no deterministic way to reproduce it but the attached
script fails after some time in almost all cases.
Test script:
---------------
https://gist.github.com/brstgt/e04d08c237d84003103050dc7c371acd
Serialized file required as "entities.txt" in test script:
https://cl.ly/2v3Y1o2S351Q
Run in loop until it segfaults or aborts. Normally between 1-30s
while true; do php scripts/segv.php || break; done
Expected result:
----------------
No SIGABORT or SIGSEGV
Actual result:
--------------
https://gist.github.com/brstgt/76e3e1135872e2ae1770ae4e59b66696
--
Edit bug report at https://bugs.php.net/bug.php?id=74714&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74714&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74714&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74714&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74714&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74714&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74714&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74714&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74714&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74714&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74714&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74714&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74714&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74714&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74714&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74714&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74714&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74714&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74714&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74714&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74714&r=mysqlcfg