Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
JoelMurdoch

Speaking of crashing for trivial things...

Recommended Posts

I was using the original SMMU method when I got this crash. I'm now using the EMAPINFO lump and haven't tried to see if it crashes too.

Share this post


Link to post

It will. esselfortium has hit the same problem, only for him instead of crashing, it causes ExtraData to randomly malfunction by corrupting the lump name provided via MapInfo. I've identified the problem as the fix to the problem. That is, what I did to fix this bug in MapInfo is still wrong and will randomly fail to produce correct results. If your MapInfo lump is a multiple of 32 bytes in size, it will corrupt the next block on the zone heap and cause a crash.

The problem was two lines of code meant to normalize the lump and make parsing easier:

lump[size]     = '\n';
lump[size + 1] = '\0';
I forgot that I had already added +2 to size to account for the extra characters I add to the end of the file. This means that I'm writing two bytes past the end. The correct code should have been:
lump[size - 2] = '\n';
lump[size - 1] = '\0';
This'll be repaired in the next release. In the meanwhile, if you terminate your MapInfo lumps with a linebreak and avoid making them a multiple of 32 bytes in size, you shouldn't have any issues with this.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×