Bug #54427 [Fbk->Opn]: Segfault when emiting custom signal with object parameter

From: Date: Sun, 26 Aug 2012 11:39:54 +0000
Subject: Bug #54427 [Fbk->Opn]: Segfault when emiting custom signal with object parameter
References: 1  Groups: php.gtk.dev 
Request: Send a blank email to php-gtk-dev+get-4559@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=54427&edit=1 ID: 54427 User updated by: ptlis at ptlis dot net Reported by: ptlis at ptlis dot net Summary: Segfault when emiting custom signal with object parameter -Status: Feedback +Status: Open Type: Bug Package: PHP-GTK related Operating System: Ubuntu 10.4 PHP Version: 5.3.6 Block user comment: N Private report: N New Comment: I can reproduce this on clean installations of Ubuntu 10.04 & 12.04 with the following procedures (slight changes due to package name changes etc) Ubuntu 10.04: http://pastebin.com/vHuHDc3R Ubuntu 12.04: http://pastebin.com/gB0LRAkE Previous Comments: ------------------------------------------------------------------------ [2012-07-18 20:04:43] auroraeosrose@php.net Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. I can't reproduce this with the current version in git on 5.3 or 5.4 Can you try a newer compile of php-gtk? Also what gtk library version are you using, and are you using Ubuntu distro builds of php - if so please try with a stock build of PHP ------------------------------------------------------------------------ [2011-03-30 19:01:10] ptlis at ptlis dot net Description: ------------ The first time the OK button on the dialog is clicked the custom signal is emitted correctly, on the second click php segfaults on the call to emit(). If no object is provided to emit() the second signal emits without segfault as expected. Test script: --------------- <?php /** Class implements custom signal 'product-ready'. */ class customDialog extends GtkDialog { public $__gsignals = array( 'product-ready' => array( GObject::SIGNAL_RUN_LAST, GObject::TYPE_BOOLEAN, array( GObject::TYPE_PHP_VALUE ) ) ); public function __construct($title, GtkWindow $parent) { parent::__construct($title, $parent, Gtk::DIALOG_MODAL); $product = new stdClass(); $okButton = new GtkButton('OK'); $this->action_area->add($okButton); $okButton->connect_simple('clicked', array($this, 'ok_clicked'), $product); } public function ok_clicked(stdClass $product) { $this->emit('product-ready', $product); } } GObject::register_type('customDialog'); $window = new GtkWindow(); $window->show_all(); $dialog = new customDialog('fire signal dialog', $window); $dialog->show_all(); $dialog->connect('product-ready', 'product_ready'); function product_ready() { echo 'segfaults on second signal' . "\n"; return true; } Gtk::main(); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=54427&edit=1

« previous php.gtk.dev (#4559) next »