For posterity's sake, i'll post the fix to my own problem here :) valgrind
wasn't too much help since i couldn't figure out how to interpret its output...
even tho i knew what it meant, i couldn't see why it was saying what it was
saying, such as jumps were based off of uninitialized data, etc... i always
initialize my data except in cases where it's drawing a value directly from a
function, like i won't initialize a MOB_INDEX_DATA if it's going to be used in
a get_mob_index statement or whatnot... anyway, i'd tried to hunt down as many
little allocations of extra memory as i could a while back, and one that i saw
that i thought was a little unnecessary turned out to be the cause of all my
problems :D don't you just love misguided logic? I have a snippet installed for
taking a '$$' entered into an alias and parsing in a target name for it, so
that users don't have to change their aliases as often... down near the bottom
of the parsing function, it caps off the variable it just filled with the
target name, and there's this:
buf[count] = '\0';
return str_dup(buf);
well the function receives the command line as the variable "oldstring" and
then runs through it, searching for the $$'s to parse in the target name, and
by returning a str_dup, i assumed it was just wasting one extra allocation
unit, so i changed it to say this:
buf[count] = '\0';
oldstring = buf;
return oldstring;
so it would just reassign the location oldstring was pointing to, but
unfortunately it reassigned it to a local variable that i guess would just get
overwritten at a later time and would screw everything... i'm not exactly sure
what was happening there, but i switched it back and *poof* my quirky crashes
went away :)
wavewave
Vel.
-----Original Message-----
From: Valnir [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 21, 2004 6:42 PM
To: Richard Lindsey; [email protected]
Subject: Re: More corruption...
Richard,
I almost looks like the pointer to "char *argument" is being
overwritten/destroyed/lost somehow, hence passing a big fat goose egg (or
the like).
- Valnir
----- Original Message -----
From: "Richard Lindsey" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, July 21, 2004 1:21 PM
Subject: More corruption...
A while back, I sent a mail out to the list about my rgObjNest being
corrupted, and I ended up just manually deleting the pfile in question...
I've had a couple of other quirks pop up, such as in pload, a command that
was working fine one day and not the next, it appeared that the argument was
getting trashed when sent to the one_argument function, and it would lead to
a crash... well through some experimentation, and I'm not quite sure why
this worked, but I discovered that if I removed the optimization flag (-O)
from the Makefile, this problem ceased; putting that flag back in place
caused the problem to pop up again... no biggie, sometimes I don't like
optimization in place anyway when I'm trying to debug loops... anyway, now
that optimization *isn't* in place, the problem seems to have crept into
another function (and who knows how many it's affecting that I just haven't
discovered yet)... upon trying to set a stat on myself, it kept popping up
the syntax, so when I typed 'set char' by itself, to echo the syntax of
those fields... *crash*... when I run it in gdb and break at do_set and step
through the first statement, this is the output:
Breakpoint 1, do_set (ch=0x4032f388, argument=0xbfff8dd0 "char") at
act_wiz.c:4131
4131 argument = one_argument(argument,arg);
(gdb) step
one_argument (argument=0xbfff8dd0 "Ð\215ÿ¿à\215ÿ¿", arg_first=0xbfff8de0 "")
at interp.c:943
943 char cEnd;
as you can see, where it breaks at the beginning of do_set,
argument=0xbfff8dd0 "char", so that data is intact... the first step tho,
into one_argument, trashes the argument, and from there it tries to process
that and crashes... this is the same exact thing that was happening to pload
with the -O flag in place for gcc... now that I've removed that flag, it
doesn't affect pload anymore, but now it seems to be affecting do_set... any
ideas what's going on here? This is also on a different server than the
problem had originally popped up on, and yet it's recreatable on either one;
at first I'd suspected corrupted memory modules or something, but on 2
different machines I wouldn't expect that to be the case... help! :)
Richard Lindsey.
--
ROM mailing list
[email protected]
http://www.rom.org/cgi-bin/mailman/listinfo/rom