![]() |
Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
Well I really need help with this bug...
If anyone know how to debug good maybe he can help... or if anyone knows what else might be causing this error... it could be a lot of help if you guys tell us your configurations and all.. I know absolutely that the bots do not crash on de_dust or awp_map on my computers... btw what version source code did you use? |
Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
How many people are you putting in the game. It seems for me the more people I put into a game the faster it will crash. Per say a game with 6 bots will probly play for 5 mins and a game with 20 bots will crash in 25 seconds.
This may or may not help but i hope it does |
Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
sPlO, instead of putting your checks in pfnIndexOfEntOffset() and the likes, just #undef the INDEXENT and ENTINDEX macros and redefine them with your check included.
If you want to FIX that bug (and not PATCH it), instead of just returning from ENTINDEX when the pointer is NULL, provoke a crash here (by a zero divide, for example). This way when Windows will crash, you can click on "Debug" and the debugger will kick in right at the spot where ENTINDEX was called. |
Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
Gentlemen,
The "NUM_FOR_EDICT" error also happens on my linux Cs 1.5 server. Hopefully this helps in the debug on the error: Server Name: Test Server Server IP : 172.21.10.175:27015 Mod : cstrike Map : de_vegas Last 5 lines in hlds_l.log are: ---------------------------------------------------------------------- Visibility Table out of Date. Rebuilding... (47%) Visibility Table out of Date. Rebuilding... (53%) Visibility Table out of Date. Rebuilding... (58%) L 05/13/2004 - 13:25:52: FATAL ERROR (shutting down): NUM_FOR_EDICT: bad pointer FATAL ERROR (shutting down): NUM_FOR_EDICT: bad pointer -Dethpod |
Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
NO F*ING WAY!!! :(
I put a divide by zero into those 2 functions... and guess what... it didn't work.. it just goes through as if those 2 functions aren't causing this crash.... What I had in the ENTINDEX and INDEXENT functions were: Code:
if (FNullEnt (pEdict)) 1/0; it just gives me the error message.. and shuts down itself... it doesn't crash at the divide by zero part... We probably need someone who knows a lot about where NUM_FOR_EDICT is called :( [edit] searched around on google and found out that this error can also happen if the number of entity slots are full... which can be caused by maps... and I'm guessing that cs_office probably uses a LOT of entities... maybe somehow lower the entity usage of the bot? (probably impossible) [/edit] |
Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
I'm not sure the code you posted actually crashes. IMO it's not executed at all because you don't assign the final value of the computation to a variable. So the compile-time optimization just scraps it and doesn't even include the "if" that's just before.
You must assign your value to a variable. I have a function that I call in my bot code when I want to crash voluntarily the game at some point. Code:
void TerminateOnError (const char *fmt, ...) If it does perhaps FNullEnt fails to determine the entity pointer is bad. Every entity is supposed to have a classname. So try doing Code:
if (STRING (pEdict->v.classname)[0] == 0) |
Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
actually what i did was this...
Code:
int bleh () { return 0; } Did that to stop MSVC from complaining... so annoying... [edit] okay now my ENTINDEX and INDEXENT functions look like this.. Code:
inline int ENTINDEX(edict_t *pEdict) { if (STRING (pEdict->v.classname)[0] == 0); return (*g_engfuncs.pfnIndexOfEdict)(pEdict); } I'm really starting to think that these 2 functions aren't causing it.. [/edit] |
Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
PMB, does it mean that the optimization flags in makefile can causing some code corrupion and thus increasing the ability of the bug we discuss here?
|
Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
nope it doesn't...
I've compiled it in debug, maximum speed, and minimum size. makes no difference. |
Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
@KaszpiR: no, but if you do
if (condition) a / b; the result of a / b isn't fed into any variable, hence the computation is intrinsically useless for the program, hence the if condition is useless too. And I wouldn't be surprised that any decent optimizer just drops it from the code. @Splo: change inline int ENTINDEX(edict_t *pEdict) { if (STRING (pEdict->v.classname)[0] == 0); return (*g_engfuncs.pfnIndexOfEdict)(pEdict); } to inline int ENTINDEX(edict_t *pEdict) { if (STRING (pEdict->v.classname)[0] == 0) blah=1/bleh(); return (*g_engfuncs.pfnIndexOfEdict)(pEdict); } And since 0 divided by anything oughta be 0, I'm not sure the optimizer doesn't even execute this: if (iEdictNum == 0) iEdictNum /= iEdictNum; Same problem. MAKE SURE your code will be executed. When you say it doesn't make it crash, the point is not to MAKE it crash or not, the point is to land into the debugger when it does (because it does crash already). |
All times are GMT +2. The time now is 08:22. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.