Eggdev: Crash in malloc() internals ? (+valgrind log)

Miguel Ventura hal9000 at netcabo.pt
Mon Feb 2 08:36:08 CST 2004


I have tried with valgrind...

miguel at scout enforcer $ valgrind --gdb-attach=yes -v --logfile=vallog
./eggdrop enforcer.conf

It complains a lot about overlapping strcpy()s. Now eggdrop doesn't crash
anymore, but a tail -f vallog.pid* shows me that when the moment to crash
comes... This happens:

==17144==    Address 0x41AA1743 is 1 bytes before a block of size 25 alloc'd
==17144==    at 0x4002AA51: malloc (in /usr/lib/valgrind/vgskin_memcheck.so)
==17144==    by 0x806F356: n_malloc (mem.c:309)
==17144==    by 0x8089033: readuserfile (users.c:873)
==17144==    by 0x8057A43: chanprog (chanprog.c:466)

(and with another try)

==17144== Invalid read of size 1
==17144==    at 0x806CD60: _wild_match (match.c:148)
==17144==    by 0x808579E: get_user_by_host (userrec.c:333)
==17144==    by 0x417F3137: got352or4 (chan.c:1008)
==17144==    by 0x417F334E: got352 (chan.c:1028)
==17144==    Address 0x41AA1743 is 1 bytes before a block of size 25 alloc'd
==17144==    at 0x4002AA51: malloc (in /usr/lib/valgrind/vgskin_memcheck.so)
==17144==    by 0x806F356: n_malloc (mem.c:309)
==17144==    by 0x8089033: readuserfile (users.c:873)
==17144==    by 0x8057A43: chanprog (chanprog.c:466)
==17144==
==17144== Invalid write of size 4
==17144==    at 0x417C27FA: queue_server (server.c:865)
==17144==    by 0x806765B: dprintf_eggdrop (dccutil.c:145)
==17144==    by 0x417BF199: tcl_putserv (tclserv.c:88)
==17144==    by 0x8077321: utf_converter (tcl.c:360)
==17144==    Address 0x4146CCE0 is 0 bytes inside a block of size 12 free'd
==17144==    at 0x4002AD5B: free (in /usr/lib/valgrind/vgskin_memcheck.so)
==17144==    by 0x8073647: mod_free (modules.c:921)
==17144==    by 0x417C00F6: deq_msg (server.c:210)
==17144==    by 0x417C4B49: server_secondly (server.c:1606)

The attached log is quite big and it has many references to malloc() :(

I also tried electricfence but the bot would just get stalled. And there
goes my 20-daily-minutes for playing! Physics now! Sorry!

-----Original Message-----
From: stdarg [mailto:stdarg at yahoo.com] 
Sent: sábado, 31 de Janeiro de 2004 17:53
To: hal9000 at netcabo.pt; Eggdrop Development List
Subject: RE: Eggdev: Crash in malloc() internals ?

That's pretty strange. Since it seems to be a memory corruption bug, the
best way to find the source is to use another program like electricfence or
mpatrol.
For instance, if you install electricfence, you can run eggdrop like:

ef ./eggdrop blah.conf

and it should produce a core file as soon as the bad memory access occurs.
That makes it much easier to trace the source of the error.

I think electricfence is the easiest one to install and use, but mpatrol and
another one called valgrind offer more types of memory protection.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vallog.pid17118
Type: application/octet-stream
Size: 16749 bytes
Desc: not available
URL: <http://lists.eggheads.org/pipermail/eggdev/attachments/20040202/19d31954/attachment.obj>


More information about the Eggdev mailing list