Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 109298 - Segmentation fault with foreach call in gtk+/pygtk
Summary: Segmentation fault with foreach call in gtk+/pygtk
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: AMD64 Linux
: High critical
Assignee: Gentoo Linux Gnome Desktop Team
URL: http://forums.gentoo.org/viewtopic-p-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-14 13:05 UTC by Krzysztof Stasiorowski
Modified: 2006-08-25 07:15 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Krzysztof Stasiorowski 2005-10-14 13:05:32 UTC
this small piece of code produce a segfault on gentoo with AMD64, but not on 
other distributions. the pb (according to gdb) is with the foreach call. 


Code:	
import gtk 

def func(model, path, iter): 
        print model[iter][0] 

model = gtk.TreeStore(str) 
model.append(None, ['qwe']) 
model.foreach(func)



Reproducible: Always
Steps to Reproduce:
1.run script
2.
3.

Actual Results:  
Segmentation fault

Expected Results:  
display text: qwe
Comment 1 Krzysztof Stasiorowski 2005-10-14 13:30:31 UTC
I will add info about my configuration
emerge info 
Portage 2.0.53_rc5 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.
12-gentoo-r9 x86_64) 
================================================================= 
System uname: 2.6.12-gentoo-r9 x86_64 AMD Athlon(tm) 64 Processor 3000+ 
Gentoo Base System version 1.12.0_pre9 
dev-lang/python:     2.3.5, 2.4.2 
sys-apps/sandbox:    1.2.13 
sys-devel/autoconf:  2.13, 2.59-r7 
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1 
sys-devel/binutils:  2.16.1 
sys-devel/libtool:   1.5.20 
virtual/os-headers:  2.6.11-r2 
ACCEPT_KEYWORDS="amd64 ~amd64" 
AUTOCLEAN="yes" 
CBUILD="x86_64-pc-linux-gnu" 
CFLAGS="-march=k8 -O2 -pipe" 
CHOST="x86_64-pc-linux-gnu" 
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/
share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /
usr/share/config /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d" 
CXXFLAGS="-march=k8 -O2 -pipe" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="autoconfig distlocks sandbox sfperms strict" 
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/
distributions/gentoo" 
LANG="pl_PL" 
LC_ALL="pl_PL" 
LINGUAS="pl" 
MAKEOPTS="-j2" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
PORTDIR_OVERLAY="/usr/local/portage-r" 
SYNC="rsync://rsync.gentoo.org/gentoo-portage" 
USE="amd64 3dnowex 7zip S3TC X acpi alsa amuled avi bitmap-fonts browserplugin 
bzip2 bzlib cdparanoia cdr cdrom chroot clamav codecs cpudetection crypt css 
cups curl dvd dvdr dvdread eds emboss encode esd exif fam ffmpeg firefox flac 
ftp gd gdbm gif gimpprint gnome gpm gstreamer gtk gtk2 i8x0 imagemagick imlib 
ipv6 java jpeg jpeg2k kadu-modules kadu-voice libclamav lm_sensors lns lzo lzw 
lzw-tiff mad matroska mjpeg mozsvg mp3 mpeg mpeg4 mplayer ncurses nls no-old-
linux nocardbus nptl nsplugin nvidia ogg oggvorbis opengl operanom2 pam pdf 
pdflib perl png python qt quicktime readline real remote rtc sblive sdl slang 
sms spell ssl stats svg tcltk tcpd tga tiff truetype truetype-fonts type1-fonts 
unicode usb userlocales v4l2 vorbis wmf xanim xine xml2 xosd xpm xv xvid zlib 
linguas_pl userland_GNU kernel_linux elibc_glibc" 
Unset:  ASFLAGS, CTARGET, LDFLAGS
Comment 2 John N. Laliberte (RETIRED) gentoo-dev 2005-10-14 18:54:22 UTC
amd64 team: can you guys reproduce?
Comment 3 Ben Skeggs 2005-10-14 19:05:25 UTC
I can't reproduce this here:

Versions of relevant packages:
---
[ebuild   R   ] x11-libs/gtk+-2.8.6  -debug -doc +jpeg +tiff 0 kB
[ebuild     U ] dev-python/pygtk-2.8.0-r1 [2.8.0] -doc +gnome +opengl 0 kB


Output of code snippet:
---
darktama@disoft-dc ~ $ python test.py
qwe


output of test
emerge info:
darktama@disoft-dc ~ $ emerge info
Portage 2.0.53_rc5 (default-linux/amd64/2005.1, gcc-4.0.2,
glibc-2.3.5.20050722-r0, 2.6.13-hardened x86_64)
=================================================================
System uname: 2.6.13-hardened x86_64 AMD Athlon(tm) 64 Processor 3500+
Gentoo Base System version 1.12.0_pre9
distcc 2.18.3 x86_64-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.4 [enabled]
dev-lang/python:     2.3.5, 2.4.2
sys-apps/sandbox:    1.2.13
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon64 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg ccache distlocks multilib-strict sandbox sfperms
strict"
GENTOO_MIRRORS="ftp://ftp.iinet.net.au/pub/Gentoo/
http://mirror.pacific.net.au/linux/Gentoo/"
LANG="de_DE"
LINGUAS="en de"
MAKEOPTS="-j2"
PKGDIR="/home/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/overlays/scratch /usr/local/overlays/modular_xorg"
SYNC="rsync://rsync.au.gentoo.org/gentoo-portage"
USE="amd64 X a52 aac aalib acl acpi alsa apache2 audiofile avi bash-completion
berkdb bitmap-fonts browserplugin bzlib cairo calendar cdparanoia cdr crypt cups
curl dbus dlloader dri dvd dvdr dvdread eds emboss encode esd exif expat fam
fbcon ffmpeg firefox flac foomaticdb ftp gif glitz glut gnome gpm gstreamer gtk
gtk2 guile hal hardened imagemagick imlib inotify ipv6 ithreads jack java
javascript jikes jpeg kde kerberos krb4 lcms ldap libwww lm_sensors lzw lzw-tiff
mad mmap mng mono motif mp3 mpeg mpi msn ncurses nls nocd nptl nptlonly nvidia
offensive ogg oggvorbis openal opengl pam pdflib perl png postgres python qt
quicktime readline recode samba sasl sdl session speex spell ssl subversion
sysvipc tcltk tcpd theora threads tiff truetype truetype-fonts type1 type1-fonts
unicode usb userlocales vcd videos vorbis xine xinerama xml xml2 xosd xpm xprint
xsl xv xvid xvmc zlib linguas_en linguas_de userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LC_ALL, LDFLAGS
Comment 4 Bruno Roggeri 2005-10-18 09:35:33 UTC
I can reproduce the bug with the stable pygtk (2.6.1) on amd64. 
 
I believe it causes gajim to crash when receiving a message, which is quite 
annoying for a IM program ! ;-) 
 
I will upgrade pygtk to 2.8.0-r2 to see if it fixes the problem, but not right 
now at it appears to pull in a lot of new stuff. 
Comment 5 Thomas Boje 2005-10-20 14:25:12 UTC
I can also reproduce the bug.
I tried pygtk-2.8.0-r2, -r1 and 2.6.2 and use gtk+-2.6.8 and python-2.4.2
I recompiled both pygtk and gtk+ with CFLAGS="-march=athlon64 -O2 -pipe", which
did not help either.

Re gajim: That's another bug, see http://trac.gajim.org/ticket/982
Comment 6 Bruno Roggeri 2005-10-20 15:51:45 UTC
BTW, I forgot to give my gtk+ version, so i repeat : i can reproduce the bug     
with :    
[ebuild   R   ] x11-libs/gtk+-2.6.8  +doc +jpeg -static +tiff 0 kB    
[ebuild   R   ] dev-python/pygtk-2.6.1  +doc +gnome +opengl 0 kB    
    
Mostly +amd64 system, with CFLAGS="-march=k8 -O2 -pipe" 
  
  
OT:   
(In reply to comment #5)        
> Re gajim: That's another bug, see http://trac.gajim.org/ticket/982     
  
I've seen this, and in fact it really is the same bug : switching to a  
non-animated iconset solves the problem with gajim because then there is no  
"foreach" call.    
Comment 7 Krzysztof Stasiorowski 2005-10-21 02:48:09 UTC
I'm currently with such configurations of pygtk and gtk

emerge -pv gtk+ pygtk

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] x11-libs/gtk+-2.8.6  -debug -doc +jpeg +tiff 0 kB
[ebuild   R   ] dev-python/pygtk-2.8.0-r2  -doc +opengl 0 kB

Problem still exists (problem with using gajim and qoud libet - vary annoying)
Comment 8 Krzysztof Stasiorowski 2005-10-21 14:21:57 UTC
Following to achive configuration like #3 i upgraded my gcc to 4.0.2, and then
reemerged gtk, python and pygtk.now it looks:

emerge info
Portage 2.0.53_rc6 (default-linux/amd64/2005.1, gcc-4.0.2, glibc-2.3.5-r2,
2.6.12-gentoo-r9 x86_64)
=================================================================
System uname: 2.6.12-gentoo-r9 x86_64 AMD Athlon(tm) 64 Processor 3000+
Gentoo Base System version 1.12.0_pre9
dev-lang/python:     2.3.5, 2.4.2
sys-apps/sandbox:    1.2.13
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64 ~amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=athlon64 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env
/usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon64 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="pl_PL"
LC_ALL="pl_PL"
LINGUAS="pl"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage-r /usr/local/zugaina-portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="amd64 3dnowex 7zip S3TC X acpi alsa amuled avi bitmap-fonts browserplugin
bzip2 bzlib cdparanoia cdr cdrom chroot clamav codecs cpudetection crypt css
cups curl dbus dvd dvdr dvdread eds emboss encode esd exif fam ffmpeg firefox
flac ftp gd gdbm gif gimpprint gnome gpm gstreamer gtk gtk2 i8x0 imagemagick
imlib ipv6 java jpeg jpeg2k kadu-modules kadu-voice libclamav lm_sensors lns lzo
lzw lzw-tiff mad matroska mjpeg mozsvg mp3 mpeg mpeg4 mplayer ncurses nls
no-old-linux nocardbus nptl nsplugin nvidia ogg oggvorbis opengl operanom2 pam
pdf pdflib perl png python qt quicktime rar readline real remote rtc sblive sdl
slang sms spell sqlite ssl stats subtitles svg tcltk tcpd tga tiff truetype
truetype-fonts type1-fonts udev unicode usb userlocales v4l2 vorbis wmf xanim
xine xml2 xosd xpm xv xvid zlib linguas_pl userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LDFLAGS


emerge -pv gtk+ python  pygtk

These are the packages that I would merge, in order:

Calculating dependencies ...done!
[ebuild   R   ] x11-libs/gtk+-2.8.6  -debug -doc +jpeg +tiff 0 kB 
[ebuild   R   ] dev-lang/python-2.4.2  +X -berkdb -bootstrap -build -doc +gdbm
+ipv6 +ncurses -nocxx +readline +ssl +tcltk -ucs2 0 kB 
[ebuild   R   ] dev-python/pygtk-2.8.0-r2  -doc +opengl 0 kB 


Now there IS NO PROBLEM with foreach call. Everything works fine. So the buggy
is gtk+/pygtk build with gcc-3.x 
Comment 9 Simon Stelling (RETIRED) gentoo-dev 2005-12-29 12:47:12 UTC
x11-libs/gtk+-2.8.8
dev-python/pygtk-2.6.1
dev-lang/python-2.4.2

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 46912509960944 (LWP 1041)]
0x00002aaaac7d00ef in gtk_tree_model_foreach_helper (model=0x6dc120, iter=0x7fffff8d21e0,
    path=0x6df980, func=0x60ec8348e5894855, user_data=0x7fffff8d2240)
    at gtktreemodel.c:1511
1511          if ((* func) (model, path, iter, user_data))
(gdb) bt
#0  0x00002aaaac7d00ef in gtk_tree_model_foreach_helper (model=0x6dc120,
    iter=0x7fffff8d21e0, path=0x6df980, func=0x60ec8348e5894855, user_data=0x7fffff8d2240)
    at gtktreemodel.c:1511
#1  0x00002aaaac7d0267 in IA__gtk_tree_model_foreach (model=0x6dc120,
    func=0x60ec8348e5894855, user_data=0x7fffff8d2240) at gtktreemodel.c:1557
#2  0x00002aaaac39f0c6 in _wrap_gtk_tree_model_foreach (self=0x2aaaaab234b0,
    args=0x2aaaaab27350) at gtktreeview.override:2024
#3  0x00002aaaaac28781 in PyCFunction_Call (func=0x2aaaaab7e1b8, arg=0x2aaaaab27350,
    kw=0x0) at methodobject.c:73
#4  0x00002aaaaac6f372 in call_function (pp_stack=0x7fffff8d2458, oparg=1) at ceval.c:3558
#5  0x00002aaaaac6be1f in PyEval_EvalFrame (f=0x556f90) at ceval.c:2163
#6  0x00002aaaaac6d890 in PyEval_EvalCodeEx (co=0x2aaaaab22dc0, globals=0x502770,
    locals=0x502770, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0,
    closure=0x0) at ceval.c:2736
#7  0x00002aaaaac66fb9 in PyEval_EvalCode (co=0x2aaaaab22dc0, globals=0x502770,
    locals=0x502770) at ceval.c:484
#8  0x00002aaaaac94a50 in run_node (n=0x2aaaaab13270, filename=0x2aaaaacc5404 "<stdin>",
    globals=0x502770, locals=0x502770, flags=0x7fffff8d2830) at pythonrun.c:1265
#9  0x00002aaaaac93686 in PyRun_InteractiveOneFlags (fp=0x2aaaab7d7b20,
    filename=0x2aaaaacc5404 "<stdin>", flags=0x7fffff8d2830) at pythonrun.c:762
#10 0x00002aaaaac933d2 in PyRun_InteractiveLoopFlags (fp=0x2aaaab7d7b20,
    filename=0x2aaaaacc5404 "<stdin>", flags=0x7fffff8d2830) at pythonrun.c:695
#11 0x00002aaaaac9327f in PyRun_AnyFileExFlags (fp=0x2aaaab7d7b20,
    filename=0x2aaaaacc5404 "<stdin>", closeit=0, flags=0x7fffff8d2830) at pythonrun.c:658
#12 0x00002aaaaac9b773 in Py_Main (argc=1, argv=0x7fffff8d29a8) at main.c:484
#13 0x0000000000400873 in main (argc=1, argv=0x7fffff8d29a8) at python.c:23

Portage 2.0.53 (default-linux/amd64/2005.1, gcc-3.4.4, glibc-2.3.5-r2, 2.6.12-gentoo-r6 x86_64)
=================================================================
System uname: 2.6.12-gentoo-r6 x86_64 AMD Opteron(tm) Processor 242
Gentoo Base System version 1.6.13
dev-lang/python:     2.3.5-r2, 2.4.2
sys-apps/sandbox:    1.2.12
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.15.92.0.2-r10
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="amd64"
AUTOCLEAN="yes"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=opteron -ggdb3 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.4/env /usr/kde/3.4/share/config /usr/kde/3.4/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/lib/fax /usr/lib64/mozilla/defaults/pref /usr/share/config /var/qmail/control /var/spool/fax/etc"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=opteron -ggdb3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig buildpkg cvs debug distlocks keeptemp keepwork multilib-strict noauto nostrip sandbox sfperms test"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LC_ALL="en_GB.UTF-8"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org"
USE="amd64 X acpi alsa audiofile avi berkdb bitmap-fonts bonobo bzip2 chipcard crypt cups curl debug dvd eds emboss encode esd ethereal expat fam flac font-server foomaticdb fortran gcj gd gdbm gif glut gmp gnome gpm gsm gstreamer gtk gtk2 gtkhtml guile hbci idn imagemagick imlib ipv6 java jp2 jpeg junit kde lcms ldap libwww lzw lzw-tiff mad mhash mng motif mozilla mp3 mpeg mysql ncurses network nls nptl nptlonly objc objc-gc ofx ogg oggvorbis opengl pam pcre pdflib perl png postgres python qt quicktime quotes readline sdl spell ssl svg tcltk tcpd tiff truetype truetype-fonts type1-fonts udev usb userlocales utf8 vorbis wxgtk1 xml xml2 xpm xrandr xv zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LDFLAGS, LINGUAS, MAKEOPTS, PORTDIR_OVERLAY
Comment 10 Simon Stelling (RETIRED) gentoo-dev 2006-08-25 07:15:47 UTC
seems to no longer be an issue