Bug 16449

Summary: GTK segv when compiled with -O2 (default)
Product: [Retired] Red Hat Linux Reporter: Alan Shutko <ats>
Component: gtk+Assignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 7.0CC: ats
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-08-17 14:45:36 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:
Attachments:
Description Flags
Test program to show crash none

Description Alan Shutko 2000-08-17 14:06:36 UTC
Running the attached program gives a segv as below

#0  0x158 in ?? ()
#1  0x40052d51 in real_insert_row (clist=0x8074e88, row=0, text=0xbffff398)
    at gtkclist.c:2699
#2  0x400529a8 in gtk_clist_append (clist=0x8074e88, text=0xbffff398)
    at gtkclist.c:2584
#3  0x8049049 in list_add_file (clist=0x8074e88, file=0x8079ef0
".cvsignore")
    at gtktest.c:26
#4  0x80491b8 in list_update (clist=0x8074e88) at gtktest.c:60
#5  0x80494f1 in main (argc=2, argv=0xbffff4e4) at gtktest.c:104
#6  0x402e8345 in __libc_start_main (main=0x804922c <main>, argc=2, 
    ubp_av=0xbffff4e4, init=0x8048c44 <_init>, fini=0x804953c <_fini>, 
    rtld_fini=0x4000de14 <_dl_fini>, stack_end=0xbffff4dc)
    at ../sysdeps/generic/libc-start.c:111

(Frame zero is actually the clist sync_selection, called through a pointer
which has been set to NULL.)

Recompiling gtk (1.2.8 source) from source with configure defaults also
shows this error.  Recompiling gtkclist.c with -O instead of -O2 and
rebuilding libgtk fixes this problem.

Testing method:
Build gtktest using the compile-command at the end of the file, building
against pinstripe gtk.
./gtktest -> crash
Build gtk from source with plain ./configure
LD_LIBRARY_PATH=/home/ats/gtk-1.2.8/gtk/.libs ./gtktest ->crash
vi /home/ats/gtk-1.2.8/gtk/Makefile, s/-O2/-O/, touch gtkclist.c, make
LD_LIBRARY_PATH=/home/ats/gtk-1.2.8/gtk/.libs ./gtktest ->work

(I seem to recall that I can attach a file after committing the bug, so
I'll try that.)

Comment 1 Alan Shutko 2000-08-17 14:07:30 UTC
Created attachment 2588 [details]
Test program to show crash

Comment 2 Alan Shutko 2000-08-17 14:25:01 UTC
Tested recompiling gtkclist.c with gcc from rawhide (2.96-52) and it didn't cure
the problem.  Now recompiling all of gtk with it.  Will report when completed.

Comment 3 Alan Shutko 2000-08-17 14:45:31 UTC
Recompiling all of gtk with gcc 2.96-52 still yield the crash.

Comment 4 Jakub Jelinek 2000-08-18 16:33:36 UTC
Buggy gtkclist, fixed in gtk+-1.2.8-7