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 ➜ Looking while fighting = crash?

Looking while fighting = crash?

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


Pages: 1 2  

Posted by DjNiVeK   (48 posts)  Bio
Date Tue 14 Dec 2004 11:39 AM (UTC)
Message
Ok, I have a strange bug now. When you're fighting a mob, or player, it doesn't really matter, the mud crashes with a stackdump when you try to look. Problem here is I don't know where to start looking.
Looking outside of a battle works fine, but if a fight is going on and someone looks, it crashes.
I also tried that gdb thingie, but it asks you to look at a core, but mine doesn't save it in a core, and gdb doesn't open it.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #1 on Tue 14 Dec 2004 12:00 PM (UTC)
Message
Attach gdb to the MUD process, and then recreate the crash.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by DjNiVeK   (48 posts)  Bio
Date Reply #2 on Tue 14 Dec 2004 12:30 PM (UTC)
Message
On my own computer, I run it as an .exe, so it doesn't have a PID.
Also, on a temporary server, when I try to run smaug in the area folder, I get a 'permission denied'. Startup does work, but there isn't a smaug running with an ID then.
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #3 on Tue 14 Dec 2004 12:33 PM (UTC)
Message
Well, what are you using to compile? Cygwin? If so, it should have a PID. With the permission denied error, just chmod it to the correct values.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by DjNiVeK   (48 posts)  Bio
Date Reply #4 on Tue 14 Dec 2004 12:36 PM (UTC)
Message
Yea, I use cygwin to compile, but not to run the process.
I'll try the chmod in a few
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #5 on Tue 14 Dec 2004 12:37 PM (UTC)
Message
Oh I see. So you're using Smaug, converted to Windows?

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by DjNiVeK   (48 posts)  Bio
Date Reply #6 on Tue 14 Dec 2004 12:38 PM (UTC)
Message
yep, the version done with a little change in the makefile to a .exe
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #7 on Tue 14 Dec 2004 01:03 PM (UTC)
Message
Well I'm going to suggest using Cygwin to run it too, or find a way to attach gdb, because it'll be useful in the future, along with right now.

What I'm guessing is, while fighting, something (perhaps replacing the title of the victim in the room) is being set incorrectly.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by DjNiVeK   (48 posts)  Bio
Date Reply #8 on Tue 14 Dec 2004 01:56 PM (UTC)
Message
lol, you're absolutely right. I have been able to gdb it now, and the crash is caused by a strcat( buf, victim->pcdata->title);

Now lets see how to fix it...thanks :)
Top

Posted by Zeno   USA  (2,871 posts)  Bio
Date Reply #9 on Tue 14 Dec 2004 02:10 PM (UTC)

Amended on Tue 14 Dec 2004 02:13 PM (UTC) by Zeno

Message
So most likely either buf was never declared or defined, or you somehow lost victim. (Or it could be that the victim is a NPC)

If you can't figure it out, post the gdb here.

Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #10 on Tue 14 Dec 2004 03:33 PM (UTC)
Message
If your unfamiliar with GDB, I suggest reading through Nick's guide to GDB, its an invaluable piece of information
for anyone unused to the program.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by DjNiVeK   (48 posts)  Bio
Date Reply #11 on Tue 14 Dec 2004 03:36 PM (UTC)
Message
@Greven: Yep, I read it but until Zeno said to run smaug with Cygwin, the GDB tutorial didn't really work for me. Now it works fine :)

I also fixed the bug, so now you can look during battle =)

Thanks =)
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #12 on Tue 14 Dec 2004 03:55 PM (UTC)

Amended on Tue 14 Dec 2004 03:57 PM (UTC) by Greven

Message
Why didn't gdb work with cygwin? You said that you got it to work in one of the above posts.

P.S. If you have fixed the issue, you could post it here so that anyone checking this post in the future with a similiar problem can see how you fixed the issue.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
Top

Posted by DjNiVeK   (48 posts)  Bio
Date Reply #13 on Tue 14 Dec 2004 03:59 PM (UTC)
Message
attaching gdb to smaug didn't work because I usually manually start up smaug outside of the windows (as the .exe) and not in cygwin. It doesn't have a PID then. Later I started it up in cygwin, and it got a PID, so attaching gdb could work, so now it worked :)
Top

Posted by Greven   Canada  (835 posts)  Bio
Date Reply #14 on Tue 14 Dec 2004 06:01 PM (UTC)
Message
You can also boot inside of gdb, as this is a very handy feature. I would recommend, as I think most people here would, that you figure out why it you can't boot in the shell, as this is a much better method. There are numerous posts that you could check on how to fix your startup.

Nobody ever expects the spanish inquisition!

darkwarriors.net:4848
http://darkwarriors.net
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.


48,728 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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.