|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41843 Set text on cloned GtkLabel gives segmentation fault
Submitted: 2007-06-28 16:56 UTC Modified: 2008-03-10 19:44 UTC
From: john dot navratil at sbcglobal dot net Assigned:
Status: Closed Package: PHP-GTK related
PHP Version: 5.2.3 OS: Fedora 7
Private report: No CVE-ID: None
 [2007-06-28 16:56 UTC] john dot navratil at sbcglobal dot net
There is an apparent failure in cloning a GtkLabel (and perhaps other objects).  I tried to clone an existing label in order to capture all its properties but got a segmentation fault when reseting the text.

Reproduce code:
if (!extension_loaded('php-gtk'))

echo "Start\n";
$lbl = new GtkLabel('nada');
echo "Label created\n";
echo "Text set\n";
$lbl2 = clone $lbl;
echo "Label cloned\n";
$lbl2->set_text('New text'); // <-- Fails here
echo "Text reset\n";

Expected result:
Label created
Text set
Label cloned
Text reset

Actual result:
Label created
Text set
Label cloned
Segmentation fault


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-28 17:54 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

Cloning is not supported in PHP-GTK yet. We\'re hoping to resolve this 
 [2007-06-29 00:27 UTC] john dot navratil at sbcglobal dot net
Fair enough!  I assumed as much and will look forward to object cloning in the future.

Meanwhile, we might wish to review the docs at "language.oop5.cloning.php" which refers to cloning GTK (not +) windows.  It might also be a reasonable idea to implement the clone methods to throw an Exception("Cloning not supported") in the meantime.  A segmentation fault is a bit of a foul, don't you think?

I know it's beta software and I'm sure there is plenty to do.  Many thanks for what has been provided to date.
 [2007-06-29 01:13 UTC]
John has a point. Putting it onto the docs folk. (Sorry docs folk.)
 [2007-08-16 13:19 UTC]
Please document this in PHP-GTK documentation.
 [2007-08-16 19:03 UTC] m dot quinton at gmail dot com
clone operation is not supported by actual php-gtk.
 [2008-03-10 19:44 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

an attempted clone operation will now produce a fatal error instead of segfaulting - don't clone gtk objects ;)
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 18 23:01:30 2024 UTC