Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yahoo!

Members: 0
Guests: 12
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » General » Coding » Valgrind
Forum Rules | Mark all | Recent Posts

Valgrind
< Newer Topic :: Older Topic > Ummm...

Pages:<< prev 1 next >>
Post is unread #1 Oct 7, 2003, 12:25 am
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

I'm trying to use valgrind, but I'm kinda uncertain about it. From what I understand, you would boot your mud through it in a similiar manner as doing it through gdb. From there, you let it run, and it can tell you if you didn't free something, or if you've got a memory leak somewhere. Now, ignoring that fact that I can't get it to compile properly, does anyone know of a good MAN for it, or a help website, or can anyone offer some advice? I've had virtually no experience with memory management, and I'm sure that I've got leaks all over my code.
       
Post is unread #2 Oct 7, 2003, 7:36 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

valgrind -v --leak-check=yes --show-reachable=yes --gdb-attach=yes ../src/afkmud 9500

I stick that command inside a file called grind in the area directory. Whenever I need to check for leaks or other memory problems, I shut the mud down normally, then switch to the area dir and invoke that command. You'll need to make sure the grind command has execute permission. You'll see a bunch of stuff about it, and your usual log spam. Then as long as it encounters no issues at startup, your mud will be running inside it for awhile.

If it encounters a problem, it will offer to let you attach to GDB. Usually this is a good idea, but there are exceptions. Such as with the IMC2 client startup. It will complain about overlapping on an imcstrncpy call twice, but after that it runs fine. But if you see something like "invalid read of size 2" or whatever, then you'd want to attach because otherwise your mud is about to crash.

If you encounter no problems, and want to find leaks after running for a few hours ( or ideally days ), the just shut down the mud normally. You'll get a big long pile of output of things that are potential issues. You'll only be concerned with what it says are definitely lost. Still reachable is ok since the mud would still be able to use them.

As for a MAN page, I doubt it has one. Best bet would be to read up at the website you got it from.
       
Post is unread #3 Oct 7, 2003, 11:59 pm
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

Do you perhaps have a good version? The only one I can get will not compile, and I would rather not screw around in the source unless I have to.
       
Post is unread #4 Oct 8, 2003, 8:53 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

The one I downloaded and installed was the 7/25/2003 CVS version he declared stable. It unpacked, configured, compiled, and installed just fine on Redhat 9.0.

How are you trying to install it, and on what operating system?
       
Post is unread #5 Oct 8, 2003, 9:43 am
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

I beleive that I have the same version, I used wget, unpacked it fine. I entered the directory, and typed configure, make, and from there, got the following:
vg_syscalls.c: In function `vgPlain_perform_assumed_nonblocking_syscall':
vg_syscalls.c:2202: `SIOCOUTQ' undeclared (first use in this function)
vg_syscalls.c:2202: (Each undeclared identifier is reported only once
vg_syscalls.c:2202: for each function it appears in.)


I am installing it on a remote server, under the slackware 7.1 OS.
       
Post is unread #6 Oct 8, 2003, 11:18 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

You're going to need to contact the guy who developed it and show him what you got. That's not something you can readily fix at the user level.
       
Post is unread #7 Oct 8, 2003, 12:44 pm
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

Thats what I was afraid of. Thanks for the help.
       
Post is unread #8 Oct 9, 2003, 2:27 am
Go to the top of the page
Go to the bottom of the page

Tarl

GroupAFKMud Team
Posts26
JoinedJan 1, 2002

Another possibility is upgrading your slackware version, since 7.1 isn't that new.
       
Post is unread #9 Oct 9, 2003, 9:40 am
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

I can't upgrade it, its on a remote host.
       
Post is unread #10 Oct 9, 2003, 10:05 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

A remote host you don't own? Or?

If you don't own it, your sysadmin will need to be the one to install it. Valgrind is meant to be a system-wide utility. Trying to squeeze it into a user account might overrun your quota.
       
Post is unread #11 Oct 9, 2003, 11:55 am
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005

Just as a poke to encourage you (or your sysadmin) to upgrade... I just installed Slackware 9.1 on a system. VERY impressive, nice hardware detection, gcc 3.2.3, 2.4.20 kernel, feels pretty solid and has the semi-bsd flavour that I liked so much when I used version 3.3 waaaay back in the days.

If you're not the only one using the machine, maybe you can find an old (!) Pentium 2 sitting in someone's basement and convince your sysadmin to hang it on his network if you let him administer it.
       
Post is unread #12 Oct 9, 2003, 4:22 pm
Go to the top of the page
Go to the bottom of the page

Greven
Magician
GroupMembers
Posts204
JoinedMar 5, 2005

Yeah, I'm hosted on wolfpaw. I asked my sysadmin about if they had it a while back, and he told me that if I wanted to use it, I could loaded it in my account. Of course it hasn't totally compiled, but at the moment I got some room left. I'll ask them about upgrading. Thanks for the help.
       
Pages:<< prev 1 next >>