MOO-cows Mailing List Archive

[Prev][Next][Index][Thread]

Re: 1.8p2 weirdness...



Andrew Wilson writes:
>     http://www.cm.cf.ac.uk/User/Andrew.Wilson/JHCore.db-20Apr1995.db.new
> is a JHCore that grew from 4Mb to 12Mb process size (2Mb to 3Mb
> compressed), in the space of about 2 minutes, on its own.

Here's what I was able to track down.  I ran this DB under 1.8.0p2 with the
force_input() patch applied.  It pegged my CPU and, indeed, kept on growing and
growing.  After a while, I attached a debugger to it and found that it was in
the following task:

Mar 21 13:41:33: #51:suspend_if_needed, line 10:  foo
Mar 21 13:41:33: ... called from #30:to_jtext (this == #55), line 39
Mar 21 13:41:33: ... called from #30:get_topic (this == #55), line 12
Mar 21 13:41:33: ... called from #30:forward pass unpass (this == #55), line 9
Mar 21 13:41:33: ... called from #30:get_topic (this == #55), line 9
Mar 21 13:41:33: ... called from #210:send_to, line 10
Mar 21 13:41:33: ... called from #128:send_me, line 5
Mar 21 13:41:33: ... called from #6:receive_document (this == #221), line 19
Mar 21 13:41:33: ... called from #6:help ?* (this == #221), line 51
Mar 21 13:41:33: (End of traceback)

Here's the code it was running for #30:to_jtext (which, of course, might not be
the current text of that verb, since this is a long-running BG task):
-------------------------------------------------------------------------------
"to_jtext(text, topic)";
"Convert help text to jtext.";
"Doesn't handle lots and lots of things.";
"If it can't figure out how to be smart, it resorts to a plaintext tag.";
"Doesn't make a vgroup, just returns a list of vboxes with no title or header.";
flat = text = args[1];
topic = args[2];
if (typeof(flat) == STR)
  return {{$jtext.paragraph, flat}};
elseif (typeof(flat) != LIST || (flat && typeof(flat[1]) == LIST))
  return flat;
endif
new = {};
while (flat)
  if (length(flat) == 1 || flat[2] == "")
    if (match(line = flat[1], "^---------------------*$"))
      new = {@new, {$jtext.hr}};
    elseif (match(line, "^ *%(Usage%|Syntax%): "))
      new = {@new, {$jtext.plaintext, line}};
    else
      player:tell("line = '", line, "'");
      new = {@new, {$jtext.paragraph, @this:line_to_hboxes(line)}};
    endif
    flat[1..2] = {};
  else
    if (blank = "" in flat)
      section = flat[1..blank - 1];
      if (0)
        flat = flat[blank + 1..length(flat)];
      else
        flat = flat[blank..length(flat)];
      endif
    else
      section = flat;
      flat = {};
    endif
    new = {@new, this:plaintext_or_dlist(section, topic)};
  endif
  $command_utils:suspend_if_needed(0);
endwhile
return new;
-------------------------------------------------------------------------------

At the time I stopped it, the value of `flat' was this:

	{"", "", "characters -- setting characteristics of yourself",
	 "movement -- moving yourself between rooms",
	 "communication -- communicating with other players",
	 "manipulation -- moving or using other objects",
	 "miscellaneous -- commands that don't fit anywhere else", "",
	 "building -- extending the MOO",
	 "programming -- writing code in the MOO programming language",
	 "editors -- editing text and code in the MOO", "",
	 "@options -- customizing your MOO environment",
	 "@pagelength -- what to do if lines scroll off your screen too fast",
	 "@linelength -- what to do if lines are truncated"}

If you trace through this code, you'll see that, when `flat[1]' is "", this
loop makes no progress in reducing the length of `flat', while it grows `new'
every time around.  At the time I stopped the task, `new' was 99,835 elements
and growing.

This sufficiently explains the observed behavior that I won't be looking any
further into this.

	Pavel


Follow-Ups: References:

Home | Subject Index | Thread Index