Very strange bug - memory alignment - after upgrading to GLib 2.12.4-1



Dearest ones,

Yesterday I upgraded GLib from 2.12.3-2 to 2.12.4-1, Debian Unstable installation. After that, a piece of my program which was compiling and working perfectly has gone nuts.

In a given section, I call a function to create an instance of a structure with g_new(), and set up its values. One of these values is a guint8 variable. Later, I use this value as the second parameter to gtk_combo_box_set_active(), with a cast to gint. Just before, there is another gtk_combo_box_set_active() call for another combobox, with completely different parameters. With GDB I could see that right after the first call to set_active(), the pointer to the guint8 variable (dialogvar->qualifier) points to a correct value (0, as set before). But one step further the variable (and only this guint8 variable) gets the value 255 plus some rubbish, and when casted to (gint) its value is 255 -- the limit of a guint8.

There is not any possible memory overlapping operation in the mentioned code section, and all the other values set for the structure keep correct -- it´s only the "qualifier" guint8 variable that gets crazy. I presume that:

       - it is a problem of memory alignment, possibly in g_new().
- maybe gtk_combo_box_set_active() is modifying memory where it shouldn´t (I don´t think this is a strong possibility, as all the other comboboxes are working OK). - maybe a bug in GCC (have you heard of any recent problem like that? I use the 4.1.1-5 Debian package).

Do you people think about other thing that might be the cause for that?

Thank you and regards!

Fabricio Rocha
Brasilia, Brasil

        

        
                
_______________________________________________________ Você quer respostas para suas perguntas? Ou você sabe muito e quer compartilhar seu conhecimento? Experimente o Yahoo! Respostas !
http://br.answers.yahoo.com/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]