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

Re: safe eval



Thank you Matthew,

You are right, I did not call scheme_register_static on the 3 globals.
You mentioned that it may not be able to write to stderr, which I suspected
so but tested it out with

int r = fprintf (stderr, "foo");
fprintf() should return the number of bytes written or negative if it
failed.
I got 3 which is right.  Admittedly, who knows where does stderr go in
Windows.
I wonder how MzScheme arrived at the error (I could look at the source, I
know, but it looks like way beyond me.)

I am pretty confused about scheme_eval_string() and
scheme_eval_string_all().
The docs says that for the latter if the "all" flag is not 0 then the string
will be read and evaluated until the end of the string.  Isn't that supposed
to be the case anyway?

Would appreciate any pointers.

Actually, it's been working very well!
I should have a working product pretty soon, thanks to MzScheme.

Thanks again.

wil

----- Original Message -----
From: "Matthew Flatt" <mflatt@cs.utah.edu>
To: "wil at home" <wil@dready.org>
Cc: <plt-scheme@fast.cs.utah.edu>
Sent: Friday, April 27, 2001 9:15 PM
Subject: Re: safe eval


> Quoting "wil at home":
> > At this point my "scheme_console_output" hook is called with the
following
> > string
> > "error trying to display error: exception raised:\n", int len=50
> > The call stack is attached.
>
> Probably you want to set up a stderr port, too (by setting
> scheme_make_stderr). It looks like the error-while-displaying-error is
> from not being able to write to stderr.
>
> Meanwhile, the actual error seems to be that a non-procedure was
> applied. Since you mention random crashes, I'd guess that some
> procedure is being GCed when it shouldn't be (so the GC turns a
> procedure into a nothing).
>
> In particular, since you're embedding in a Windows app, did you set
> GC_use_registered_statics to 1? And if so, did you register the static
> variable `exn_catching_apply' (copied from oe.c)?
>
> If I'm not on the right track, perhaps you can say more about your
> embedding of MzScheme (e.g., whether Jabber is multi-threaded).
>
> Matthew
>