Register forum user name Search FAQ

Gammon Forum

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 ➜ eww stuck

eww stuck

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Rob Harper   (108 posts)  Bio
Date Mon 22 Dec 2003 09:36 AM (UTC)
Message
ahh, hey again, seems whenever I type mstat self the mud crashes..cant figure this out....

when I gdb I get this.

Core was generated by `smaug'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libcrypt.so.2...done.
Reading symbols from /usr/lib/libc.so.4...done.
Reading symbols from /usr/libexec/ld-elf.so.1...done.
#0 0x28235528 in strcat () from /usr/lib/libc.so.4
(gdb) bt
#0 0x28235528 in strcat () from /usr/lib/libc.so.4
#1 0x81acbc0 in buf.22 ()
#2 0x8069993 in do_mstat (ch=0x8272c00, argument=0xbfbff6ce "self")
at act_wiz.c:2066
#3 0x80d22be in interpret (ch=0x8272c00, argument=0xbfbff6ce "self")
at interp.c:732
#4 0x809f600 in game_loop () at comm.c:638
#5 0x809ee2c in main (argc=2, argv=0xbfbffbdc) at comm.c:289
(gdb)



At act_wiz.c line 2066 I have this,

pager_printf_color( ch, "&cTimerRecentfight: &R%d\n\r",
get_timer( victim, TIMER_RECENTFIGHT ) );
if ( get_timer( victim, TIMER_ASUPRESSED ) )
pager_printf_color( ch, "&cTimerAsupressed: &R%d\n\r",
get_timer( victim, TIMER_ASUPRESSED ) );
if ( IS_NPC( victim ) )
pager_printf_color( ch, "&cAct Flags : &w%s\n\r", ext_flag_string(&victim->act, act_flags) );
else
{
pager_printf_color( ch, "&cPlayerFlags: &w%s\n\r", ext_flag_string( &victim->act, plr_flags ) );
pager_printf_color( ch, "&cPcflags : &w%s\n\r", flag_string( victim->pcdata->flags, pc_flags ) );
if ( victim->pcdata->nuisance )
{


I dont see anything out of the odinary there any ideas?



Thanks rob
Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Mon 22 Dec 2003 12:26 PM (UTC)
Message
Well, I'm looking at these lines:
pager_printf_color( ch, "&cAct Flags : &w%s\n\r", ext_flag_string(&victim->act, act_flags) );
else
{
pager_printf_color( ch, "&cPlayerFlags: &w%s\n\r", ext_flag_string( &victim->act, plr_flags ) );
pager_printf_color( ch, "&cPcflags : &w%s\n\r", flag_string( victim->pcdata->flags, pc_flags ) );


I can't help but see that the first two, victim->act, are taking the address of the flag... (that's what the & is doing), whereas the second one is just taking the flag itself (as I believe it should be doing.) Both flags are just ints (or perhaps long longs) but in any case I see no reason to dereference it. Unless, of course, your ext_flag_string function needs a pointer or something? But why would it want a pointer?

Other than that, I don't really see anything that catches my eye. It's odd because the problem comes from strcat, with "buf.22" in the middle - what's buf.22? Which line exactly in those you gave is the trouble line?

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Samson   USA  (683 posts)  Bio
Date Reply #2 on Mon 22 Dec 2003 02:26 PM (UTC)
Message
ext_flag_string is supposed to take the address as its first argument. Those 3 lines are all correct.

I don't see anything wrong with the code shown here, but perhaps one of the flags has no corresponding entry in the text arrays that the flag_string functions call from? Check to be sure that any recently added flags have entries in build.c that match them in the text arrays.
Top

Posted by Rob Harper   (108 posts)  Bio
Date Reply #3 on Tue 23 Dec 2003 08:20 AM (UTC)
Message
Ahh thanks I'll check into that, I have added more then a few flags lately.
Top

Posted by Rob Harper   (108 posts)  Bio
Date Reply #4 on Tue 23 Dec 2003 09:41 AM (UTC)
Message
Thanks guys, samson you were right I neglected to add the flags counter parts.
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.


17,379 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.