#47063 [Opn]: PHP-GTK

[email protected] ("db4fn1 dot snl at gishpuppy dot com")
Newsgroups php.gtk.dev
Message-ID <[email protected]>
 ID:               47063
 User updated by:  db4fn1 dot snl at gishpuppy dot com
 Reported By:      db4fn1 dot snl at gishpuppy dot com
 Status:           Open
 Bug Type:         PHP-GTK related
 Operating System: Ubuntu
 PHP Version:      5.2.8
 New Comment:

Using some packages I found on the Internet
(http://www.compdigitec.com/labs/2009/01/14/binary-packages-php-cli-528-and-php-gtk-201/),
it can be confirmed this bug still exists:

$ php --version
PHP 5.2.8 (cli) (built: Jan 11 2009 11:58:17) (DEBUG)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

$ php -c phpgtk.ini app.php 
Segmentation fault (core dumped)

$ gdb php core
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(no debugging symbols found)

Reading symbols from /lib/tls/i686/cmov/libcrypt.so.1...(no debugging
symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libcrypt.so.1
Reading symbols from /usr/lib/libz.so.1...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libz.so.1
Reading symbols from /usr/lib/libexslt.so.0...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libexslt.so.0
Reading symbols from /usr/lib/libtidy-0.99.so.0...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libtidy-0.99.so.0
Reading symbols from /lib/tls/i686/cmov/librt.so.1...
(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/librt.so.1
Reading symbols from /usr/lib/libmysqlclient.so.15...(no debugging
symbols found)...done.
Loaded symbols for /usr/lib/libmysqlclient.so.15
Reading symbols from /lib/tls/i686/cmov/libpthread.so.0...
(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libpthread.so.0
Reading symbols from /usr/lib/libmhash.so.2...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libmhash.so.2
Reading symbols from /lib/tls/i686/cmov/libresolv.so.2...
(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libresolv.so.2
Reading symbols from /lib/tls/i686/cmov/libdl.so.2...(no debugging
symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libdl.so.2
Reading symbols from /lib/tls/i686/cmov/libnsl.so.1...
(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libnsl.so.1
Reading symbols from /usr/lib/i686/cmov/libssl.so.0.9.8...(no debugging
symbols found)...done.
Loaded symbols for /usr/lib/i686/cmov/libssl.so.0.9.8
Reading symbols from /usr/lib/i686/cmov/libcrypto.so.0.9.8...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/i686/cmov/libcrypto.so.0.9.8
Reading symbols from /usr/lib/libcurl.so.4...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libcurl.so.4
Reading symbols from /usr/lib/libgssapi_krb5.so.2...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libgssapi_krb5.so.2
Reading symbols from /usr/lib/libidn.so.11...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libidn.so.11
Reading symbols from /usr/lib/libldap_r-2.4.so.2...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libldap_r-2.4.so.2
Reading symbols from /usr/lib/libkrb5.so.3...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libkrb5.so.3
Reading symbols from /usr/lib/libk5crypto.so.3...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libk5crypto.so.3
Reading symbols from /lib/libcom_err.so.2...(no debugging symbols
found)...done.
Loaded symbols for /lib/libcom_err.so.2
Reading symbols from /usr/lib/libxslt.so.1...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libxslt.so.1
Reading symbols from /lib/tls/i686/cmov/libm.so.6...(no debugging
symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libm.so.6
Reading symbols from /usr/lib/libxml2.so.2...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libxml2.so.2
Reading symbols from /lib/tls/i686/cmov/libc.so.6...(no debugging
symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libc.so.6
Reading symbols from /lib/libgcrypt.so.11...
(no debugging symbols found)...done.
Loaded symbols for /lib/libgcrypt.so.11
Reading symbols from /lib/ld-linux.so.2...(no debugging symbols
found)...done.
Loaded symbols for /lib/ld-linux.so.2
Reading symbols from /usr/lib/libkrb5support.so.0...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libkrb5support.so.0
Reading symbols from /lib/libkeyutils.so.1...(no debugging symbols
found)...done.
Loaded symbols for /lib/libkeyutils.so.1
Reading symbols from /usr/lib/liblber-2.4.so.2...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/liblber-2.4.so.2
Reading symbols from /usr/lib/libsasl2.so.2...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libsasl2.so.2
Reading symbols from /usr/lib/libgnutls.so.26...
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libgnutls.so.26
Reading symbols from /usr/lib/libtasn1.so.3...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libtasn1.so.3
Reading symbols from /lib/libgpg-error.so.0...
(no debugging symbols found)...done.
Loaded symbols for /lib/libgpg-error.so.0
Reading symbols from
/usr/lib/php/extensions/debug-non-zts-20060613/php_gtk2.so...(no
debugging symbols found)...done.
Loaded symbols for
/usr/lib/php/extensions/debug-non-zts-20060613/php_gtk2.so
Reading symbols from /usr/lib/libgtk-x11-2.0.so.0...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libgtk-x11-2.0.so.0
Reading symbols from /usr/lib/libgdk-x11-2.0.so.0...(no debugging
symbols found)...done.
Loaded symbols for /usr/lib/libgdk-x11-2.0.so.0
Reading symbols from /usr/lib/libpangoft2-1.0.so.0...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libpangoft2-1.0.so.0
Reading symbols from /usr/lib/libgdk_pixbuf-2.0.so.0...(no debugging
symbols found)...done.
Loaded symbols for /usr/lib/libgdk_pixbuf-2.0.so.0
Reading symbols from /usr/lib/libpangocairo-1.0.so.0...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libpangocairo-1.0.so.0
Reading symbols from /usr/lib/libgio-2.0.so.0...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libgio-2.0.so.0
Reading symbols from /usr/lib/libcairo.so.2...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libcairo.so.2
Reading symbols from /usr/lib/libfreetype.so.6...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libfreetype.so.6
Reading symbols from /usr/lib/libfontconfig.so.1...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libfontconfig.so.1
Reading symbols from /usr/lib/libatk-1.0.so.0...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libatk-1.0.so.0
Reading symbols from /usr/lib/libpango-1.0.so.0...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libpango-1.0.so.0
Reading symbols from /usr/lib/libgobject-2.0.so.0...(no debugging
symbols found)...done.
Loaded symbols for /usr/lib/libgobject-2.0.so.0
Reading symbols from /usr/lib/libgmodule-2.0.so.0...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libgmodule-2.0.so.0
Reading symbols from /usr/lib/libgthread-2.0.so.0...(no debugging
symbols found)...done.
Loaded symbols for /usr/lib/libgthread-2.0.so.0
Reading symbols from /usr/lib/libglib-2.0.so.0...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libglib-2.0.so.0
Reading symbols from /usr/lib/libstdc++.so.6...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/libgcc_s.so.1...
(no debugging symbols found)...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /usr/lib/libX11.so.6...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libX11.so.6
Reading symbols from /usr/lib/libXcomposite.so.1...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXcomposite.so.1
Reading symbols from /usr/lib/libXdamage.so.1...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libXdamage.so.1
Reading symbols from /usr/lib/libXfixes.so.3...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXfixes.so.3
Reading symbols from /usr/lib/libXext.so.6...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libXext.so.6
Reading symbols from /usr/lib/libXrender.so.1...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXrender.so.1
Reading symbols from /usr/lib/libXinerama.so.1...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libXinerama.so.1
Reading symbols from /usr/lib/libXi.so.6...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXi.so.6
Reading symbols from /usr/lib/libXrandr.so.2...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libXrandr.so.2
Reading symbols from /usr/lib/libXcursor.so.1...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXcursor.so.1
Reading symbols from /lib/libselinux.so.1...(no debugging symbols
found)...done.
Loaded symbols for /lib/libselinux.so.1
Reading symbols from /usr/lib/libpixman-1.so.0...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libpixman-1.so.0
Reading symbols from /usr/lib/libpng12.so.0...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libpng12.so.0
Reading symbols from /usr/lib/libxcb-render-util.so.0...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libxcb-render-util.so.0
Reading symbols from /usr/lib/libxcb-render.so.0...(no debugging
symbols found)...done.
Loaded symbols for /usr/lib/libxcb-render.so.0
Reading symbols from /usr/lib/libxcb.so.1...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libxcb.so.1
Reading symbols from /usr/lib/libexpat.so.1...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libexpat.so.1
Reading symbols from /lib/libpcre.so.3...
(no debugging symbols found)...done.
Loaded symbols for /lib/libpcre.so.3
Reading symbols from /usr/lib/libxcb-xlib.so.0...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libxcb-xlib.so.0
Reading symbols from /usr/lib/libXau.so.6...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/libXau.so.6
Reading symbols from /usr/lib/libXdmcp.so.6...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/libXdmcp.so.6
Reading symbols from /lib/tls/i686/cmov/libnss_files.so.2...
(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libnss_files.so.2
Reading symbols from /lib/tls/i686/cmov/libnss_compat.so.2...(no
debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libnss_compat.so.2
Reading symbols from /lib/tls/i686/cmov/libnss_nis.so.2...
(no debugging symbols found)...done.
Loaded symbols for /lib/tls/i686/cmov/libnss_nis.so.2
Reading symbols from
/usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so...(no debugging symbols
found)...done.
Loaded symbols for /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so
Reading symbols from /usr/lib/gconv/ISO8859-1.so...
---Type <return> to continue, or q <return> to quit---
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/gconv/ISO8859-1.so
(no debugging symbols found)
Core was generated by `php -c phpgtk.ini app.php'.
Program terminated with signal 11, Segmentation fault.
[New process 18495]
#0  0xb735b761 in ?? ()
   from /usr/lib/php/extensions/debug-non-zts-20060613/php_gtk2.so
(gdb) bt
#0  0xb735b761 in ?? ()
   from /usr/lib/php/extensions/debug-non-zts-20060613/php_gtk2.so
#1  0x083f0a0d in ?? ()
#2  0x083f162c in ?? ()
#3  0x083f057c in execute ()
#4  0x083cbb22 in zend_execute_scripts ()
#5  0x08378479 in php_execute_script ()
#6  0x08446a35 in main ()
(gdb)


Previous Comments:
------------------------------------------------------------------------

[2009-01-15 01:30:43] [email protected]

At the moment it appears the issue is in the GTK library itself.  I
can't get this to reproduce on Ubuntu x86, only on x64, as well which
makes it very difficult to track down.

If you are using append_text methods with GtkComboBox you SHOULD be
using the static constructor anyway - the methods will not work properly
with a regular GtkComboBox

See
http://library.gnome.org/devel/gtk/stable/GtkComboBox.html#gtk-combo-box-append-text
(which is the C level call we're wrapping)

------------------------------------------------------------------------

[2009-01-15 00:57:39] db4fn1 dot snl at gishpuppy dot com

Is there a long-term fix for the original script without having to
modify the script? We have hundreds of scripts using "new GtkComboBox()"
and fixing them will cost a lot of time.

------------------------------------------------------------------------

[2009-01-14 23:03:38] [email protected]

i am researching this a bit. however the following solution will get
you past your immediate problem:

http://php.pastebin.com/f7bcedbd5

e.g. replacing "new GtkComboBox()" with "GtkComboBox::new_text()"

------------------------------------------------------------------------

[2009-01-14 22:22:14] db4fn1 dot snl at gishpuppy dot com

The actual segmentation fault occurs with the following script:

http://php.pastebin.com/d9d5fc14

------------------------------------------------------------------------

[2009-01-11 01:32:32] [email protected]

I do NOT get a crash - however the reproduce script is incorrect and
throws GTK warnings and a fatal error

http://php.pastebin.com/f3a9d9ba7 - This has correct fixes for the code


Notice you cannot use insert_text unless you've used
GtkComboBox::new_text(); when creating the combo box - this is mentioned
in the documentation at gtk.php.net

In addition the "main loop" is Gtk::main(); not Gtk::show();
you don't need to set things visible, you can just use the show_all();
method on your main window.

Finally, you are using PHP built with the Suhosin-Patch which is known
to have conflicts with some PHP extensions.  Try removing the patch or
building a PHP CLI just for your PHP-GTK extensions.


------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/47063

-- 
Edit this bug report at http://bugs.php.net/?id=47063&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.