mit-scheme-devel
[Top][All Lists]
Advanced

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

[MIT-Scheme-devel] profiling and bugs in stack parser


From: Taylor R Campbell
Subject: [MIT-Scheme-devel] profiling and bugs in stack parser
Date: Thu, 10 Dec 2009 02:01:25 -0500
User-agent: IMAIL/1.21; Edwin/3.116; MIT-Scheme/7.7.90.+

Today I implemented a rudimentary statistical profiler for MIT Scheme.
In the process, I found a bug in the stack parser whereby it would
fail to parse stack frames that occur in the infrequent situation of
interrupting an internal compiled procedure that LIAR compiled with a
dynamic link; of course, while it is unlikely for a human to type C-c
C-b at precisely the right time, a statistical profiler sampling every
millisecond is quite likely to do that.  I have thrown together two
responses to this bug, one of them a workaround and one of them an
attempt at a fix.

The statistical profiler is at

<http://mumble.net/~campbell/scheme/mit-profile.scm>,

with brief instructions on its use at the top.  I have attached two
patches to this message: one that works around the problem, but which
causes the stack parser and thus the profiler to generate less useful
information; and one that attempts to fix the problem kludgily by
parsing two stack frames at once based on a guess about how the
dynamic link stored in a COMPILER-INTERRUPT-RESTART continuation is
interpreted, but which is complicated enough that I am hesitant to
call this a fix with certainty.

If you want to use the profiler, you need to apply either one of these
patches before the profiler will work on pretty much any code that has
internal procedures which LIAR decides to compile with dynamic links,
which, though rare, do turn up from time to time (e.g., in the
runtime's merge-sort implementation).

Comments, on the profiler or on the stack parser hacks?

Attachment: dlink-workaround.patch
Description: Text document

Attachment: dlink-fix.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]