Home » MODDING HQ 1.13 » v1.13 Bug Reports » Latest Source Code: Crash in a DEBUG Build on startup
Latest Source Code: Crash in a DEBUG Build on startup[message #359194] Tue, 17 March 2020 12:18 Go to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
Hi guys,

I downloaded latest SVN code and compiled DEBUG version of the code in Visual Studio 2010. When I try to run the debug code it crashes with some "vector" errors.

The error is thrown in "Weapons.cpp::ReadInWeaponStats" in the the following line:

if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))

https://www.dropbox.com/s/j4hp1l7bmhbv8kc/JA2_Error_Debug_Start.png

Does anyone else experience the crash in a debug build?

[Updated on: Tue, 17 March 2020 12:20]

Report message to a moderator

Sergeant Major

Re: Latest Source Code: Crash in a DEBUG Build on startup[message #359195 is a reply to message #359194] Tue, 17 March 2020 12:32 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
I reported this problem already in 2019 in this thread.

Quote:

VS2010 debug exe r8681 crashes with an assertion when starting to read weapons.xml.

Error message is "vector iterators incompatible". Crash happens at line 499 in Weapons.cpp. Error is related to addition of barrel configurations which are stored in the vector that causes the crash (vector barrelconfigurations in struct WEAPONTYPE in Weapons.h). Directly assigning one vector to another doesn't seem to be a good idea. The crash can be circumvented with a memcpy but it also crashes at other code locations later on (advanced tab of EDB for example). Could a developer please take a look and fix this?
So far there was no fix. In the meantime I updated to VS2019 Community and have even more issue with vectors. This time it is caused by reading Drugs.xml. I reported it in this thread (Damn this forum software that can't handle links to posts anymore! thumbs down )
Quote:

I can't debug the game anymore because with VS 2010, which I used previously, the debug exe crashed with a vector iterators incompatible error for the barrel configurations and with the new VS 2019 the debug exe throws a read access violation in function ReadInDrugsStats() which is called by LoadExternalGameplayData() in Init.cpp. Because of the access violation external data isn't loaded correctly and the game crashes before even reaching the main menu.

The read access violation is reported in this step in function drugsEndElementHandle() in XML_Drugs.cpp:
			pData->curArray[pData->uiIndex].personality_effects.push_back( pData->personality_effects );
Because of these issues I stopped working with the code.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: Latest Source Code: Crash in a DEBUG Build on startup[message #359196 is a reply to message #359195] Tue, 17 March 2020 14:47 Go to previous messageGo to next message
Asdow is currently offline Asdow

 
Messages:126
Registered:August 2010
I tried to take a stab at pinpointing this a little bit ago when seven mentioned that silversurfer was having issues with the debug build, but I cannot replicate either of those crashes using the VS2019 solution that I added to the trunk. It compiles the debug build successfully, and I can launch the debug .exe without any issues both with and without using Visual Studio 2019's debugger. On the other hand, I can't compile the 2017 solution debug build on VS2017. I'm stumped on how it can behave so differently on different hardware. Silversurfer and I compared the source code revision and VS versions and they were identical yet it works for me and not for him.

Report message to a moderator

Sergeant
Re: Latest Source Code: Crash in a DEBUG Build on startup[message #359197 is a reply to message #359196] Tue, 17 March 2020 14:57 Go to previous messageGo to next message
silversurfer

 
Messages:2793
Registered:May 2009
Maybe it's a certain VS setting that carried over from VS2010 Express which I was using before. I'm no developer so I have no idea where to look or how to solve these issues.
And I'm not going to re-install Windows just to have a clean registry. ;)



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Re: Latest Source Code: Crash in a DEBUG Build on startup[message #359198 is a reply to message #359197] Tue, 17 March 2020 19:12 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
I found something similar with vector problem in the svn revision log from changeset 8005. We had some problem with initializing the drug system xml file. Maybe these changes which fixed the debug build can be applied to our current problem?

Report message to a moderator

Sergeant Major

Re: Latest Source Code: Crash in a DEBUG Build on startup[message #359292 is a reply to message #359198] Sat, 28 March 2020 18:45 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1961
Registered:October 2005
Location: Austria
I found a workaround to debug the code and don't get the "vector" error. Just compile a "Release_WithDebugInfo" Build. Then the game starts without any errors and you can also debug.

Report message to a moderator

Sergeant Major

Re: Latest Source Code: Crash in a DEBUG Build on startup[message #359293 is a reply to message #359292] Sat, 28 March 2020 19:00 Go to previous message
silversurfer

 
Messages:2793
Registered:May 2009
That's interesting. Thank you. Now it runs without crashing but I would still be interested in the difference between debug and release builds that is causing the crash.


Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Report message to a moderator

Lieutenant
Previous Topic: Initial settings missing
Next Topic: BUG, A9-A10 full of clothes racks and other weird furniture strewn everywhere else in map.
Goto Forum:
  


Current Time: Fri Mar 29 08:21:22 GMT+2 2024

Total time taken to generate the page: 0.01328 seconds