php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59766 Calling _set, _base_set, _set (again) and _add segfaults
Submitted: 2011-05-13 11:36 UTC Modified: 2011-05-17 15:04 UTC
From: jille at hexon dot cx Assigned:
Status: Closed Package: libevent (PECL)
PHP Version: Irrelevant OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: jille at hexon dot cx
New email:
PHP Version: OS:

 

 [2011-05-13 11:36 UTC] jille at hexon dot cx
Description:
------------
event_set() resets which base the event belongs to. The extension does not register that and libevent will segfault.

Reproduce code:
---------------
<?php
  $ev = event_new();
  event_set($ev, udp_getSocket(), EV_READ, function() { });
  $base = event_base_new();  
  event_base_set($ev, $base);
  event_set($ev, udp_getSocket(), EV_READ | EV_WRITE, function() { });
  event_add($ev);
?>

Actual result:
--------------
Segmentation fault in event_add().

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-05-16 10:26 UTC] jille at hexon dot cx
It gets worse: When I got notified I there was data in my (own) write-buffer I tried:
  event_del($ev);
  event_set(..., EV_READ | EV_WRITE | EV_PERSIST, ...);
  event_base_set($ev, $base);
  event_add($ev);

but that segfaults somewhere in event_add() too. (I guess in the handlers add()-function, but I can't confirm that for sure with gdb)

Calling event_set() after using some event seems to be not-done.
 [2011-05-17 15:04 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.


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