php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37552 Crash when deleting list row in foreach() callback
Submitted: 2006-05-22 20:08 UTC Modified: 2006-06-15 04:34 UTC
From: cweiske@php.net Assigned:
Status: Wont fix Package: PHP-GTK related
PHP Version: 5.1.4 OS: Any
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cweiske@php.net
New email:
PHP Version: OS:

 

 [2006-05-22 20:08 UTC] cweiske@php.net
Description:
------------
When removing an iterator from a liststore in the foreach() callback, php crashes with
*** glibc detected *** double free or corruption (fasttop): 0x08d92758 ***



Reproduce code:
---------------
<?php
$ls = new GtkListStore(Gtk::TYPE_STRING);
$ls->append(array('test'));
$ls->foreach('foreachList');
function foreachList($ls, $path, $iter) {
    $ls->remove($iter);
}
?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-15 04:27 UTC] andrei@php.net
I'm not sure we can do much here. PyGTK crashes on similar code as well. We may need to post a question on gtk mailing list and see if they have any suggestions.
 [2006-06-15 04:34 UTC] cweiske@php.net
The docs for some callbacks explicitely state that you may not modify/delete the rows; seems this was missing here.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 18:01:30 2024 UTC