Re: [Newbie]Stats Editor Error

From: Tony Robbins (robbinwa@mailbox.orst.edu)
Date: 09/05/01


From: "Terry Valladon" <tvalladon@EICN.COM>
> Here is more information:
>
> Program received signal SIGSEGV, Segmentation fault.
> 0x80c16d6 in parse_stats (d=0x8134800, arg=0xbfbff604 "") at statedit.c:34
> 34        switch(OLC_MODE(d)) {
>
[snip]
> (gdb) print *d
> $3 = {descriptor = 5, host = "localhost", '\000' <repeats 21 times>,
bad_pws
> = 0 '\000',
>   idle_tics = 0 '\000', connected = 29, desc_num = 3, login_time =
> 999718407, showstr_head = 0x0,
>   showstr_vector = 0x0, showstr_count = 0, showstr_page = 0, str = 0x0,
> backstr = 0x0, max_str = 0,
>   mail_to = 0, has_prompt = 0, inbuf =
> "\000\n\000\000\r\n\0003\r\n\000\r\n", '\000' <repeats 498 times>,
>   last_input = "\000\000use123", '\000' <repeats 247 times>,
>   small_outbuf = "\000\nSelect a class:\r\n  [C]leric\r\n  [T]hief\r\n
> [W]arrior\r\n  [M]agic-user\r\nClass: \000 lib/text/greetings\r\n\r\n", '
'
> <repeats 28 times>, "Based on CircleMUD 3.0,\r\n", ' ' <repeats 28 times>,
> "Created by Jeremy Elson\r\n\r\n", ' ' <repeats 22 times>, "A derivative
of
> "...,
>   output = 0x8134b58 "", history = 0x8155cc0, history_pos = 3, bufptr = 0,
> bufspace = 1023,
>   large_outbuf = 0x0, input = {head = 0x0, tail = 0x8153e30}, character =
> 0x8160800, original = 0x0,
>   snooping = 0x0, snoop_by = 0x0, next = 0x0, olc = 0x0}
[snip]

You were crashing at:

  switch(OLC_MODE(d)) {

So look at the above.  d->olc = 0x0 (or NULL).  Look at what the OLC_MODE
macro is #define'd to.

From there, you'll find that you need to be allocating some memory to the
olc structure, and free'ing it properly.  Basically, you're trying to do
things before you've been prepared to do them.

-k.

--
   +---------------------------------------------------------------+
   | 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