Re: Segmentation error in oedit parse(after implementation of races)

From: Welcor (welcor@dune.net)
Date: 09/28/01


----- Original Message -----
From: "Mielikki" <mielikki@EXILEMUD.COM>


<snip>
> Here is the gdb output:
> Program received signal SIGSEGV, Segmentation fault.
> 0x0048b57b in oedit_parse (d=0x48e56b0, arg=0x268fa7c "1") at
> oedit.c:627
>
>
> And here is the function that the problem is said to be in.
>
> void oedit_parse(struct descriptor_data *d, char *arg)
> {
>   int number, max_val, min_val;
>   char *oldtext = NULL;
>
>   switch (OLC_MODE(d)) {        <---[line 627]
>
<snip>

You're getting a seg fault for attempting to derefernce an invalid
pointer. My guess is, that you haven't initialised the descriptors'
'olc' pointer to point to an olc structure (usually happens in oasis.c,
look for the error complaining that one was already present). Thus,
when doing the above switch, you're probably dereferencing a NULL pointer.

Possible ways to fix it:
  1. (Recommended) Make sure you only go into oedit _after_ you've set up
     the olc structure on the descriptor.
  2. Hack (not recommended!): add a check to make sure the char has OLC
     structure, or return to CON_PLAYING (in oedit_parse).
  3. Go through your changes - find anything relating to OLC_* values. Make
     sure it's not causing the problem.
  4. Find your backup files (you _did_ make a backup, right ?). Make sure
     they work as intended. Then reapply the race patch, by hand.

Welcor

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/06/01 PST