Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: KeldorKatarn on June 27, 2009, 02:36:55 pm

Title: code/lab/wmcgui.cpp assertion error
Post by: KeldorKatarn on June 27, 2009, 02:36:55 pm
I don't know what caused it, since I don't know what the code is trying to do, but when loading up the lab with a debug build I always got an assertion error
from within a vector class because the index was out of bounds (the vector was empty).

Since the code is trying to access the first element to get the starting address of the vector (bad bad thing to do without checking the vector first) this caused the assertion.

I changed the code to do the length check first and only try to get the address of the vector if it actually contains any elements (otherwise the entire function is not doing anything anyway).

Patch attached.

[attachment deleted by MSC
Title: Re: code/lab/wmcgui.cpp assertion error
Post by: KeldorKatarn on June 28, 2009, 03:29:36 pm
Anyone?
Title: Re: code/lab/wmcgui.cpp assertion error
Post by: KeldorKatarn on July 02, 2009, 03:32:13 pm
can someone from SCP please comment on this and either confirm or discard it? If this is an issue not just on my PC it needs to be put into trunk.
Title: Re: code/lab/wmcgui.cpp assertion error
Post by: The E on July 02, 2009, 03:41:24 pm
I saw this as well. Seems to be fixed in the latest svn revision.
Title: Re: code/lab/wmcgui.cpp assertion error
Post by: chief1983 on July 02, 2009, 04:19:02 pm
I have a feeling this was related to the FRED crashiness and other strange happenings between 5358 and 5387.  As he pointed out, it should be fixed now.  Some debugging features were accidentally enabled (I do wonder if this is related to the Ubuntu crashing though).
Title: Re: code/lab/wmcgui.cpp assertion error
Post by: portej05 on July 03, 2009, 01:12:35 am
(I do wonder if this is related to the Ubuntu crashing though).

I'm still 99% sure that we're overrunning buffers (I was kinda asleep while kara was going through the parselo stuff last night :P )
Title: Re: code/lab/wmcgui.cpp assertion error
Post by: chief1983 on July 03, 2009, 02:50:50 am
I'm 100% sure that we are overrunning buffers.  I know which buffers we're overrunning too, to some extent.