double free error

More
3 days 6 hours ago #10157 by prool
double free error was created by prool
Hello, colleagues!

I'm compiling current version of tbaMUD from git

and run in my test server.

After 2 days MUD is crashed with strange error:

double free error or corruption

I'm repeat crash with gdb and look line of error:

File comm.c

after comment /* Clear the command history */

Statement

if (d->history[cnt])
        free(d->history[cnt]);  // <- crash here, says sir gdb

Line # 2103 in original codeI don't know how to fix it

With best regards,

Serge "Prool" Pustovoitoff

With best regards, Prool

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

More
2 days 23 hours ago - 2 days 23 hours ago #10158 by thomas
Replied by thomas on topic double free error
Hi Serge,

This problem should not arise. I mean, this is code that's been running for decades, literally, with no problem on other machines. So, it's probably a symptom of something else failing somewhere else in the code, causing this code to be run twice on the same structure.

I think it is a good start what you're listing here, but please read this www.tbamud.com/forum/4-development/6-debugging-tutorial-for-gdb for a better description of how to use gdb.
I would very much like to know the output of print *d and print d->history as well as info local to be able to offer any help here.

Some questions I would want answered: could this be an already free'd descriptor_data? Which index of the history array are we freeing? What was in the rest of this array?
Last edit: 2 days 23 hours ago by thomas.

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

More
9 hours 3 minutes ago #10162 by prool
Replied by prool on topic double free error
Thank you for good response.

I'm waiting of another crash...

With best regards, Prool

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

Time to create page: 0.083 seconds