|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54427 Segfault when emiting custom signal with object parameter
Submitted: 2011-03-30 19:01 UTC Modified: 2012-12-10 18:12 UTC
From: ptlis at ptlis dot net Assigned: auroraeosrose (profile)
Status: Closed Package: PHP-GTK related
PHP Version: 5.3.6 OS: Ubuntu 10.4
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:
Solve the problem:
42 + 9 = ?
Subscribe to this entry?

 [2011-03-30 19:01 UTC] ptlis at ptlis dot net
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:

/**	Class implements custom signal 'product-ready'. */
	class customDialog extends GtkDialog {
	    public $__gsignals	= array(
            		'product-ready'  => array(

		public function __construct($title, GtkWindow $parent) {
			parent::__construct($title, $parent, Gtk::DIALOG_MODAL);

			$product	= new stdClass();

			$okButton	= new GtkButton('OK');
			$okButton->connect_simple('clicked', array($this, 'ok_clicked'), $product);

		public function ok_clicked(stdClass $product) {
			$this->emit('product-ready', $product);

	$window	= new GtkWindow();

	$dialog	= new customDialog('fire signal dialog', $window);

	$dialog->connect('product-ready', 'product_ready');

	function product_ready() {
		echo 'segfaults on second signal' . "\n";
		return true;



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-18 20:04 UTC]
-Status: Open +Status: Feedback
 [2012-07-18 20:04 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

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
 [2012-08-26 11:39 UTC] ptlis at ptlis dot net
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:
Ubuntu 12.04:
 [2012-08-26 11:39 UTC] ptlis at ptlis dot net
-Status: Feedback +Status: Open
 [2012-08-26 11:43 UTC] ptlis at ptlis dot net
Oh, I forgot the gtk versions, dpkg reports

Ubuntu 10.04: 2.20.1-0ubuntu2.1
Ubuntu 12.04: 2.24.10-0ubuntu6 & 3.4.2-0ubuntu0.4
 [2012-12-10 18:12 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

 [2012-12-10 18:12 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: auroraeosrose
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 22:01:31 2024 UTC