php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67196 APCu: Crash using APC in a thread
Submitted: 2014-05-03 22:14 UTC Modified: 2016-11-19 05:15 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: rmoisto at gmail dot com Assigned: krakjoe (profile)
Status: Closed Package: APC (PECL)
PHP Version: Irrelevant OS: All
Private report: No CVE-ID: None
 [2014-05-03 22:14 UTC] rmoisto at gmail dot com
Description:
------------
When attempting to use apc_store in a thread the script crashes.
To reproduce the pthreads and APC(u) extensions must be installed and enabled.

Setup on my Windows 7 and Windows 8.1:

Latest APC (3.1.13)
Latest pthreads (2.0.4)
Latest WampServer (with PHP 5.4.16)


Also reproduced on Ubuntu 13.10:

Latest APCu (4.0.4)
Latest pthreads (2.0.4)
Latest stable PHP (5.5.12)

Test script:
---------------
<?php
class MyThread extends Thread {
	public function run() {
		apc_store("key", "value");
	}
}
$thread = new MyThread();
$thread->start();

Expected result:
----------------
Script stores value and exits.

Actual result:
--------------
Script crashes or Segmentation fault.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-18 21:02 UTC] kalle@php.net
-Status: Open +Status: Wont fix
 [2016-11-18 21:02 UTC] kalle@php.net
APC is no longer supported in favor of opcache that comes bundled with PHP, if you wish to use the user cache, then look at PECL/APCu.
 [2016-11-19 01:33 UTC] rmoisto at gmail dot com
I was able to reproduce the issue with PHP 7.0 and using the latest binaries of APCu and pthreads I could find.

In the test script, replace "apc_store" with "apcu_store" when not using the backwards compatibility extension.
 [2016-11-19 02:56 UTC] kalle@php.net
-Summary: Crash using APC in a thread +Summary: APCu: Crash using APC in a thread -Status: Wont fix +Status: Re-Opened
 [2016-11-19 02:56 UTC] kalle@php.net
In that case, I'm re-opening the report and labeling it with the APCu prefix, as we do not have a distinct category for APCu =)

Thanks for your continuous help!
 [2016-11-19 05:15 UTC] krakjoe@php.net
-Status: Re-Opened +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2016-11-19 05:15 UTC] krakjoe@php.net
Fixed in latest sources.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 16:01:27 2024 UTC