Re: [glade--] Error from calling malloc



You can let your app link to debug version of libc, then you can trace into malloc. malloc is simple enough, error occurs when you specify error size of memory alloced or the system not have enough memory, this not require to trace into malloc for fix bug, try to set a break point in your code which line called malloc, and check it carefully.

http://www.cplusplus.com/reference/clibrary/cstdlib/malloc.html


On Tue, Jan 27, 2009 at 3:52 PM, 关阳 <guanyang sjtu gmail com> wrote:
Dear all:

I encountered some problem while calling malloc. Here is the back trace from gdb:

(gdb) bt
#0  0xb7eb086b in ?? () from /lib/libc.so.6
#1  0xb7fb1000 in ?? ()
#2  0x00000010 in ?? ()
#3  0xb7f704c0 in ?? () from /lib/libc.so.6
#4  0xb7f704c0 in ?? () from /lib/libc.so.6
#5  0xbfad3e84 in ?? ()
#6  0xb7eaa7a5 in ?? () from /lib/libc.so.6
#7  0xb7eb27fe in malloc () from /lib/libc.so.6
#8  0x0804a237 in GetAvailableInTime (badTimeList=0x80db660) at random_pair.c:1171
#9  0x08049e50 in GetGlobalAvailableTxTime (thisPair=0x804d5f0) at random_pair.c:994
#10 0x080495b3 in GetStartTime (currentPair=0x804d5f0) at random_pair.c:657
#11 0x080494b3 in Schedule (sequence=0x804d170, PRINT=0) at random_pair.c:615
#12 0x0804886c in main () at random_pair.c:181

The first thing is: what I can do to step into functions in /lib/libc.so.6 so I can locate the problem more precisely.
Second: in what circumstances will malloc get corrupted? 

--
-------------------------------------------------------------------
Yang Guan
Shanghai Jiao Tong University

_______________________________________________
glademm-list mailing list
glademm-list gnome org
http://mail.gnome.org/mailman/listinfo/glademm-list




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