Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ SMAUG
➜ SMAUG coding
➜ set_pager_color crash???
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1
2
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #15 on Tue 12 Oct 2004 10:47 PM (UTC) |
Message
| Have you tried using the malloc debugging?
Also you should be able to install valgrind into your own directory; try --prefix="/home/myhomedir/" on the configure script (set your home dir appropriately.) |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Nicklfire
(17 posts) Bio
|
Date
| Reply #16 on Tue 12 Oct 2004 11:11 PM (UTC) Amended on Tue 12 Oct 2004 11:24 PM (UTC) by Nicklfire
|
Message
| All night last night i tried to find out how to malloc debug X_X someone told me i needed malloc.c so i searched and found nothing...
Edit: I noticed in comm.c MALLOC_DEBUG but i have no idea how to set that up..
Interesting enough... i kept recreating a char over and over and over and over till it crashed about on the seventh time without another command going through, crashed on the destroy. And the core file was different in a way. I'm pretty sure this is linked to the leak i'm dealing with.
#0 0x400c62e1 in _int_free () from /lib/libc.so.6
#1 0x400c50bf in free () from /lib/libc.so.6
#2 0x0809e58c in free_char (ch=0xf18) at db.c:2946
#3 0x080b81f7 in clean_char_queue () at handler.c:3581
#4 0x08114b47 in update_handler () at update.c:2077
#5 0x08093bf4 in game_loop () at comm.c:702
#6 0x08093494 in main (argc=2, argv=0xbfffe590) at comm.c:329
#7 0x40063d06 in __libc_start_main () from /lib/libc.so.6
(gdb) frame 2
#2 0x0809e58c in free_char (ch=0xf18) at db.c:2946
2946 DISPOSE( ch );
| Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #17 on Thu 14 Oct 2004 06:29 AM (UTC) |
Message
| I'm almost positive at this point that something is being freed twice or you have mismatching hashed vs. unhashed allocation/deallocation.
Quote: someone told me i needed malloc.c so i searched and found nothing... Was that someone here? What I said is to look at the manpage for malloc, and then added the defines to your environment variables and your makefile so that it compiles in debug mode.
Where did you see MALLOC_DEBUG? |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Nicklfire
(17 posts) Bio
|
Date
| Reply #18 on Thu 14 Oct 2004 07:15 PM (UTC) |
Message
| The person that told me to get malloc.c was a friend from MSN but i don't think he knew what he was talking about o_0. As for MALLOC_DEBUG i see this in comm.c, but that's the only reference to malloc through the whole code. I read the manual for malloc in the shell and that stuff makes no sense to me -stupid- sorry x_x;. thanks.
/*
* Memory debugging if needed.
*/
#if defined(MALLOC_DEBUG)
malloc_debug( 2 );
#endif
~from comm.c ^^~ | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #19 on Thu 14 Oct 2004 08:39 PM (UTC) |
Message
| Right. You need to edit your makefile to add a line defining MALLOC_DEBUG to 2. Or, you could edit mud.h and make the first line:
#define MALLOC_DEBUG 2 |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Nicklfire
(17 posts) Bio
|
Date
| Reply #20 on Thu 14 Oct 2004 09:02 PM (UTC) |
Message
| Ok I added that line and I "make clean" then recompile, and i get this.
comm.o(.text+0x1f): In function `main':
/home/mud/dwd/smaug/src/comm.c:169: undefined reference to `malloc_debug'
comm.o(.text+0x6cd): In function `accept_new':
/home/mud/dwd/smaug/src/comm.c:522: undefined reference to `malloc_verify'
first error line:
/*
* Memory debugging if needed.
*/
#if defined(MALLOC_DEBUG)
malloc_debug( 2 );
#endif
second:
#if defined(MALLOC_DEBUG)
if ( malloc_verify( ) != 1 )
abort( );
#endif
I added
#define MALLOC_DEBUG 2
to mud.h and got those errors.. sorry I probably sound like the biggest moron in the world @_@. thanks.
| Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
51,128 views.
This is page 2, subject is 2 pages long:
1
2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top