php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37298 segfault on php shutdown after drag and drop
Submitted: 2006-05-03 18:32 UTC Modified: 2006-08-05 18:57 UTC
From: cweiske@php.net Assigned:
Status: Closed Package: PHP-GTK related
PHP Version: 5.1.3 OS: Gentoo/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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: cweiske@php.net
New email:
PHP Version: OS:

 

 [2006-05-03 18:32 UTC] cweiske@php.net
Description:
------------
Bug in drag'n'drop:
Drag from "from" button to "to" button and close the window.
You will get a segfault.


Reproduce code:
---------------
<?php
$wnd = new GtkWindow();
$wnd->connect_simple('destroy', array('Gtk', 'main_quit'));
$hbox = new GtkHBox();
$wnd->add($hbox);

$btnFrom = new GtkButton('From');
$btnTo   = new GtkButton('To');

$hbox->pack_start($btnFrom);
$hbox->pack_start($btnTo);

$btnFrom->drag_source_set(
    Gdk::BUTTON1_MASK,
    //change to text/plain, and it works
    array(array('text/xml', 0, 1)),
    Gdk::ACTION_COPY | Gdk::ACTION_MOVE
);


$btnTo->drag_dest_set(
    Gtk::DEST_DEFAULT_ALL,
    //change to text/plain, and it works
    array(array('text/xml', 0, 1)),
    Gdk::ACTION_COPY | Gdk::ACTION_MOVE
);

$btnTo->connect('drag-drop', 'onDragDrop');

function onDragDrop($widget, $context, $x, $y, $time) {
    global $strMimeType, $strTypeNumber;

    echo "drag-drop\r\n";
    var_dump(
        $widget->drag_dest_find_target(
            $context, array(array('text/xml', 0, 1))
        )
    );
}

$wnd->show_all();
Gtk::main();
?>

Actual result:
--------------
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 20597)]
0x0831d37f in shutdown_memory_manager (silent=0, full_shutdown=0)
    at /data/cvs/php/php-5.1.2/Zend/zend_alloc.c:511
511                                     REMOVE_POINTER_FROM_LIST(ptr);
(gdb) bt
#0  0x0831d37f in shutdown_memory_manager (silent=0, full_shutdown=0)
    at /data/cvs/php/php-5.1.2/Zend/zend_alloc.c:511
#1  0x082f850d in php_request_shutdown (dummy=0x0)
    at /data/cvs/php/php-5.1.2/main/main.c:1303
#2  0x0839f120 in main (argc=2, argv=0xbfb79c64)
    at /data/cvs/php/php-5.1.2/sapi/cli/php_cli.c:1230


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-08 17:29 UTC] anant@php.net
I don't get a segfault when I the script but recieve this instead. I have debug enabled, otherwise I don't think the message would even appear.

---------------------------------------
/var/tmp/portage/php-5.1.2-r1/work/php-5.1.2/Zend/zend_variables.h(35) : Block 0x08BE40AC status:
/var/tmp/portage/php-5.1.2-r1/work/php-5.1.2/Zend/zend_variables.c(36) : Actual location (location was relayed)
Beginning:      Overrun (magic=0x554C4941, expected=0x7312F8DC)
End:      Unknown
---------------------------------------
drag-drop
string(8) "text/xml"
[Mon May  8 20:07:47 2006]  Script:  'bug_dnd_segfault_end.phpw'
---------------------------------------
/var/tmp/portage/php-5.1.2-r1/work/php-5.1.2/Zend/zend_variables.h(35) : Block 0x08BC906C status:
/var/tmp/portage/php-5.1.2-r1/work/php-5.1.2/Zend/zend_variables.c(36) : Actual location (location was relayed)
Beginning:      Overrun (magic=0x00000021, expected=0x7312F8DC)
       End:      Unknown
---------------------------------------
 [2006-08-05 18:57 UTC] andrei@php.net
This has already been fixed.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun May 19 12:01:26 2019 UTC