Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Crashes on start - malloc(): invalid next size (unsorted) #7496
Version of OpenTTD
1.9.1, but it also happens with 1.9.0
openttd starts fine
malloc(): invalid next size (unsorted)
Steps to reproduce
This looks strange, as far as I can tell there is no way for stredup() to attempt a zero byte allocation, since it always adds 1 to the input string length. The only other possibility I can think of would be some kind of buffer overrun causing it to attempt a far too large allocation (say multiple gigabytes).
There are multiple cases of stredup() in DetermineBasePaths(), do you think you can narrow it down?
The one in 1067 apparently
This sort of error suggests that heap corruption most likely took place before the point where the crash occurred.