PDA

View Full Version : emerald-theme-manager crash on x86_64 and fix


_john_i_
February 13th, 2008, 07:14 PM
Hi,

Just tried compiz-fusion for the first time in months, and found that the emerald-theme-manager crashed immediately with a segmentation fault.

I tracked the problem down, and I am not sure if this is a gtk or emerald problem. It it definitely related to 64-bit compiles.

In the themer/main.c in the build_tree_view function, it calls gtk_list_store_new with 9 type parameters. Since this is a function with variable arguments, the C compiler assumes the default type of these parameters is int (4-byte int). Actually GType is retrieved in glib as 8-byte ints (long). This works fine on 32-bit compiles where long is 4-byte, but on 64-bit long is 8-bytes.

I fixed it by casting the types to (long) in the function call.

I don't know if this is should be considered a bug in glib or in the way emerald calls the function. Anyway, it fixes the crash for me.

I'm attaching a patch.

Comments welcome.

john

Ricardas
June 3rd, 2008, 10:06 PM
The same problem with emerald-theme-manager (emerald-0.7.6). Now it works :)
Thanks John !

some-guy
June 3rd, 2008, 10:21 PM
It works fine for me without the patch...