Woops, I don't know what happened but my question got posted in another
discussion, I'll just resubmit it.
Hi, for a certain time I've been having access violation errors that seemed
to be caused by some kind of race condition with a custom entity, based on
the hl2 buggy code. I presumed it was a race condition induced error, since
it was intermittent and happened during the spawn/precache phase when
loading a map with the entity on it, and because the vehicle is 3 separate
entities (server vehicle, driveable vehicle, and physics ) . The call stack
indicates the access violation occurs in tier0, and the last method of the
server in the stack is the new operator for the KeyValues class.
tier0.dll!00234a10()
> [Frames below may be incorrect and/or missing, no symbols loaded for
> tier0.dll]
> tier0.dll!00234bac()
> tier0.dll!00234caf()
> tier0.dll!00234f3a()
> > server.dll!KeyValues::operator new(unsigned int iAllocSize=32, int
> nBlockUse=1, const char * pFileName=0x163012c0, int nLine=329) Line 2350
> C++
> server.dll!CBaseProp::ParsePropData() Line 329 + 0x17 bytes C++
> server.dll!CBaseProp::Spawn() Line 193 + 0x8 bytes C++
> server.dll!CPropSFRVehicle::Spawn() Line 93 C++
> server.dll!CFighterVehicleDriveable::Spawn() Line 167 C++
> server.dll!CArwing::Spawn() Line 146 C++
> server.dll!DispatchSpawn(CBaseEntity * pEntity=0x0c46e800) Line
> 1881 C++
> server.dll!SpawnAllEntities(int nEntities=3, HierarchicalSpawn_t *
> pSpawnList=0x16d5da48, bool bActivateEntities=false) Line 270 + 0x9
> bytes C++
> server.dll!SpawnHierarchicalList(int nEntities=3, HierarchicalSpawn_t
> * pSpawnList=0x16d5da48, bool bActivateEntities=false) Line 510 + 0x12
> bytes C++
> server.dll!MapEntity_ParseAllEntities(const char *
> pMapData=0x00000000, IMapEntityFilter * pFilter=0x0018e19c, bool
> bActivateEntities=false) Line 484 + 0x12 bytes C++
> server.dll!CServerGameDLL::LevelInit(const char * pMapName=0x10495548,
> const char * pMapEntities=0x0b84e000, const char * pOldLevel=0x00000000,
> const char * pLandmarkName=0x00000000, bool loadGame=false, bool
> background=false) Line 971 + 0xf bytes C++
> engine.dll!1026a07f()
> engine.dll!101573fa()
> engine.dll!10165b28()
> engine.dll!10166219()
> engine.dll!10166332()
> engine.dll!101af191()
> engine.dll!101ae36e()
> engine.dll!101ae47e()
> engine.dll!1036865e()
> engine.dll!101aeb5e()
> engine.dll!101aec4e()
> launcher.dll!1000c8ee()
> launcher.dll!1000c8ee()
> launcher.dll!10005039()
> KernelBase.dll!772511c4()
> hl2.exe!004011cc()
> ntdll.dll!7776e65f()
> ntdll.dll!77770058()
> ntdll.dll!7776fd0f()
> KernelBase.dll!77250dae()
> ntdll.dll!7775faaa()
> usp10.dll!76726553()
> usp10.dll!76726553()
> hl2.exe!004096aa()
> hl2.exe!004098c7()
> hl2.exe!00406888()
> ntdll.dll!7775fbda()
> kernel32.dll!753a890a()
> ntdll.dll!7775fada()
> ntdll.dll!77779d4c()
> kernel32.dll!753a886b()
> hl2.exe!004093dd()
> hl2.exe!00408938()
> hl2.exe!0040108a()
> hl2.exe!00401847()
> kernel32.dll!753a33ca()
> ntdll.dll!77779ed2()
> ntdll.dll!77779ea5()
>
I thought it may be a debug build bug, so I cleaned and rebuilded in release
but the same thing happened.
here are my method from the call stack, if it's something I've missed :
void CArwing::Spawn( void )
> {
> Precache();
> //SetModel( "models/airboat.mdl" );
> // Setup vehicle as a real-wheels car.
> SetVehicleType( VEHICLE_TYPE_CAR_WHEELS );
> SetCollisionGroup( COLLISION_GROUP_VEHICLE );
> BaseClass::Spawn();
> //m_flMinimumSpeedToEnterExit = LOCK_SPEED;
>
> m_nBulletType = GetAmmoDef()->Index("GaussEnergy");
>
> CAmmoDef *pAmmoDef = GetAmmoDef();
> m_nAmmoType = pAmmoDef->Index("GaussEnergy");
>
> AddSolidFlags( FSOLID_NOT_STANDABLE );
> }
>
void CFighterVehicleDriveable::Spawn( void )
> {
> // Has to be created before Spawn is called (since that causes Precache
> to be called)
> DestroyServerVehicle();
> CreateServerVehicle();
>
> // Initialize our vehicle via script
> //m_pServerVehicle->Initialize( STRING(m_vehicleScript) );
> if ( m_pServerVehicle->Initialize( STRING(m_vehicleScript) ) == false )
> {
> Warning( "Vehicle (%s) unable to properly initialize due to script
> error in (%s)!\n", GetEntityName().ToCStr(), STRING( m_vehicleScript ) );
> SetThink( &CBaseEntity::SUB_Remove );
> SetNextThink( gpGlobals->curtime + 0.1f );
> return;
> }
>
> BaseClass::Spawn();
>
> m_flMinimumSpeedToEnterExit = 0;
> m_takedamage = DAMAGE_EVENTS_ONLY;
> m_bEngineLocked = false;
> }
>
void CPropSFRVehicle::Spawn( )
> {
> CServerFighterVehicle *pServerVehicle =
> dynamic_cast<CServerFighterVehicle*>(GetServerVehicle());
> m_VehiclePhysics.SetOuter( this, pServerVehicle );
>
> // NOTE: The model has to be set before we can spawn vehicle physics
> BaseClass::Spawn();
>
>
> m_VehiclePhysics.Spawn();
> if (!m_VehiclePhysics.Initialize( STRING(m_vehicleScript),
> m_nVehicleType ))
> return;
> SetNextThink( gpGlobals->curtime );
>
> SetCollisionGroup( COLLISION_GROUP_VEHICLE );
>
> m_vecSmoothedVelocity.Init();
> }
>
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders