gtk+-2 module hunt for crasher (end of hunt - bad flag found)

Zbigniew Luszpinski zbiggy at
Wed Jan 5 03:31:27 CET 2011

> Yes. -O2 and upper are responsible for broken DnD in gtk apps. -O1 is
> fine. Here is task for someone who would like to hunt for the gtk
> crasher flag: Find out which of flags the -O2 parameter adds is
> responsible for DnD crash. I will start looking in spare time so
> sooner or later I will find it - you may be first as I'm very busy and
> have no much time for Lunar developing. Use gtk-demo DnD for testing.
> Enjoy. When we find the bad flag it will be reported to gtk devel
> team.
> Here is info what flags -O2 parameter adds after -O1:
> Options.html#Optimize-Options
> have a nice day,
> Zbigniew Luszpinski

OK. Hunting for bad flag is finished. I found it: -fcaller-saves
Here is my fix commited to moonbase:

# Fixes mysterious drag and drop crash in gtk+-2
# gtk+-2 when compiled with -O2 or -O3 will compile well
# but crash on drag and drop of bitmaps.
# Surprisingly -Os works well and does not need the fix below.
# The scary thing is -O2, -O3 and -Os all enable -fcaller-saves
# but only -Os does it in a way gtk+-2 does not crash on DnD.
case "$CFLAGS" in
 *-O[23]*) CFLAGS+=' -fno-caller-saves';;
esac &&

As you see it explains everything. When I verified that -O2 and -O3 
crashes but not -Os I begin to think that it may be possible that 
something wrong is with gcc. But why only gtk+-2 crashes with it?

I exclusively use AMD cpus Athlon64/Phenom. Can somone confirm this bug 
also on Intel/Via or older AMD? Just want to make sure this is not cpu 
dependend bug. Almost impossible but want to be sure. Or older gcc like 3? 
(If someone still use it).

have a nice day,
Zbigniew Luszpinski

More information about the Lunar mailing list