> I know the title isn't very descriptive of my problem but i couldn't > find a better one. I'm currently working on a MUD (surprise!) and all > was working well. Suddenly, the game started to crash like hell. > Well, nothing new about that, you say. The problem is that it crashes > inside malloc. The crash is sometimes with BUS error, others with SEGFAULT. > And the worst is that it is more or less random. Sometimes it doesn't crash, > other times, it crashes. I can't find anything wrong with the code. > I forgot to mention that when malloc crashes it has been called from > either fprintf ou realloc, or things of the sort. > I've even tried changing machine, from a DGUX to a SUN OS, and it still > crashes, only more rarely. > > As anyone ever experienced this, and if so how did you solve it? I could > really use some help. Most likely, some code you have recently added is corrupting the malloc arena (i.e., you're screwing up malloc's intenal data structures, causing it to crash.) This can be caused by overwriting a malloc()'d piece of memory, calling free() twice on the same piece of memory, or calling free() on a piece of memory that was never malloc()'d in the first place (i.e. calling free() on an array). If these crashes have started "suddenly", as you've said, it probably means the most recent change you made to the code before it suddenly started crashing was the problem. Take it out.
This archive was generated by hypermail 2b30 : 12/07/00 PST