.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Re: SWDS.dll Crashes.
Old
  (#11)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: SWDS.dll Crashes. - 21-08-2004

oh ok...

the CBaseStuff is always located behind the edict_s pvPrivateData pointer, right ?

Code:
struct edict_s
{
   qboolean free;
   int serialnumber;
   link_t area; // linked to a division node or leaf
 
   int headnode; // -1 to use normal leaf check
   int num_leafs;
   short leafnums[MAX_ENT_LEAFS];
   float freetime; // sv.time when the object was freed
   void* pvPrivateData; // Alloced and freed by engine, used by DLLs
   entvars_t v; // C exported fields from progs
 
   // other fields from progs come immediately after
};


well wouldn't it be possible that you do it yourself (i.e malloc() some space behind this pointer and zero it out), not forgetting to free it when you set the FL_KILLME flag ?

That would be wasted space, but could probably prevent it to crash.

If you know the address of the entvars struct for that entity, you can safely deduce the address of its pvPrivateData pointer too ( -4 ). I'd investigate there...



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."

Last edited by Pierre-Marie Baty; 21-08-2004 at 16:00..
  
Reply With Quote
Re: SWDS.dll Crashes.
Old
  (#12)
voogru
Guest
 
Status:
Posts: n/a
Default Re: SWDS.dll Crashes. - 21-08-2004

Problem with doing that is the mod might try to access it and think its cbaseentity, when its not.
  
Reply With Quote
Re: SWDS.dll Crashes.
Old
  (#13)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: SWDS.dll Crashes. - 21-08-2004

Im just guessing now..

hmm,
did you set "free" to 1 (in edict_s of entity) ? Does that make it think that its not a valid entity and can be overwritten when making new entities?
  
Reply With Quote
Re: SWDS.dll Crashes.
Old
  (#14)
voogru
Guest
 
Status:
Posts: n/a
Default Re: SWDS.dll Crashes. - 22-08-2004

Quote:
Originally Posted by Cheeseh
Im just guessing now..

hmm,
did you set "free" to 1 (in edict_s of entity) ? Does that make it think that its not a valid entity and can be overwritten when making new entities?
The ents are removed by the engine so I'm assuming that it handles all that (look in the sdk, I never seen free being set anywhere).
  
Reply With Quote
Re: SWDS.dll Crashes.
Old
  (#15)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: SWDS.dll Crashes. - 22-08-2004

Quote:
Originally Posted by voogru
Problem with doing that is the mod might try to access it and think its cbaseentity, when its not.
That's precisely my point. The point is of course not to build a fully featured instance of CBaseEntity by hand, but not to let the mod land on an unitialized pointer. If all the mod does is just checking/setting two or three CBaseEntity member values in this area, it'll read zeroes and set random stuff (which we don't care so far), but at least it won't produce an access violation error, which might be sufficient to prevent it to crash.

Once this runs you can then trace manually to figure out what the mod reads and writes there and you'll understand why it needs this CBaseEntity pointer. You will then be able to provide it with better failsafe mechanisms.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: SWDS.dll Crashes.
Old
  (#16)
voogru
Guest
 
Status:
Posts: n/a
Default Re: SWDS.dll Crashes. - 22-08-2004

Quote:
Originally Posted by Pierre-Marie Baty
That's precisely my point. The point is of course not to build a fully featured instance of CBaseEntity by hand, but not to let the mod land on an unitialized pointer. If all the mod does is just checking/setting two or three CBaseEntity member values in this area, it'll read zeroes and set random stuff (which we don't care so far), but at least it won't produce an access violation error, which might be sufficient to prevent it to crash.

Once this runs you can then trace manually to figure out what the mod reads and writes there and you'll understand why it needs this CBaseEntity pointer. You will then be able to provide it with better failsafe mechanisms.
FYI, With using the create_named_entity function, a CBaseEntity instance is provided (just real basic). Which is currently what I'm doing to prevent the crashes with the mod freaking out, just these swds.dll crashes acting up.

I'm thinking it just might be something with the specific entity (which I have others that dont seem to crash and are used a fair amount of times). So I'm gonna look into that.
  
Reply With Quote
Re: SWDS.dll Crashes.
Old
  (#17)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: SWDS.dll Crashes. - 22-08-2004

I bet it's something stupid like this:

Code:
CEBaseEntity *newhive = new CHive
 newhive = 52
 blah = *newhive
That's my guess.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com