php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59277 Calling event_del cause segfault under 5.2.x and libevent 1.4.11-stable1
Submitted: 2010-06-21 22:34 UTC Modified: 2010-06-22 04:01 UTC
From: b at turbulent dot ca Assigned:
Status: Closed Package: libevent (PECL)
PHP Version: 5.2.10 OS: ubuntu karmic
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:
49 - 6 = ?
Subscribe to this entry?

 
 [2010-06-21 22:34 UTC] b at turbulent dot ca
Description:
------------
Simply moving the ZVAL_TO_EVENT conversion before the base 
check in the code will fix the issue.

Enclosed patch:


--- libevent.c.orig	2010-06-22 02:31:54.000000000 +0000
+++ libevent.c	2010-06-22 02:32:12.000000000 +0000
@@ -657,12 +657,13 @@
 		return;
 	}
 
+	ZVAL_TO_EVENT(zevent, event);
+
 	if (!event->base) {
 		php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Unable to delete event without an event base");
 		RETURN_FALSE;
 	}
 
-	ZVAL_TO_EVENT(zevent, event);
 	if (event_del(event->event) == 0) {
 		RETURN_TRUE;
 	}


Reproduce code:
---------------
Not required, patch included.

Expected result:
----------------
Not required, patch included.

Actual result:
--------------
Not required, patch included.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-22 04:01 UTC] tony at daylessday dot org
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

Yes, thanks, I've fixed that in SVN 3 weeks ago.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri May 29 17:01:40 2020 UTC