| Iwao KIMURA on Thu, 12 Sep 2002 04:09:41 +0900 (JST) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Re: error recovery |
Hi
From: Karim BELABAS <Karim.Belabas@math.u-psud.fr>
Subject: Re: error recovery (was Re: gp: series bug)
Date: Wed, 11 Sep 2002 04:56:14 +0200 (MEST)
> This does not work well. Assume f1 and f2 use this mechanism,
>
> f1()
> {
> if (!setjmp(buf))
> {
>
> } else {
> f2();
> ...;
> }
> }
>
> f2() overwrites 'buf', returns, and now 'buf' refers to an invalid stack
> environment. At this point, calling pariErrdie crashes the program.
Right. The method I proposed fails miserablly in general
situation. But what I am writing is an another language binding of
Pari library (I wrote small script which generates stub files from
paridecl.h, and found some declared but exit functions because linker
failed).
So I `wrap' the Pari library functions like above, and
never call another function using that mechanism after longjmp()ed.
Anyway thank you very much for detailed description of Error recovery
code. I hope this feature provides generic & robust error recovery,
and documented in Users' manual :-)
Well, it's somewhat off-topic but one more documentation request.
It's nice if binary I/O related functions are documented.
Regards.
;# Iwao KIMURA ;#
;# Faculty. Math, Dept. of Sciece ;#
;# Toyama University, Toyama, Japan;#