cschwan / sage-on-gentoo

(Unofficial) Gentoo Overlay for Sage- and Sage-related ebuilds
84 stars 26 forks source link

sci-mathematics/sage-9.1: avma: TLS definition in /usr/lib64/libpari.so section .tbss mismatches non-TLS reference in /usr/lib64/libec.so #607

Closed WGH- closed 3 years ago

WGH- commented 3 years ago

I had this error when emerging sci-mathematics/sage-9.1-r3 today.

/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: avma: TLS definition in /usr/lib64/libpari.so section .tbss mismatches non-TLS reference in /usr/lib64/libec.so
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib64/libpari.so: error adding symbols: bad value
collect2: error: ld returned 1 exit status

These libraries in question are from:

WGH- commented 3 years ago

My existing sci-mathematics/sage-9.1-r2 crashes on start, though I pretty sure it worked at some point.

/usr/lib64/python3.6/site-packages/sage/rings/real_mpfr.pyx in sage.rings.real_mpfr.RealNumber.__pari__ (/var/tmp/portage/sci-mathematics/sage-9.1-r2/work/sage-9.1/src-python3_6/build/cythonized/sage/rings/real_mpfr.c:22803)()
   3250         cdef int prec
   3251         prec = (<RealField_class>self._parent).__prec
   3252 
   3253         # We round up the precision to the nearest multiple of wordsize.
   3254         cdef int rounded_prec
   3255         rounded_prec = (self.prec() + wordsize - 1) & ~(wordsize - 1)
   3256 
   3257         # Yes, assigning to self works fine, even in Cython.
   3258         if rounded_prec > prec:
   3259             self = RealField(rounded_prec)(self)
   3260 
   3261         cdef mpz_t mantissa
   3262         cdef mp_exp_t exponent
   3263         cdef GEN pari_float
   3264 
-> 3265         sig_on()
        global sig_on = undefined
   3266         if mpfr_zero_p(self.value):
   3267             pari_float = real_0_bit(-rounded_prec)
   3268         else:
   3269             # Now we can extract the mantissa, and it will be normalized
   3270             # (the most significant bit of the most significant word will be 1).
   3271             mpz_init(mantissa)
   3272             exponent = mpfr_get_z_exp(mantissa, self.value)
   3273 
   3274             # Create a PARI REAL
   3275             pari_float = cgetr(2 + rounded_prec / wordsize)
   3276             pari_float[1] = evalexpo(exponent + rounded_prec - 1) + evalsigne(mpfr_sgn(self.value))
   3277             mpz_export(&pari_float[2], NULL, 1, wordsize // 8, 0, 0, mantissa)
   3278             mpz_clear(mantissa)
   3279 
   3280         return new_gen(pari_float)

SignalError: Segmentation fault
kiwifb commented 3 years ago

I recently made some change to the default package.use and enabled threads in pari. It should have triggered a rebuild of all the dependencies of pari including eclib. Can you check that

  1. pari is build with the threads useflags
  2. eclib, giac, cysignals, lcalc and cypari2 have all been rebuilt after pari and before sage
WGH- commented 3 years ago

pari is built with threads, yes. It's hard to say whether I had threads in pari before, since this information isn't preserved in the emerge.log.

I've rebuilt the packages in order you suggested. This didn't fix existing sage, but new version was emerged just fine and is now working.

Thanks!

kiwifb commented 3 years ago

Nothing short of a rebuild would fix sage. I should have advertised the change more broadly. I did the switch because the next major version of giac does require pari with threads to work properly (one test crashes on startup with threadless pari). In effect we probably won't see giac 1.6.0.x in sage before 9.3 since there are unresolved issues with it right now.