_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
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