Welcome to the Builder Academy

Question Crash

More
19 Jan 2020 04:03 #8480 by Castillo
Crash was created by Castillo
Hello there.

I'm playing around with the code base of TBA mud 2020.
And, found that the mud crash on shutdown. It seems if a mobile start following me. I think, because:

This test crash TBA mud 2020.

goto guard
force guard follow castillo
shutdown

Jan 18 22:54:38 2020 :: Closing link to: Castillo.
Jan 18 22:54:38 2020 :: Saving current MUD time.
Jan 18 22:54:38 2020 :: Normal termination of game.
Jan 18 22:54:38 2020 :: Clearing game world.

Program received signal SIGSEGV, Segmentation fault.
0x00000000004fc6c7 in stop_follower (ch=ch@entry=0x1b7cce0) at utils.c:549
549 for (k = ch->master->followers; k->next->follower != ch; k = k->next);
(gdb)

Bob

Please Log in or Create an account to join the conversation.

More
19 Jan 2020 06:00 #8481 by krell
Replied by krell on topic Crash
This seems eerily familiar.

Crash on Shutdown

I don't know if this was ever solved. A while back I was going to make entries to track values happening at different points at what I thought might be the affected code. But I got frustrated unraveling that knot of code after a while.

Maybe you'll be the one who solves it.

Please Log in or Create an account to join the conversation.

More
19 Jan 2020 06:56 #8482 by Castillo
Replied by Castillo on topic Crash
I'll get a look at it tomorrow. It's pretty late now.
I'll have to figure out more about all the codes.

In my example
549 for (k = ch->master->followers; k->next->follower != ch; k = k->next);

Obviously, it crash because k exist, but k->next = NULL, so k->next->follower can't be
accessed and cause the SIGSEGV.

shouldn't there be atlease a security check to avoid a crash. even, if it's just a temporary fix? Something, that will check if (!k->next) whatever code is needed?

i need to understand more this code.
i'll see tomorrow.

Bob

Please Log in or Create an account to join the conversation.

More
19 Jan 2020 11:49 #8483 by thomas
Replied by thomas on topic Crash
This should be an easy fix. And it's reproducible.

Please Log in or Create an account to join the conversation.

More
19 Jan 2020 13:44 #8485 by thomas
The following user(s) said Thank You: krell

Please Log in or Create an account to join the conversation.

More
19 Jan 2020 18:41 #8487 by krell
Replied by krell on topic Crash
That did it alright! Thanks Thomas, Welcor and the rest of the mud's development team.

Please Log in or Create an account to join the conversation.

Time to create page: 0.293 seconds