Bill Allombert on Fri, 23 Jun 2006 22:36:55 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: PARI_stack_limit |
On Fri, Jun 23, 2006 at 09:58:03AM +0200, Bernard Parisse wrote: > Hello, > > I have a problem when using flisexpr inside a threaded program > (more precisely I'm adding a pari command to xcas that should be able > to execute any PARI command inside xcas, e.g. pari(Euler)), > it seems related to the PARI_stack_limit check in src/language/anal.c, > line 1959. The &ptr (in a thread call) is (much) lower than PARI_stack_limit > and PARI dies with a Deep recursion error (the same code inside > the readline non-threaded interface icas works correctly). I guess > this check is here to avoid user recursive calls that end with > a SEGFAULT (stack capacity exceeded). > My current fix was to > 1/ declare PARI_stack_limit in src/headers/paridecl.h > 2/ set PARI_stack_limit to 0 in xcas code before calling flisexpr > (more precisely in the file src/pari.cc from giac-0.6.0.tar.gz) > It works but it requires modification in the pari library to build > xcas. Is there another way to do it? Sure, just declare extern void *PARI_stack_limit; in xcas source files. Adding PARI_stack_limit in src/headers/paridecl.h do not change the libpari in any way. Cheers, Bill. P.S. Expect a better answer later on.