double free error

More
6 months 2 days 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
6 months 2 days ago - 6 months 2 days 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: 6 months 2 days ago by thomas.

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

More
5 months 3 weeks 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.

More
3 months 1 week ago #10240 by prool
Replied by prool on topic double free error
2 month, 3 weeks...

I couldn't repeat the mistake.

Perhaps it was a random long sequence of bytes into the port from random internet spider...

With best regards, Prool

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

Time to create page: 0.095 seconds