Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Scooby_Doo on January 02, 2010, 03:32:32 pm

Title: Assert: n < pm->n_models
Post by: Scooby_Doo on January 02, 2010, 03:32:32 pm
Has anyone seen this error before, occurs when it tries to load a model:


Assert: n < pm->n_models
File: modelread.cpp
Line: 1208

ntdll.dll! NtWaitForSingleObject + 21 bytes
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
kernel32.dll! BaseThreadInitThunk + 18 bytes
ntdll.dll! RtlInitializeExceptionChain + 99 bytes
ntdll.dll! RtlInitializeExceptionChain + 54 bytes



Verify failure: Vbuf0 != NULL

ntdll.dll! NtWaitForSingleObject + 21 bytes
kernel32.dll! WaitForSingleObjectEx + 67 bytes
kernel32.dll! WaitForSingleObject + 18 bytes
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
fs2_open_3_6_11d-20091221_r5733.exe! <no symbol>
kernel32.dll! BaseThreadInitThunk + 18 bytes
ntdll.dll! RtlInitializeExceptionChain + 99 bytes
ntdll.dll! RtlInitializeExceptionChain + 54 bytes
:
Title: Re: Assert: n < pm->n_models
Post by: The E on January 02, 2010, 03:39:55 pm
Hmm. Well, the second one is pretty much irrelevant (In my experience, I have only seen it after clicking through the first assert).

Looking at the code that calls it:

Code: [Select]
case ID_SOBJ: { //Subobject header
int n;
char *p, props[MAX_PROP_LEN];
// float d;

//mprintf(0,"Got chunk SOBJ, len=%d\n",len);

n = cfread_int(fp);
//mprintf(("SOBJ IDed itself as %d", n));

Assert(n < pm->n_models );

It seems to get called when a subobject's ID is greater than the number of subobjects referenced in the POF header. Not sure how to fix it, or what the exact cause is, though.

Title: Re: Assert: n < pm->n_models
Post by: chief1983 on January 02, 2010, 04:04:39 pm
Don't delete subobjects improperly?  I think it can happen with certain changes made to a model in PCS2.  Or maybe that was a different error.  Basically it doesn't recalculate all the object's IDs so the last one ends up with an ID higher than the new total number of objects I think.

Edit: Actually the problem I saw it with was with deleting unused textures, but it might be a similar issue.
Title: Re: Assert: n < pm->n_models
Post by: Scooby_Doo on January 02, 2010, 04:17:25 pm
Don't delete subobjects improperly?  I think it can happen with certain changes made to a model in PCS2.  Or maybe that was a different error.  Basically it doesn't recalculate all the object's IDs so the last one ends up with an ID higher than the new total number of objects I think.

Edit: Actually the problem I saw it with was with deleting unused textures, but it might be a similar issue.

That might have been it.  I had one too many lod levels and fs2 complained about it, so I used pcs2 to quickly nuke the offending lod.
Title: Re: Assert: n < pm->n_models
Post by: chief1983 on January 02, 2010, 08:33:42 pm
Improperly is probably the wrong word, that method should work but I'm guessing it's a PCS2 bug that's breaking the model.
Title: Re: Assert: n < pm->n_models
Post by: FUBAR-BDHR on January 03, 2010, 11:47:46 pm
I've noticed the 2.03 with collada (one in Chief's sig there) has problems with deleting and importing objects.  The build previous while it has other bugs doesn't seem to have that problem.

Also when you deleted the LOD did you remove the header entry as well?
Title: Re: Assert: n < pm->n_models
Post by: Scooby_Doo on January 03, 2010, 11:52:46 pm
Not familiar with that.... I just rebuilt the entire pof file so the problem went away.