php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63517 Segmentation Fault
Submitted: 2012-11-14 16:05 UTC Modified: 2012-11-15 07:57 UTC
From: j dot pardons at redline-hosting dot eu Assigned: krakjoe (profile)
Status: Closed Package: pthreads (PECL)
PHP Version: 5.3.18 OS: Debian
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
41 - 6 = ?
Subscribe to this entry?

 
 [2012-11-14 16:05 UTC] j dot pardons at redline-hosting dot eu
Description:
------------
I tried the sample thread example, but I got a Segmentation Fault

Here is the backtrace:

#0  0x083b14be in clean_module_class (ce=0xa4f3544, module_number=0xb6d9e07c, tsrm_ls=0xa46b9e0) at /home/php-5.3.18/Zend/zend_API.c:2091
2091		if ((*ce)->type == ZEND_INTERNAL_CLASS && (*ce)->module->module_number == *module_number) {


(gdb) bt
#0  0x083b14be in clean_module_class (ce=0xa4f3544, module_number=0xb6d9e07c, tsrm_ls=0xa46b9e0) at /home/php-5.3.18/Zend/zend_API.c:2091
#1  0x083bbf5b in zend_hash_apply_with_argument (ht=0xa4f1000, apply_func=0x83b14a0 <clean_module_class>, argument=0xb6d9e07c, tsrm_ls=0xa46b9e0) at /home/php-5.3.18/Zend/zend_hash.c:698
#2  0x083b56f9 in clean_module_classes (module=0xa468b40) at /home/php-5.3.18/Zend/zend_API.c:2101
#3  module_destructor (module=0xa468b40) at /home/php-5.3.18/Zend/zend_API.c:2112
#4  0x083bbdc8 in zend_hash_apply_deleter (ht=0x894eee0, p=0xa428610) at /home/php-5.3.18/Zend/zend_hash.c:612
#5  0x083bbed2 in zend_hash_reverse_apply (ht=0x894eee0, apply_func=0x83b1500 <module_registry_unload_temp>, tsrm_ls=0xa46b9e0) at /home/php-5.3.18/Zend/zend_hash.c:762
#6  0x083af58a in zend_post_deactivate_modules (tsrm_ls=0xa46b9e0) at /home/php-5.3.18/Zend/zend.c:937
#7  0x08353196 in php_request_shutdown (dummy=0xa46b9e0) at /home/php-5.3.18/main/main.c:1673
#8  0xb6f8577d in pthreads_routine (arg=0xa46b688) at /home/pthreads-0.0.37/src/object.c:808
#9  0xb70f6955 in start_thread () from /lib/i686/cmov/libpthread.so.0
#10 0xb70761de in clone () from /lib/i686/cmov/libc.so.6


Test script:
---------------
<?php
dl('pthreads.so');
class ThreadTest extends Thread {
	public function run(){
		$i=0;
		while(++$i<100){
			continue;
		}
		return $i;
	}
}
$thread = new ThreadTest();
if($thread->start())
	var_dump($thread->join());




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-15 07:57 UTC] krakjoe@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.

This was due to how pthreads initialized class entries in the threading contexts 
it creates which has been completely revised.
 [2012-11-15 07:57 UTC] krakjoe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: krakjoe
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 01:01:30 2024 UTC