Hard Light Productions Forums

General FreeSpace => FreeSpace & FreeSpace Open Support => Topic started by: Bryan See on June 27, 2017, 07:53:50 am

Title: Debug error due to heap corruption
Post by: Bryan See on June 27, 2017, 07:53:50 am
Woutersmits has said he got heap corruption errors while running the debug executable of FS2_Open. Are there any ways to solve this?

[attachment stolen by Russian hackers]
Title: Re: Debug error due to heap corruption
Post by: m!m on June 27, 2017, 03:01:43 pm
Please post your fs2_open.log file.  Instructions on how to do this can be found in this post.
Title: Re: Debug error due to heap corruption
Post by: Bryan See on June 28, 2017, 03:19:50 am
Woutersmits said there's no fs2_open.log file to post here.
Title: Re: Debug error due to heap corruption
Post by: m!m on June 28, 2017, 03:23:55 am
I'm pretty sure that a log is there. Make sure that you follow the instructions in the thread I linked to.

When does the crash happen? Right at game start or during a mission?
Title: Re: Debug error due to heap corruption
Post by: Bryan See on June 28, 2017, 03:30:09 am
The crash happened right at game start, not during amission, as Woutersmits seen it. He executed it, but without logs.
Title: Re: Debug error due to heap corruption
Post by: woutersmits on June 30, 2017, 03:52:24 am
i still need help here
Title: Re: Debug error due to heap corruption
Post by: m!m on June 30, 2017, 04:39:23 am
Without a debug log there isn't much I can do without having the mod data you are using. If you can narrow down which option or table entry of FSO causes that error it would help me find the cause of this bug.
Title: Re: Debug error due to heap corruption
Post by: Bryan See on June 30, 2017, 08:51:05 am
It's something to do with heap corruption, not option or table entry of FSO.
Title: Re: Debug error due to heap corruption
Post by: m!m on June 30, 2017, 08:54:00 am
Yes ... that's what the error says...

It obviously has something to do with how you use FSO since it doesn't happen for anyone else or we would already know about it. When did this error start to appear? Which build are you using and did you change something when the error first appeared?
Title: Re: Debug error due to heap corruption
Post by: Bryan See on June 30, 2017, 09:05:48 am
It first appeared when Woutersmits tried on the Shattered Stars TC mod independent of the FreeSpace 2 directory. Anywhere.
Title: Re: Debug error due to heap corruption
Post by: Black Wolf on June 30, 2017, 09:16:07 am
Well, does that not suggest an asset problem might be the cause then?
Title: Re: Debug error due to heap corruption
Post by: Bryan See on July 01, 2017, 10:01:07 am
I think it could be the absence of required Interfaces is the problem.
Title: Re: Debug error due to heap corruption
Post by: m!m on July 01, 2017, 10:04:03 am
That statement does make absolutely no sense. Without any idea of what asset or FSO option causes this issue there is no way to find a solution for this.
Title: Re: Debug error due to heap corruption
Post by: Bryan See on July 01, 2017, 10:11:34 am
However, as for all of you involved aside from me and Woutersmits, I suspect there's something I missed during my TC asset creation. I guess this is something which would need to be addressed at the forum's Help Wanted (http://www.hard-light.net/forums/index.php?board=262.0) section though (to get help from others), and for that matter this discussion should probably be closed.
Title: Re: Debug error due to heap corruption
Post by: jr2 on July 02, 2017, 04:35:48 am
Might want to check the \data folder in the main FS2 folder, or use something like Everything (https://www.voidtools.com/) and search for fs2_open.log (it will find it instantly after performing an index of your drive).
Title: Re: Debug error due to heap corruption
Post by: Bryan See on July 03, 2017, 11:45:15 am
Might want to check the \data folder in the main FS2 folder, or use something like Everything (https://www.voidtools.com/) and search for fs2_open.log (it will find it instantly after performing an index of your drive).
Woutersmits says there's no log there. There must be some problem deep within the code itself. I think replacing malloc with calloc is one of the solutions, but I doubt this will help.

EDIT: To anyone who's unheard of heap corruption, here's the definition: a program attempts to allocate memory after it's been freed. the heap is corrupted long before the release of a block of memory. the fault occurs on a subsequent block of memory. adjacent memory blocks are used.
Title: Re: Debug error due to heap corruption
Post by: m!m on July 03, 2017, 11:48:08 am
[...] I think replacing malloc with calloc is one of the solutions, but I doubt this will help.
Stop using words of which you have no idea what they mean. calloc simply initializes allocated data with zero. The problem here has to do with corrupting the heap memory somehow which is something completely different.
Title: Re: Debug error due to heap corruption
Post by: Bryan See on July 03, 2017, 12:19:16 pm
I think it's obvious. I think Woutersmits have to download the entire FSO source code from Github and debug it from Visual Studio. The developers would guide him from there.
Title: Re: Debug error due to heap corruption
Post by: Bryan See on July 04, 2017, 04:59:05 am
Please post your fs2_open.log file.  Instructions on how to do this can be found in this post.
Here is the fs2_open.log file when it crashed due to heap corruption error - namely, writing memory after heap buffer.

[attachment stolen by Russian hackers]
Title: Re: Debug error due to heap corruption
Post by: m!m on July 04, 2017, 05:05:37 am
That log shows that the game was exited successfully without any error. Are you sure that the error actually occurred when that log was created?
Title: Re: Debug error due to heap corruption
Post by: Bryan See on July 04, 2017, 05:16:51 am
Just before. Even before it was created.
Title: Re: Debug error due to heap corruption
Post by: m!m on July 04, 2017, 06:35:04 am
That statement makes no sense. I need a log from an FSO run when the heap corruption occurred. A log from a run when it does not occur is useless.
Title: Re: Debug error due to heap corruption
Post by: Bryan See on July 04, 2017, 08:36:15 am
Woutersmits have said many times that his log doesn't seem to be created by a FSO run when the heap corruption occurred.

EDIT: Update: Woutersmits has said on Skype: "You litient m!m not ... He keeps spamming..."

EDIT #2: What should I do with him? Discipline him? Or I check with my VS2017 to reproduce this problem?
Title: Re: Debug error due to heap corruption
Post by: Black Wolf on July 04, 2017, 10:03:28 am
Are you looking in the new location for the fs open log? The SCP moved it. It's in your user file, under \AppData\Roaming\HardLightProductions\FreeSpaceOpen\data.

Check there and you should have a log that is generated during the crash.
Title: Re: Debug error due to heap corruption
Post by: Bryan See on July 04, 2017, 10:59:14 am
This should not concern me. It should concern Woutersmits. But it helps.
Title: Re: Debug error due to heap corruption
Post by: xenocartographer on July 04, 2017, 11:31:17 am
It would surely be easier if woutersmits would post his own bug reports.
Title: Re: Debug error due to heap corruption
Post by: Bryan See on July 04, 2017, 11:55:25 am
It would surely be easier if woutersmits would post his own bug reports.
You are right.
Title: Re: Debug error due to heap corruption
Post by: woutersmits on July 07, 2017, 03:30:34 am
here's fs2open.log from the userthing


[attachment stolen by Russian hackers]
Title: Re: Debug error due to heap corruption
Post by: woutersmits on July 09, 2017, 01:01:13 pm
explain this bryan see

[attachment stolen by Russian hackers]
Title: Re: Debug error due to heap corruption
Post by: Bryan See on July 10, 2017, 08:53:39 am
See this (https://stackoverflow.com/questions/1010106/how-to-debug-heap-corruption-errors) for further info.
Title: Re: Debug error due to heap corruption
Post by: Black Wolf on July 10, 2017, 09:57:48 am
I very nearly didn't post this because I'm becoming more and more convinced that you're trolling everyone Bryan See. If you are, bravo for sticking with it this long. But on the off chance you're not, I'm going to be as straightforward as I can here.

I'm not a coder, and I have very little idea how FSOpen works at that level. But I have been screwing around with this engine for the better part of two decades, and based on that, I can all but guarantee that you are barking up the wrong tree expecting the coders to fix this for you. You may think you are helping by posting five year old threads from another forum about fixing a vaguely similar problem in a totally different application, but you're not. At best, you're wasting your time, at worst you're antagonising the people who you claim you want to help you by suggesting what I'm sure are, to them, relatively obvious fixes for a problem that doesn't actually exist.

The problem appears when Woutersmits tries to play your mod as a standalone, and nowhere else. That means there are two possible causes: Either you have a corrupted or missing asset that is causing the issue, or Woutersmits has improperly loaded your mod. One of those is the cause. If  it works for you, then it's the second one. Simple as that.

Nobody else can fix this for you. You have to put in the work here if you want this solved. Talk to Woutersmits. Make sure that all the basics are done right. That you have the same versions, that he installed everything to the correct folders. Make sure that you didn't miss any files when you uploaded, and that he didn't miss any when he downloaded. Make sure he hasn't changed anything recently that might be causing the issue, like drivers or whatever. See if you can reproduce the issue on your end. If you can, great, you're narrowing it down. Then go through all your assets systematically. Revert to earlier versions until you find one that works. Go back to being FS2 dependent, see if that helps. Eventually, you will find the problem, but nobody will solve it for you if you can't find the source.

You have this huge, insanely ambitious project planned, and a frankly ridiculous concept that dozens of people are going to flock to help you realise it. That's not going to happen. If you want to put anything out, sometimes you have to be willing to put in the boring, time consuming work yourself. This is one such instance.
Title: Re: Debug error due to heap corruption
Post by: Bryan See on July 10, 2017, 10:10:23 am
I very nearly didn't post this because I'm becoming more and more convinced that you're trolling everyone Bryan See. If you are, bravo for sticking with it this long. But on the off chance you're not, I'm going to be as straightforward as I can here.

I'm not a coder, and I have very little idea how FSOpen works at that level. But I have been screwing around with this engine for the better part of two decades, and based on that, I can all but guarantee that you are barking up the wrong tree expecting the coders to fix this for you. You may think you are helping by posting five year old threads from another forum about fixing a vaguely similar problem in a totally different application, but you're not. At best, you're wasting your time, at worst you're antagonising the people who you claim you want to help you by suggesting what I'm sure are, to them, relatively obvious fixes for a problem that doesn't actually exist.

The problem appears when Woutersmits tries to play your mod as a standalone, and nowhere else. That means there are two possible causes: Either you have a corrupted or missing asset that is causing the issue, or Woutersmits has improperly loaded your mod. One of those is the cause. If  it works for you, then it's the second one. Simple as that.

Nobody else can fix this for you. You have to put in the work here if you want this solved. Talk to Woutersmits. Make sure that all the basics are done right. That you have the same versions, that he installed everything to the correct folders. Make sure that you didn't miss any files when you uploaded, and that he didn't miss any when he downloaded. Make sure he hasn't changed anything recently that might be causing the issue, like drivers or whatever. See if you can reproduce the issue on your end. If you can, great, you're narrowing it down. Then go through all your assets systematically. Revert to earlier versions until you find one that works. Go back to being FS2 dependent, see if that helps. Eventually, you will find the problem, but nobody will solve it for you if you can't find the source.

You have this huge, insanely ambitious project planned, and a frankly ridiculous concept that dozens of people are going to flock to help you realise it. That's not going to happen. If you want to put anything out, sometimes you have to be willing to put in the boring, time consuming work yourself. This is one such instance.
OK noted. We're not trolling. We're seeking help, but I have to admit nobody can help us. I'll look into these assets and try to go FS2 dependent and see if that helps. But Shattered Stars is a TC mod.
Title: Re: Debug error due to heap corruption
Post by: Black Wolf on July 10, 2017, 10:21:15 am
Not if it causes the engine to crash it isn't. Until you solve that, it's nothing at all.
Title: Re: Debug error due to heap corruption
Post by: Bryan See on July 10, 2017, 10:40:23 am
Oh I see. That should be the number one priority for me, at least. FS2-independent TC conversions require that, I believe.