Bug 177986

Summary: segfaults on ia64 on -c 'import gtk'
Product: [Fedora] Fedora Reporter: Jason Vas Dias <jvdias>
Component: glib2Assignee: Matthias Clasen <mclasen>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: rawhideCC: caillon, johnp, katzj, mihai.ibanescu
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-01-18 19:30:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 177609    

Description Jason Vas Dias 2006-01-17 00:18:55 UTC
Description of problem:

Python generates a SIGSEGV on the ia64 architecture if an attempt is made
to import the GTK module from a '-c' string, e.g. in the ia64 build root
on the 'boris' buildserver:
$ sudo /usr/sbin/chroot /mnt/build/beehive/dist-fc5-build/
Password:
# python -c 'import gtk'
Segmentation fault

This does not happen when the 'import gtk' is run from a .py file:
# echo 'import gtk' > /tmp/t.py
# chmod +x /tmp/t.py
# ./tmp/t.py
import: unable to open X server `'.
...<CTRL>+<C>
( OK ).

This is blocking the ia64 builds of packages such as avahi that test for
pygtk in their %configure :
"
checking for python module gtk... ./configure: line 24950:  1782 Segmentation
fault      $PYTHON -c "$prog" 1>&5 2>&5
no
configure: error: Could not find Python module gtk
error: Bad exit status from /usr/src/build/680721-ia64/install-tmp/rpm-tmp.44341
(%build)
"

Version-Release number of selected component (if applicable):
python-2.4.2-2.1.ia64
pygtk2-2.8.4-1

How reproducible:
100%

Steps to Reproduce:
python -c 'import gtk'
  
Actual results:
SIGSEGV

Expected results:
As on i386:
$ python -c 'import gtk'
$ echo $?
0

Comment 1 Jason Vas Dias 2006-01-17 17:45:00 UTC
On closer inspection, this appears to be a pygtk2 or gtk2 or glib2 bug , 
since python has not changed since Dec 17th, and avahi has been re-built
many times since then, while pygtk2 changed on Jan 15th, and glib2 changed
on Jan 16th.

So, with pygtk2-2.8.4-1, gtk2-2.8.10-2, and glib2-2.9.3-1, ONLY on ia64, 
in the 'boris' buildserver dist-fc5-build buildroot, this program run by 
avahi's %configure script generates a SIGSEGV:

bash-3.1# prog="
> import sys
> try:
>         import gtk
> except ImportError:
>         sys.exit(1)
> except:
>         sys.exit(0)
> sys.exit(0)"
bash-3.1# python -c "$prog"
Segmentation fault

The core file suggests the memory access violation occurs in libgobject:
...
(no debugging symbols found)...done.
Loaded symbols for /usr/lib/python2.4/site-packages/cairo/_cairo.so
#0  0x2000000003e16b50 in g_type_check_instance ()
   from /usr/lib/libgobject-2.0.so.0

Installing glib2-2.9.3-1-debuginfo in the buildroot on boris, we see this 
SIGSEGV occurs in gtype.c:

Loaded symbols for /usr/lib/python2.4/site-packages/cairo/_cairo.so
#0  0x2000000003e16b50 in check_derivation_I (
    parent_type=611072, type_name=0x20000000048ebc68 "GtkObject") at gtype.c:423
423       GType ftype = NODE_FUNDAMENTAL_TYPE (node);

The same 'python -c "import gtk"' command works fine on all other architectures
- there's some problem with the way these packages are built on ia64.

Please can the pygtk2, gtk2 and glib2 maintainers take a look at this bug, as
it prevents any package that does a "python -c 'import gtk'" in the configure /
build stages (eg. avahi) from building on our beehive buildservers - thanks.

Comment 2 Matthias Clasen 2006-01-18 15:53:07 UTC
Ok, found it. The problem is that g_object_compat_control() is inside
G_DISABLE_DEPRECATED, so the declaration is not seen when GTK+ is compiled,
which is bad when returning 64bit values on 64bit platforms.

Comment 3 Matthias Clasen 2006-01-18 19:30:45 UTC
Should be fixed in gtk2-2.8.12-3

Comment 4 Jason Vas Dias 2006-01-18 20:11:17 UTC
Yes, this is now fixed with gtk2-2.8.10-3 in Rawhide . Thank You !