So, I'm getting a crash on only two maps, one being jrdm2 "Foot Massage".
It spits out a "ED_LoadFromFile: found %s when expecting {", although running through the debugger i get no error, yet running the /debug/glQrack.exe from there i do.
Is there a particular place i should be double checking, if com_token is getting stomped on? Or an easier way to find this bug other than diff'ing 100 lines of code?
It seems this bug crept in way back into v1.90 from 2011, with the last non bugged version at 1.85, which i cant even run on windows 10
ED_LoadFromFile ie Needle in the Haystack
Re: ED_LoadFromFile ie Needle in the Haystack
make sure you're not triggering a stack overflow or anything.
(try setting msvc's c/c++->code generation->basic type checks to both, or run it in valgrind, or both)
by using an over-long field name, a map could get a nice stack overflow exploit. com_parse can also overflow com_token, which would give a nice large block of memory at a known location... it'd be pretty easy, if you know your asm well enough to avoid nulls.
Print out the stuff you've parsed so far (pipe the output of your engine through cat or to a file and you should be able to see any stdout printed via con_printf->sys_printf->printf even in windows). check which part of the file it reached and if that part of the file has any weird chars or over-long tokens or anything weird like that.
(try setting msvc's c/c++->code generation->basic type checks to both, or run it in valgrind, or both)
by using an over-long field name, a map could get a nice stack overflow exploit. com_parse can also overflow com_token, which would give a nice large block of memory at a known location... it'd be pretty easy, if you know your asm well enough to avoid nulls.
Print out the stuff you've parsed so far (pipe the output of your engine through cat or to a file and you should be able to see any stdout printed via con_printf->sys_printf->printf even in windows). check which part of the file it reached and if that part of the file has any weird chars or over-long tokens or anything weird like that.
Re: ED_LoadFromFile ie Needle in the Haystack
Thanks for the quick reply and insight.
Its been many moons since i've done any work on the engine and as a hobbiest code monkey i hate leaving bugs unattended
Its been many moons since i've done any work on the engine and as a hobbiest code monkey i hate leaving bugs unattended
Re: ED_LoadFromFile ie Needle in the Haystack
ya i did a con_printf and after each {...} there was some wonky chars, i assume were comments or some junk from the compiler of that time.
i just added
and the map loads now.
is there any side effect of doing this??
i just added
Code: Select all
if (com_token[0] != '{')
{
com_token[0] = 0;
// Host_Error ("ED_LoadFromFile: found %s when expecting {",com_token);
}
is there any side effect of doing this??
Re: ED_LoadFromFile ie Needle in the Haystack
edit:
wait somehow i ran the =wrong exe, that didnt help.
side note: this forum has no edit button.
i guess we are engraving into marble...
wait somehow i ran the =wrong exe, that didnt help.
side note: this forum has no edit button.
i guess we are engraving into marble...
Re: ED_LoadFromFile ie Needle in the Haystack
hmm man coding after 2am and 2many beers
i guess this works,
dunno dont care, hehe!
i guess this works,
Code: Select all
if (com_token[0] != '{')
{
com_token[0] = 0;
continue;
}