This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

help with .debug output (compiled with debug)

Old posts that have not been replied to for several years.
Locked
l
lordares
Voice
Posts: 15
Joined: Fri Dec 20, 2002 4:47 am

help with .debug output (compiled with debug)

Post by lordares »

When I do .debug I get the following, but there are about 150 more lines of different "number :(number)" for tcl.c, just too many to paste..

I am assuming that this means tcl.c has quite a few memory leaks in it :o
I have modified the source so much that its not something I can ask the eggdrop devel-team about..

I just need to know how I utilize all these numbers to find the memory leaks :p

thanks

[10:13:20] <sbp> File 'botnet.c ' accounted for 2264/2264 (ok)
[10:13:20] <sbp> File 'tcl.c ' accounted for 5068/44600 (debug follows:)
[10:13:21] <sbp> 388 :(0008) 388 :(0008) 388 :(0008) 388 :(0008) 388 :(0008)
[10:13:21] <sbp> 388 :(0008) 388 :(0008) 388 :(0008) 388 :(0008) 388 :(0008)
[10:13:21] <sbp> 388 :(0008) 388 :(0008) 388 :(0008) 388 :(0008) 388 :(0008)
[10:13:21] <sbp> 388 :(0008) 388 :(0008) 388 :(0008) 388 :(0008) 388 :(0008)


[10:20AM]..[sbp(dcc)] Memory table: 3939/25000 (15.8% full)
[10:20AM]..[sbp(dcc)] Memory fault: only accounting for 132410/171942 (77.0%)
[10:20AM]..[sbp(dcc)] Memory table itself occupies an additional 781k static

77% :O
l
lordares
Voice
Posts: 15
Joined: Fri Dec 20, 2002 4:47 am

Post by lordares »

after looking in mem.c I see:
sprintf(&sofar[strlen(sofar)], "%-10s/%-4d:(%04d) ",
p + 1, memtbl[j].line, memtbl[j].size);

Which would mean the output is line: (size)
:)
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Right, the output shows all allocated memory from that file. However, it does not show you *which* ones are leaking. What did you modify your bot to do?
l
lordares
Voice
Posts: 15
Joined: Fri Dec 20, 2002 4:47 am

Post by lordares »

Too many changes to list, its an encrypted botpack, mostly a lot of stuff has been stripped out, the channel/userfile have been merged, all file reads/writes are encrypted.. not too many changes to tcl.c though..
If it doesn't tell me what is leaking, what can I use it for?

hmm, I checked the line numbers, there are really only about 10 line numbers, most of them are adding tcl binds, the others are all in my encrypt/decrypt functions, So if those are the line numbers listed, then I guess my encrypt/decrypt functions need to be fixed up eh?
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

It can't tell you which ones are leaking, because how could it know? It knows you have x, y, and z allocated. But it doesn't know that you're planning on freeing x and y later, meaning z is the leak. So it tells you all of them and lets you check it out.

Also, note that it might not be a real memory leak. Maybe you just forgot to update the memory accounting code (expmem), which tells eggdrop how much memory you're supposed to have allocated. It compares that to how much you actually have, and says there's a leak if they don't match.
l
lordares
Voice
Posts: 15
Joined: Fri Dec 20, 2002 4:47 am

Post by lordares »

Well, I did a diff on eggdrop1.6.13/src/tcl.c and my tcl.c and the major additions were my encrypt/decrypt functions at those lines, and they all have proper nfree()s, so I'll look into expmem() to see if that fixes the output, thanks.
l
lordares
Voice
Posts: 15
Joined: Fri Dec 20, 2002 4:47 am

Post by lordares »

Thanks, I found all the memory leaks, and fixed a few that came in 1.6.13 :)
Locked