Re: [glade--] Error from calling malloc

tang xinfa <[email protected]> Mon, 2 Feb 2009 10:52:56 +0800
Newsgroups gmane.comp.gnome.glademm
Message-ID <[email protected]>
--===============0953628023==
Content-Type: multipart/alternative; boundary=000e0cd487bad413570461e6a6da

--000e0cd487bad413570461e6a6da
Content-Type: text/plain; charset=GB2312
Content-Transfer-Encoding: quoted-printable

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 o=
f
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, =B9=D8=D1=F4 <[email protected]> wro=
te:

> 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=3D0x80db660) at
> random_pair.c:1171
> #9  0x08049e50 in GetGlobalAvailableTxTime (thisPair=3D0x804d5f0) at
> random_pair.c:994
> #10 0x080495b3 in GetStartTime (currentPair=3D0x804d5f0) at random_pair.c=
:657
> #11 0x080494b3 in Schedule (sequence=3D0x804d170, PRINT=3D0) 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
> [email protected]
> http://mail.gnome.org/mailman/listinfo/glademm-list
>
>

--000e0cd487bad413570461e6a6da
Content-Type: text/html; charset=GB2312
Content-Transfer-Encoding: quoted-printable

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.<br>
<br><a href=3D"http://www.cplusplus.com/reference/clibrary/cstdlib/malloc.h=
tml">http://www.cplusplus.com/reference/clibrary/cstdlib/malloc.html</a><br=
><br><br><div class=3D"gmail_quote">On Tue, Jan 27, 2009 at 3:52 PM, =B9=D8=
=D1=F4 <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]">gua=
[email protected]</a>&gt;</span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Dear all:</d=
iv><div><br></div><div>I encountered some problem while calling malloc. Her=
e is the back trace from gdb:</div>
<div><br></div><div>(gdb) bt</div><div>#0 &nbsp;0xb7eb086b in ?? () from /l=
ib/libc.so.6</div><div>#1 &nbsp;0xb7fb1000 in ?? ()</div>
<div>#2 &nbsp;0x00000010 in ?? ()</div><div>#3 &nbsp;0xb7f704c0 in ?? () fr=
om /lib/libc.so.6</div><div>#4 &nbsp;0xb7f704c0 in ?? () from /lib/libc.so.=
6</div><div>#5 &nbsp;0xbfad3e84 in ?? ()</div><div>#6 &nbsp;0xb7eaa7a5 in ?=
? () from /lib/libc.so.6</div>

<div>#7 &nbsp;0xb7eb27fe in malloc () from /lib/libc.so.6</div><div>#8 &nbs=
p;0x0804a237 in GetAvailableInTime (badTimeList=3D0x80db660) at random_pair=
.c:1171</div><div>#9 &nbsp;0x08049e50 in GetGlobalAvailableTxTime (thisPair=
=3D0x804d5f0) at random_pair.c:994</div>

<div>#10 0x080495b3 in GetStartTime (currentPair=3D0x804d5f0) at random_pai=
r.c:657</div><div>#11 0x080494b3 in Schedule (sequence=3D0x804d170, PRINT=
=3D0) at random_pair.c:615</div><div>#12 0x0804886c in main () at random_pa=
ir.c:181</div>

<div><br></div><div>The first thing is: what I can do to step into function=
s in /lib/libc.so.6 so I can locate the problem more precisely.</div><div>S=
econd: in what circumstances will malloc get corrupted?&nbsp;</div><br><fon=
t color=3D"#888888">-- <br>

-------------------------------------------------------------------<br>Yang=
 Guan<br>Shanghai Jiao Tong University<br>
</font><br>_______________________________________________<br>
glademm-list mailing list<br>
<a href=3D"mailto:[email protected]">[email protected]</a><br>
<a href=3D"http://mail.gnome.org/mailman/listinfo/glademm-list" target=3D"_=
blank">http://mail.gnome.org/mailman/listinfo/glademm-list</a><br>
<br></blockquote></div><br>

--000e0cd487bad413570461e6a6da--

--===============0953628023==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
glademm-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/glademm-list

--===============0953628023==--