View Issue Details

IDProjectCategoryView StatusLast Update
0000396FSSCPgameplaypublic2005-04-30 17:10
Reporterphreak Assigned Tophreak  
PriorityurgentSeveritycrashReproducibilityrandom
Status resolvedResolutionfixed 
PlatformP4 3.2OSWinXPOS VersionSP2
Product Version3.6.5 
Summary0000396: Crash on loading
DescriptionPeople have been getting strange errors about certain missions crashing upon loading. All i'm seeing right now is that its crashing in model_load() with an access violation error

a closer inspection of the code reveals its crashing in this segment of code

for (i=0; i< MAX_POLYGON_MODELS; i++) {
        *****if ( Polygon_models[i] ) {
            if (!stricmp(filename, Polygon_models[i]->filename) && !duplicate)***** {
                // Model already loaded; just return.
                Polygon_models[i]->used_this_mission++;
                return Polygon_models[i]->id;
            }
        } else if ( num == -1 ) {
            // This is the first empty slot
            num = i;
        }
    }


whats going on is that something is setting Polygon_models[i] to some non-null garbage value and then it keeps getting accessed.

+ [245] 0x00000000
+ [246] 0x00000000
+ [247] 0x00000000
+ [248] 0x00000000
+ [249] 0x00000000
+ [250] 0x00000001 **
+ [251] 0x00000001 **
+ [252] 0x00000008 **
+ [253] 0x00000000
+ [254] 0x00000000
+ [255] 0x00000000
+ [256] 0x00000000


This occurs whether i'm running an inf_build or not. also it seems to happen on select missions. I can play some missions in Derelict fine, but it'll crash for some other missions.
TagsNo tags attached.

Activities

phreak

2005-04-30 17:09

developer   ~0002289

well that was easier than i thought.

when a ship is paged in, so are all of its textures, including afterburner plume bitmaps. If the bitmap doesn't exist, it should be set to -1; however, the default value was -2. This caused bm_page_in_texture() to keep processing since bitmap_num != -1 (should be changed to if (bitmap_num < 0) return;) This in turn caused garbage to be written into Polygon_models[whatever]. since i guess bm_bitmaps[-2] points to some location in Polygon_models.

fixxxed

Issue History

Date Modified Username Field Change
2005-04-30 16:28 phreak New Issue
2005-04-30 17:09 phreak Note Added: 0002289
2005-04-30 17:10 phreak Status new => resolved
2005-04-30 17:10 phreak Resolution open => fixed
2005-04-30 17:10 phreak Assigned To => phreak