|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74714 serialize() crashes with multiple threads / pthreads
Submitted: 2017-06-08 17:47 UTC Modified: -
From: benjamin dot roth at jaumo dot com Assigned:
Status: Open Package: Reproducible crash
PHP Version: 7.1.5 OS: Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-06-08 17:47 UTC] benjamin dot roth at jaumo dot com
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:

Serialized file required as "entities.txt" in test script:

Run in loop until it segfaults or aborts. Normally between 1-30s

while true; do php scripts/segv.php || break; done

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC