Well, I think I MIGHT have fixed it, but I'm nothing close to sure.... I replaced all calls to str_dup with STRALLOC in boards.c and all calls to DISPOSE that were being used on pnote-><whatever> with STRFREE and I've been able to erase 9 messages straight with no problems. I've checked the log file for the instance that's running and there're no bug messages, so I'm hoping that what I did actually fixed the problem and didn't simply cover it up.

If Valgrind ran without complaining (except for memory leaks at the end, there) and you did everything you normally to do reproduce the problem, then you're probably in good shape. Valgrind is a very useful tool for debugging memory problems by the way, so it's good that you've gained some familiarity with it and already fixed nine problems.

As for fixing the memory leaks, you can turn on more debugging output to see where the memory leaks happened and where said memory was allocated. I think the flag is --leak-check=full or something like that (it tells you at the end what to put in). A lot of the "leaks" aren't actually problems, because they occur only when you quit the program without explicitly deleting things (which doesn't really matter in most cases because everything is freed on exit). You want to look for leaks that occur during normal execution of the program. For example, aborting a note might cause a memory leak if the various string pointers aren't properly freed.

Fixed two problems actually. I meant that I was able to erase 9 messages from a board without any noticeable issues. As for the second thing I fixed, it was a case of trying to free a null pointer in do_note_write under the SUB_NOTE_TEXT case in the switch statement.

Oh, I'm not taking it lightly, especially since that's what's causing the crashes. And I fully intend to get that fixed before really worrying about the aborting message problem. So I'm off to find me a tutorial of some sort for valgrind.

Wow, Zeno missed a chance to post a link to Nick Gammon's tutorial on something?

Unfortunately, to the best of my knowledge, MudDomain closed down permanently about 6-12 months ago, so the link's probably not any good anymore, which would explain why Zeno didn't jump in to post it for you. Sorry for the false alarm.

Oh, wait, maybe this one's more useful/helpful, back on March 9, 2009, Zeno posted to Help Crashing the following:

Yeah, I ended up just using a couple of different tutorials found through google ( Here and Here) as well as the valgrind.org manual to somewhat figure out what to do. Right now I'm looking at the cleanup_memory function in AFKMud to see about porting that over so valgrind will just ignore all of the junk that's supposed to stay in memory until the mud shuts down, thereby only reporting the things that are actual issues.

I think they're both a little outdated, but most of the stuff still works just fine. The only real problem I had with what they show for the arguments to valgrind was for the log file. Need to use --log-file=<filename> and not --logfile=<filename>. But that was pretty much the only thing, plus there's a link at the bottom that goes to another page with some good descriptions of some of the error messages along with an explanation.

The second is probably more useful but I found them both handy...

I'd also STRONGLY suggest that everyone ports the cleanup_memory system from AFKMud. I've managed to learn quite a bit about how some of the stuff in the mud works while doing so.

Now I just have to figure out why one cat has decided to hang out on top of the refrigerator while the other one has usurped the kitchen counter...

After getting it in I went from 20,610 allocs, 6,082 frees and 700+ error messages to 19,634 allocs, 18,455 frees and 15 or so error messages. It's kind of nice going from around 20k blocks of not freed memory to only 1,179.

Kayle said:

Samson said:

And the cats you see are merely the lookouts for the ones causing the real trouble, somewhere just out of sight.

Isn't that the truth... *runs to see what that crash in the kitchen was*

I used to have four cats and a dog. Now it's just the two cats thankfully.

Unfortunately, to the best of my knowledge, MudDomain closed down permanently about 6-12 months ago, so the link's probably not any good anymore, which would explain why Zeno didn't jump in to post it for you. Sorry for the false alarm.

Well I'm the one that created that article if I remember right (sorry don't have a copy of it around either did it long long ago, around the time cleanup_memory got put into everything to stop giving so many warnings). But I never realized it was considered a good article either lol. It was just something to cover the basics of using it. Not sure where you could find a copy of it unless Paradigm happens to have a copy of it around somewhere.

lol well the number depends on what you consider more advanced I use to restart the code a few times a year over all. I'd go various directions with lots of different things on a base till I got bored and then start over lol. Normally each time I started over I'd go a different direction. One of the few old copies I still have, still has a lot of stuff I haven't added to the current one lol. One of these days I might actually take the time to tear it down and use some of it.

<br />
Unfortunately, to the best of my knowledge, MudDomain closed down permanently about 6-12 months ago, so the link's probably not any good anymore, which would explain why Zeno didn't jump in to post it for you. Sorry for the false alarm.
<br />

<br />
Oh, wait, maybe this one's more useful/helpful, back on March 9, 2009, Zeno posted to Help Crashing the following:
<br />

<br />
At the very least, it's a much more recent link from him and sounds somewhat more promising, though I can't say that I've ever understood valgrind very well, even with reference to the docs.
<br />

<br />
Sadly enough, a quick search of this site's forum posts doesn't seem to have anything better than that to offer for you, but hopefully it's enough.