Jeroen Demeyer on Thu, 12 Feb 2015 20:30:09 +0100

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

PARI_stack_check false positives

Hello pari-dev,

the PARI_stack_limit functionality can sometimes lead to false positives: PARI assumes that the stack is essentially empty when pari_init_opts() is called, that there is only one stack, that getrlimit(RLIMIT_STACK) is constant. These assumptions are not necessarily true.

In particular I received a report from John Cremona who was running Sage in a multi-threaded application. Then each thread has its own stack causing failures in the PARI_stack_limit checking. Note that PARI was not compiled with thread-local storage.

Personally, I think that this stack check should not be enabled by default. I guess the main motivation for this functionality was GP, and you could enable that check just in GP. What do you think?