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
 [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

Pull Requests

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: Thu Dec 26 13:01:30 2024 UTC