[plt-scheme] Re, Windows crash on mouse movement?

From: Toon Verwaest (camden at camden.be)
Date: Fri Nov 26 20:34:22 EST 2004

Ok, you were right about this error :)
Now it doesn't crash on mousemovement anymore, only when I
try to Run actually run a second pico-program. So I just
open a second window, enter 5 in evaluation and press enter,
and DrScheme crashes out on me.

Any other suggestions? :)
Think I'll just try another compiler. I hope that will work.
It appears to work in Linux AND MacOS, so it appears...

Greetz.
t

On (27/11/04 01:44), Toon Verwaest wrote:
> From: Toon Verwaest <camden at camden.be>
> To: Matthew Flatt <mflatt at cs.utah.edu>
> Subject: Re: [plt-scheme] Re, Windows crash on mouse movement?
> Date: Sat, 27 Nov 2004 01:44:47 +0100
> 
> Thanks for searching the problem and the reply. I think I'll start 
> by compiling the program with the scheme_* to begin with, so I can
> already spread the .plt package for windows. Then I will try
> to compile the program with another compiler like gcc... Maybe that
> will work. If that fails..... Maybe the c-thread-stuff :) Using
> the scheme_* stuff indeed seems kinda dirty to me (also because 
> we probably also want to use this code to connect pico-2 and soon
> pico-3 with drscheme, and if we always have to change the code...)
> 
> Anyway. Thanks again.
> 
> Toon
> 
> On (26/11/04 15:07), Matthew Flatt wrote:
> > From: Matthew Flatt <mflatt at cs.utah.edu>
> > To: Toon Verwaest <camden at camden.be>
> > Cc: PLT Scheme <plt-scheme at list.cs.brown.edu>
> > Subject: Re: [plt-scheme] Re, Windows crash on mouse movement?
> > Date: Fri, 26 Nov 2004 15:07:26 -0700
> > 
> >   For list-related administrative tasks:
> >   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> > 
> > At Tue, 23 Nov 2004 23:30:51 +0100, Toon Verwaest wrote:
> > > again I ask if maybe anyone of you knows how to solve
> > > my problem in windows? (DrScheme crashing when you move
> > > the mouse during pico-evaluation)
> > 
> > It looks like the problem is related to setjmp() and longjmp().
> > 
> > Setjmp() and longjmp() in Windows (or it is MSVC?) get confused by the
> > games that MzScheme plays with the C stack.
> > 
> > So MzScheme avoids usual setjmp() and longjmp() under Windows, and
> > instead uses its own scheme_setjmp() and scheme_longjmp() (which are
> > implemented in assembly).
> > 
> > It looks like setjmp() and longjmp() get confused even when used on a
> > portion of the stack that MzScheme isn't manipulating, such as the C
> > stack used by the Pico interpreter. Presumably, setjmp() or longjmp()
> > is looking for something at the stack base, and it isn't there, because
> > MzScheme has overwritten it.
> > 
> > Replacing setjmp() and longjmp() in the Pico code with scheme_setjmp()
> > and scheme_longjmp() does solve the problem. (Technically,
> > scheme_setjmp() wants a mz_pre_jmp_buf instead of a jmp_buf, but the
> > latter is reliably at least as large as the former.) Probably you don't
> > want to pollute the Pico code with something MzScheme-specific, but
> > something like that may work for you.
> > 
> > Another solution would be to run the Pico interpreter in a different
> > Windows thread, (i.e., a thread with a stack that is safe from
> > MzScheme's games).
> > 
> > Matthew
> > 
> > 


Posted on the users mailing list.