Home » PLAYER'S HQ 1.13 » JA2 Complete Mods & Sequels » Stracciatella Project (Platform Independent JA2) » Has anyone else had crashes due to Assertion Failure in Campaing_types.h?
Has anyone else had crashes due to Assertion Failure in Campaing_types.h?[message #245227] Wed, 24 February 2010 21:12 Go to next message
Mythrell is currently offline Mythrell

 
Messages:78
Registered:May 2008
Location: Mikkeli, Finland
I'm experiencing random crash in my latest mod SVN version with following error in stderr.txt:
{ 1229756 } Assertion Failure [Line 11 in Build/Strategic/Campaign_Types.h]

Has anyone else had anything like this or have I caused it myself? I shouldn't have touched anything what would cause those in that particular function but that is possible, I just can't seem to be able to find the cause.

It's starting to bug me, seriously :computer2:

Report message to a moderator

Corporal
Re: Has anyone else had crashes due to Assertion Failure in Campaing_types.h?[message #245228] Wed, 24 February 2010 21:40 Go to previous messageGo to next message
BirdFlu is currently offline BirdFlu

 
Messages:438
Registered:September 2007
Location: Lampukistan
see here

Report message to a moderator

Master Sergeant
Re: Has anyone else had crashes due to Assertion Failure in Campaing_types.h?[message #245233] Wed, 24 February 2010 23:46 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
Most of the time, the assertion in "Campaign_Types.h" happens because no sector is loaded.

If you didn't compile with the JA2TESTVERSION or JA2BETAVERSION flags enabled, follow BirdFlu's link.

If you did, it will happen everytime there is an hourly update (every game hour) with no sector loaded. It's not random.

Another common crash (with the flags on) is the helicopter when landing at destination.

Report message to a moderator

Master Sergeant
Re: Has anyone else had crashes due to Assertion Failure in Campaing_types.h?[message #245238] Thu, 25 February 2010 01:39 Go to previous messageGo to next message
Mythrell is currently offline Mythrell

 
Messages:78
Registered:May 2008
Location: Mikkeli, Finland
ah, that's good to know, thank you both Smile

I ended up commenting the two Assert lines out.

Turns out it's not like my great theory so I threw it out. Bugger. Smile

[Updated on: Thu, 25 February 2010 01:49] by Moderator

Report message to a moderator

Corporal
Re: Has anyone else had crashes due to Assertion Failure in Campaing_types.h?[message #250942] Tue, 04 May 2010 10:46 Go to previous messageGo to next message
Tron

 
Messages:225
Registered:August 2007
Location: Germany
I resolved some of the invalid sector calculations in r7061. Thanks for reporting this issue.

Report message to a moderator

Sergeant 1st Class
Re: Has anyone else had crashes due to Assertion Failure in Campaing_types.h?[message #250958] Tue, 04 May 2010 17:30 Go to previous messageGo to next message
SpaceViking is currently offline SpaceViking

 
Messages:751
Registered:January 2004
Location: Rochester, Minnesota, USA
Most of the invalid sector stuff was fixed in the mainline JA2 code last year (by me). You might want to check there.

[Updated on: Tue, 04 May 2010 17:30] by Moderator

Report message to a moderator

First Sergeant

Re: Has anyone else had crashes due to Assertion Failure in Campaing_types.h?[message #251276] Mon, 10 May 2010 01:10 Go to previous messageGo to next message
The_Bob is currently offline The_Bob

 
Messages:415
Registered:May 2009
Location: Behind you.
Here's a gem that seems to go off only on the msvc++ compatible version made by birdlfu - although in theory, it should cause problems everywhere.

In strategic_movement.cc, in function PlayersBetweenTheseSectors() there's this block:
		INT16 const sec_prev = SECTOR(g.ubPrevX,   g.ubPrevY);
		INT16 const sec_cur  = SECTOR(g.ubSectorX, g.ubSectorY);
		INT16 const sec_next = SECTOR(g.ubNextX,   g.ubNextY);


which works fine most of the time, however when the function is called to display possible retreat locations, g.ubNextX and g.ubNextY equal zero - because the group has already arrived and has no next sector to go to. This should cause an ass failure in the SECTOR macro:
static inline UINT SECTOR(UINT const x, UINT const y)
{
	Assert(1 <= x && x <= 16);
	Assert(1 <= y && y <= 16);
	return (y - 1) * 16 + x - 1;
}


My fix for that is to replace the line
		INT16 const sec_next = SECTOR(g.ubNextX,   g.ubNextY);

with
		INT16 sec_next = 0;
		if (g.ubNextX > 0 && g.ubNextY > 0) 
		{
			sec_next = SECTOR(g.ubNextX,   g.ubNextY);
		}

which fixes the problem in this instance.

My two additional points are:
1 - there are many places in the code where ubNextX and ubNextY are checked for being zero, and there may be even more where they are not - perhaps the SECTOR macro assertions ought to be relaxed and allow for a situation where both sector coordinates are zero and return 0 (as in sector 1,1).

2 - in the mingw version the assertions do nothing in this case - the line
		INT16 const sec_next = SECTOR(g.ubNextX,   g.ubNextY);
with both variables equal zero yields
sec_next = -17
which is undesirable, although seems harmless in that specific situation. Still, that is a signed value in a place where only unsigned ones should be allowed.

[Updated on: Mon, 10 May 2010 01:14] by Moderator

Report message to a moderator

Master Sergeant
Re: Has anyone else had crashes due to Assertion Failure in Campaing_types.h?[message #251380] Mon, 10 May 2010 23:45 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
If the coordinates are checked so often, it would probably be a good idea to have an exported inlined filter function to validate them somewhere:
Edited to change UINT16 to UINT8 as the names g.ub... suggests.
inline bool coords_are_valid(UINT8 x, UINT8 y)
{
return x && y && x < 17 && y < 17;
}

Which would make your code become:
INT16 const sec_next = coords_are_valid(g.ubNextX, g.ubNextY) ?
                       SECTOR(g.ubNextX, g.ubNextY) : -1;

And use the unique incorrect sector id value of -1 instead of things like -17 or, worse, 0, which seems to be a correct sector id value.

It's another case where the sector coordinates are unsigned and their equivalent in one dimension is signed.

[Updated on: Mon, 10 May 2010 23:55] by Moderator

Report message to a moderator

Master Sergeant
Re: Has anyone else had crashes due to Assertion Failure in Campaing_types.h?[message #255528] Mon, 05 July 2010 12:38 Go to previous messageGo to next message
Lyrics is currently offline Lyrics
Messages:4
Registered:July 2010
Hello,

I'm very pleased to be able to play JA2 in Windows7 64 bit.
I got two helicopter crashes and maybe it helps if I post the savegames?

http://www.mediafire.com/file/eim4ny5qojw/errors.zip


edit:
I got Straciatella "Build 7059 hotfix 3" from here:
http://ja2.monkeyphysics.com/home/windows

[Updated on: Mon, 05 July 2010 12:41] by Moderator

Report message to a moderator

Civilian
Re: Has anyone else had crashes due to Assertion Failure in Campaing_types.h?[message #255551] Mon, 05 July 2010 23:09 Go to previous messageGo to next message
bbun is currently offline bbun

 
Messages:74
Registered:April 2004
Location: Amsterdam
It's a feature that the helicopter gets hit by SAMs and eventually crashes when you fly around in enemy territory Smile

Just kidding. Could you be more specific about the moment of your CTD (crash to desktop)? At what point in the game, after which action?

Glad you found the link to my site. Hopefully Ddass will compile a new version some time, based on the latest svn version.

Report message to a moderator

Corporal
Re: Has anyone else had crashes due to Assertion Failure in Campaing_types.h?[message #255558] Tue, 06 July 2010 00:38 Go to previous messageGo to next message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
bbun
Hopefully Ddass will compile a new version some time, based on the latest svn version.

But too bad that one or two of the bugs fixed in the version that Levito currently uses were left out in svn. svn misses the "Remove dead mercs" and Darren's wrong quote fixes too. I think I didn't release the fix for Darren here, but I sent it to Tron weeks or months ago. Stracciatella is probably dead now.

Report message to a moderator

Master Sergeant
Re: Has anyone else had crashes due to Assertion Failure in Campaing_types.h?[message #255565] Tue, 06 July 2010 04:16 Go to previous messageGo to next message
Kaerar is currently offline Kaerar

 
Messages:2022
Registered:January 2003
Location: Australia :D
No it's not. He's been about quite recently actually Wink

Report message to a moderator

Lieutenant

Re: Has anyone else had crashes due to Assertion Failure in Campaing_types.h?[message #255576] Tue, 06 July 2010 16:12 Go to previous messageGo to next message
Lyrics is currently offline Lyrics
Messages:4
Registered:July 2010
I'm glad to hear that! Smile

Sorry, I forgot to mention when both crashes happened. I had sent almost all of my team via chopper to Drassen the first time it crashed. The game crashed when the helicopter landed if I remember correctly (just before the chopper-icon was centered in the map tile of Drassen airport). After that I loaded the game and I ran to the Bobby Ray crate to open it. When I returned to the map screen the helicopter was suddenly gone.
So I loaded again and this time the chopper was still there.

I continued playing a bit and when the helicopter landed the game crashed again. I loaded error.sav and have played fine since then.

Report message to a moderator

Civilian
Re: Has anyone else had crashes due to Assertion Failure in Campaing_types.h?[message #255610] Wed, 07 July 2010 00:38 Go to previous message
mgl is currently offline mgl

 
Messages:255
Registered:December 2007
Location: France
Kaerar
No it's not. He's been about quite recently actually Wink

It's only two or three days of activity and a handful of hours spent on the code (mostly to fix a header for Microsoft's compiler) in eight months. I can't be very optimistic with that.

Report message to a moderator

Master Sergeant
Previous Topic: not getting resolution change
Next Topic: Can stracciatella skip militia turn?
Goto Forum:
  


Current Time: Wed May 01 07:56:34 GMT+3 2024

Total time taken to generate the page: 0.01583 seconds