[plt-scheme] Apparent continuation bug

From: Don Felgar (dfelgar at rainier-infosys.com)
Date: Mon Aug 11 11:12:46 EDT 2003

I just re-read this, and I apologize for a mistake and the lack of
clarity here.  I was in too much of a hurry.  I've indicated my
mistake below.

Let me try again.  As part of its production of response R1, my
servlet forms a string, S.  Then, when producing R2, the servlet
happens to re-creates S.  If S is part of R2, then two continuations
run in succession.  Adding the literal string S to the response is
enough to trigger the bug.  S with a space prepended similarly
triggers the bug.  S with "foo" prepended does *not* trigger the bug.

I hope this is clearer.


On Thu, Aug 07, 2003, Don Felgar wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> I've found a mzscheme bug that occurs only if I output a particular
> string from within a servlet.  Never mind for a moment what this
> particular string is and call it str.  If I go through a particular
> series of steps in my application, then output (string-append "foo"
> str), 

That last phrase should have read, "then output str".  By output I
mean, include in a servlet response.

> a previously-stored servlet continuation launches after the
> completion of the current continuation.  This happens in such a way
> that the the browser never gets the original, correct page; it
> displays only the second, erroneous page.  A previous step in the
> application determines exactly what the magic string str is to be.
> Fortunately or not, I ran across a bug with the same look and feel
> once before.  I was writing guile scheme webapp code which used Oleg
> Kiselyov's SXML XML implementation.  Part of SXML is a common header
> file that contains cout and cerr, which I find to be usually less
> effort than the display/format combination.  Both cerr and cout invoke
> anything that answers to procedure? -- including continuations.  So
> they can produce interesting results when debugging continuation code.
> My guess is that this mzscheme problem is caused by tweaking a string
> that is folded between two continuations, thereby causing the wrong
> continuation to launch.  A good way to ascertain this is a quirk in
> the behavior I see: I see the bug when outputting (string-append "foo"
> str) but not (string-append " " str).
> I was able to work around this problem the first time, but now I'm
> seeing it again in a place where I can't so easily work around it.
> I've got an important deadline coming up, so I'll be very grateful if
> you someone can address this sooner rather than later.
> Incidentally my application code would take the better part of a
> morning to install, and I've been unable to duplicate the problem with
> less code for an unknown reason.  I'd be happy to download and test a
> patch if someone can make an attempt to fix the problem.  On the other
> hand I can spend some time helping someone set up the application if
> necessary.
> I'm using PLT 203 on i386 Debian.
> Thanks,
> Don

Posted on the users mailing list.