Ximin Luo on Sun, 05 Feb 2017 19:34:36 +0100


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

Re: Giac for Debian: test suite segfaults with pthread pari


Ximin Luo:
> [..]
> 
> In Debian pari is compiled with pthreads. To make the compilation succeed, we need to patch Giac like this: https://git.archlinux.org/svntogit/community.git/tree/trunk/giac-pari-thread.patch?h=packages/giac
> 
> however I still get segfaults when running Giac's test suite. Stack thread is at the end of this email, but basically I think the reason is that 
> 
> src/kernel/none/level1.h:106
>   if (x > (avma-pari_mainstack->bot) / sizeof(long))
> 
> here pari_mainstack is either NULL or uninitialised. So I guess we need to add some initialisation functions to Giac, to fix this problem. But I'm not familiar with pari, so I don't know what to do here. Any help or guidance would be appreciated.
> 
> [..]

Hi, I think I have figured out how to resolve this issue, it was to do with TLS rather than pthreads. The solution was to fix Giac to call pari_init_opts for every new thread, instead of only once.

In case anyone is interested I have continued the thread with the Giac developers here: http://xcas.e.ujf-grenoble.fr/XCAS/viewtopic.php?f=4&t=1776

X

-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git