php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37296 segfault when doing drag and drop
Submitted: 2006-05-03 18:29 UTC Modified: 2006-08-05 19:51 UTC
From: cweiske@php.net Assigned:
Status: Closed Package: PHP-GTK related
PHP Version: 5.1.3 OS: Linux/Gentoo
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:
33 + 20 = ?
Subscribe to this entry?

 
 [2006-05-03 18:29 UTC] cweiske@php.net
Description:
------------
Bug in drag'n'drop:
Drag from "from" button to "to" button several (3) times.
You will get a segfault.
The segfault appears only if the drag-data-get signal is connected


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
);
$btnFrom->connect('drag-data-get', 'onGetDragData');


$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 onGetDragData($widget, $context, $selection, $info, $time) {
    echo $widget->get_name() . " drag-data-get\r\n";
    $selection->set_text('ThisIsTheContent');
}

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 20610)]
0xb7b793f5 in mallopt () from /lib/libc.so.6
(gdb) bt
#0  0xb7b793f5 in mallopt () from /lib/libc.so.6
#1  0xb7b78a91 in mallopt () from /lib/libc.so.6
#2  0xb7b77b33 in malloc () from /lib/libc.so.6
#3  0xb6f9177e in cairo_matrix_invert () from /usr/lib/libcairo.so.2
#4  0x0000020c in ?? ()
#5  0x3fecfcfc in ?? ()
#6  0xb6fc39f4 in ?? () from /usr/lib/libcairo.so.2
#7  0xb6f9161e in cairo_matrix_invert () from /usr/lib/libcairo.so.2
#8  0x08eb96b8 in ?? ()
#9  0x00000000 in ?? ()
#10 0xbf917fc8 in ?? ()
#11 0xb700ddb9 in gdk_cairo_set_source_color ()
   from /usr/lib/libgdk-x11-2.0.so.0
#12 0x00917fc0 in ?? ()
#13 0x08eb2ea8 in ?? ()
#14 0x08eb2ea0 in ?? ()
#15 0xb6f9131a in cairo_matrix_invert () from /usr/lib/libcairo.so.2
#16 0x08eb2ea8 in ?? ()
#17 0x00000000 in ?? ()
#18 0xbf917fa0 in ?? ()
#19 0x00000001 in ?? ()
#20 0x00000000 in ?? ()
#21 0x00000000 in ?? ()
#22 0x00000000 in ?? ()
#23 0xb6f85d8a in cairo_move_to () from /usr/lib/libcairo.so.2
#24 0x08eb2ea8 in ?? ()
#25 0x00000000 in ?? ()
#26 0x00000000 in ?? ()
#27 0x00000000 in ?? ()
#28 0x00000000 in ?? ()
#29 0x00000000 in ?? ()
#30 0x00000000 in ?? ()
#31 0x00000000 in ?? ()
#32 0xb6fc39f4 in ?? () from /usr/lib/libcairo.so.2
#33 0x08eb2ea0 in ?? ()
#34 0x08e96d28 in ?? ()
#35 0xb6f864f0 in cairo_rectangle () from /usr/lib/libcairo.so.2
#36 0x08eb2ea0 in ?? ()
#37 0x00000000 in ?? ()
#38 0x3ff00000 in ?? ()
#39 0x00000000 in ?? ()
#40 0x00000000 in ?? ()
#41 0xb6fc39f4 in ?? () from /usr/lib/libcairo.so.2
#42 0x08eb2ea0 in ?? ()
#43 0xb6f8523a in cairo_create () from /usr/lib/libcairo.so.2
#44 0x00000000 in ?? ()
#45 0x403f0000 in ?? ()
#46 0x00000000 in ?? ()
#47 0x405c8000 in ?? ()
#48 0x08eb2ea0 in ?? ()
#49 0xb707b0a8 in ?? () from /usr/lib/libgdk-x11-2.0.so.0
#50 0x08eb2ea0 in ?? ()
#51 0xb702803e in gdk_window_get_internal_paint_info ()
   from /usr/lib/libgdk-x11-2.0.so.0
#52 0x00000000 in ?? ()


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-08 17:34 UTC] anant@php.net
Similar situation here, no segfault, but a debug message:

GtkButton drag-data-get
drag-drop
string(8) "text/xml"
[Mon May  8 20:08:05 2006]  Script:  'bug_dnd_segfault_get.phpw'
---------------------------------------
 /var/tmp/portage/php-5.1.2-r1/work/php-5.1.2/Zend/zend_variables.h(35) : Block 0x08BDD0A4 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=0x00000000, Expected=0x7312F8DC)
End:      Unknown
---------------------------------------
 [2006-08-05 19:51 UTC] andrei@php.net
Fixed in CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 13:01:29 2024 UTC