Re: Problems with malloc() an gtk




Jonas Oberg <jonas@cixit.se> writes:

> Hi,
> 
> I'm developing an application and have run into problems. When I link
> the application with libgtk it segfaults with the following backtrace;
> 
> #0  0x40123338 in free ()
> #1  0x40122a4a in __malloc_check_init ()
> #2  0x40123095 in malloc ()
> #3  0x40122b25 in malloc ()
> #4  0x8048b23 in strtokenize (s=0xbffff33c) at test.c:49
> 
> strtokenize() is a function I've build which works just fine when I
> don't link with libgtk. So somehow libgtk does something with my call
> to malloc(). Whatever is happening here? I'd sure be glad if someone
> can explain to me why libgtk alone makes an application crash, doesn't
> sound too promising for the future ;)

Well, since you don't tell us anything about your setup (what
operating system, etc) - I don't have much to go on.

But, I can say, that if linking with GTK+ without calling 
any GTK+ calls makes your application crash, it pretty much
has to be that your application was corrupting memory before,
and adding -lgtk moved things around in memory and turned 
the corruption into a segfault.

Regards,
                                        Owen



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