chk_cas hangs on armv7 hard-float (Debian armhf)

Librairie C++ de calcul formel/ C++ symbolic computation library

Modérateur : xcasadmin

infinity0
Messages : 36
Inscription : dim. févr. 05, 2017 5:46 pm

chk_cas hangs on armv7 hard-float (Debian armhf)

Message par infinity0 » sam. août 04, 2018 6:52 am

https://buildd.debian.org/status/fetch. ... 6974&raw=0

Code : Tout sélectionner

PASS: chk_partfrac
PASS: chk_factor
PASS: chk_geo
PASS: chk_limit
PASS: chk_integrate
PASS: chk_fhan3
PASS: chk_fhan2
PASS: chk_xavier
PASS: chk_morley_demo
PASS: chk_fhan0
PASS: chk_fhan5
PASS: chk_fhan12
PASS: chk_fhan13
PASS: chk_fhan6
PASS: chk_fhan14
PASS: chk_fhan15
PASS: chk_fhan17
PASS: chk_fhan16
PASS: chk_fhan19
PASS: chk_fhan20
PASS: chk_fhan21
PASS: chk_fhan18
PASS: chk_fhan8
PASS: chk_fhan7
PASS: chk_fhan4
PASS: chk_normalize
PASS: chk_fhan11
PASS: chk_fhan1
PASS: chk_fhan9
E: Build killed with signal TERM after 150 minutes of inactivity
chk_cas is the only one missing from the PASS list, so assuming this is the one that hangs

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: chk_cas hangs on armv7 hard-float (Debian armhf)

Message par parisse » dim. août 05, 2018 8:08 pm

That's really strange, because I usually don't have problems with chk_cas. On ARM architectures, I got sometimes erratic behavior, for example one check hangs, then it runs correctly a few seconds later. What happens if you run chk_cas a few times? Does it always hang? Is it always at the same command?

infinity0
Messages : 36
Inscription : dim. févr. 05, 2017 5:46 pm

Re: chk_cas hangs on armv7 hard-float (Debian armhf)

Message par infinity0 » mar. août 07, 2018 7:09 am

It sometimes runs successfully, but usually hangs. When it hangs and I press ctrl-C, it then segfaults.

The hang occurs usually when calculating factor(x^4+1,exp(i*pi/4)); near the bottom of testcas - I see the answer to the previous line simplify(det(B)); but not factor(..).

However sometimes it will calculate that but then hang calculating an answer to the next line factor(x^4+1,exp(i*pi/4)+1);.

I also see PARI stack warnings:

Code : Tout sélectionner

  ***   Warning: not enough memory, new PARI stack 536870912
  ***   Warning: not enough memory, new PARI stack 268435456
  ***   Warning: not enough memory, new PARI stack 134217728
  ***   Warning: not enough memory, new PARI stack 67108864
  ***   Warning: not enough memory, new PARI stack 33554432

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: chk_cas hangs on armv7 hard-float (Debian armhf)

Message par parisse » mar. août 07, 2018 8:07 pm

I really do not know what I can do to fix that : I do not have access to the hardware and the bug is not reproducible on x86 hardware I have access to, I tried to run the factorization command 100 times with valgrind without detecting problems (see log below).
Maybe there is a problem with PARI nffactor code, does it still hang if you compile giac without PARI ?

Code : Tout sélectionner

==1124== Memcheck, a memory error detector
==1124== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==1124== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==1124== Command: ./icas bug
==1124== 
// Using locale /usr/local/share/locale/
// fr_FR.UTF-8
// /usr/local/share/locale/
// giac
// UTF-8
// Maximum number of parallel threads 2
// Giac share root-directory:/usr/local/share/giac/
// Giac share root-directory:/usr/local/share/giac/
Help file /usr/local/share/giac/doc/fr/aide_cas not found
Added 0 synonyms
// Giac share root-directory:/usr/local/share/giac/
==1124== Warning: set address range perms: large range [0x3959d000, 0x7959d000) (defined)
(x+(1-i)/sqrt(2))*(x+(1+i)/sqrt(2))*(x+(-1-i)/sqrt(2))*(x+(-1+i)/sqrt(2))
(x+(1-i)/sqrt(2))*(x+(1+i)/sqrt(2))*(x+(-1-i)/sqrt(2))*(x+(-1+i)/sqrt(2))
(x+(1-i)/sqrt(2))*(x+(1+i)/sqrt(2))*(x+(-1-i)/sqrt(2))*(x+(-1+i)/sqrt(2))
(x+(1-i)/sqrt(2))*(x+(1+i)/sqrt(2))*(x+(-1-i)/sqrt(2))*(x+(-1+i)/sqrt(2))
(x+(1-i)/sqrt(2))*(x+(1+i)/sqrt(2))*(x+(-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i)/sqrt(2))*(x+(-1-i)/sqrt(2))*(x+(-1+i)/sqrt(2))
(x+(1-i)/sqrt(2))*(x+(1+i)/sqrt(2))*(x+(-1-i)/sqrt(2))*(x+(-1+i)/sqrt(2))
(x+(1-i)/sqrt(2))*(x+(1+i)/sqrt(2))*(x+(-1-i)/sqrt(2))*(x+(-1+i)/sqrt(2))
(x+(1-i)/sqrt(2))*(x+(1+i)/sqrt(2))*(x+(-1-i)/sqrt(2))*(x+(-1+i)/sqrt(2))
(x+(1-i)/sqrt(2))*(x+(1+i)/sqrt(2))*(x+(-1-i)/sqrt(2))*(x+(-1+i)/sqrt(2))
(x+(1-i)/sqrt(2))*(x+(1+i)/sqrt(2))*(x+(-1-i)/sqrt(2))*(x+(-1+i)/sqrt(2))
(x+(1-i)/sqrt(2))*(x+(1+i)/sqrt(2))*(x+(-1-i)/sqrt(2))*(x+(-1+i)/sqrt(2))
(x+(1-i)/sqrt(2))*(x+(1+i)/sqrt(2))*(x+(-1-i)/sqrt(2))*(x+(-1+i)/sqrt(2))

Evaluation time: 70.91
0
// Time 71.12
// Total time 71.13
==1124== 
==1124== HEAP SUMMARY:
==1124==     in use at exit: 2,180,099 bytes in 1,142 blocks
==1124==   total heap usage: 2,227,096 allocs, 2,225,954 frees, 110,238,853 bytes allocated
==1124== 
==1124== 27 bytes in 1 blocks are possibly lost in loss record 70 of 254
==1124==    at 0x4C286E7: operator new(unsigned long) (vg_replace_malloc.c:287)
==1124==    by 0x93E7CC8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (new_allocator.h:104)
==1124==    by 0x93E8AAA: std::string::_Rep::_M_clone(std::allocator<char> const&, unsigned long) (basic_string.tcc:1073)
==1124==    by 0x93E8B53: std::string::reserve(unsigned long) (basic_string.tcc:954)
==1124==    by 0x93E8DC2: std::string::append(char const*, unsigned long) (basic_string.tcc:752)
==1124==    by 0x43975F: std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, char const*) (basic_string.h:2202)
==1124==    by 0xC98015: giac::xcasroot_dir(char const*) (help.cc:1050)
==1124==    by 0x11DF561: main (icas.cc:892)
==1124== 
==1124== 45 (16 direct, 29 indirect) bytes in 1 blocks are definitely lost in loss record 102 of 254
==1124==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==1124==    by 0x789C87F: XCreateFontSet (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==1124==    by 0x124963A: fl_new_ic() (Fl_x.cxx:385)
==1124==    by 0x1249C45: fl_init_xim() (Fl_x.cxx:564)
==1124==    by 0x124A182: fl_open_display(_XDisplay*) (Fl_x.cxx:644)
==1124==    by 0x1249D81: fl_open_display() (Fl_x.cxx:596)
==1124==    by 0x11EF420: Fl_Gl_Choice::find(int, int const*) (Fl_Gl_Choice.cxx:110)
==1124==    by 0x11EF0F5: Fl::gl_visual(int, int*) (gl_start.cxx:113)
==1124==    by 0x11DF5DF: main (icas.cc:905)
==1124== 
==1124== 49 bytes in 1 blocks are possibly lost in loss record 108 of 254
==1124==    at 0x4C286E7: operator new(unsigned long) (vg_replace_malloc.c:287)
==1124==    by 0x93E7CC8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (new_allocator.h:104)
==1124==    by 0x93E7F9A: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (basic_string.tcc:923)
==1124==    by 0x93E85BD: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (basic_string.tcc:1128)
==1124==    by 0x4EC604: xcas::objet_bidon::objet_bidon() (Graph.cc:248)
==1124==    by 0x4BFE52: __static_initialization_and_destruction_0(int, int) (Tableur.cc:66)
==1124==    by 0x4C04C7: global constructors keyed to _ZN4xcas23mon_objet_bidon_tableurE (Tableur.cc:3653)
==1124==    by 0x187933C: __libc_csu_init (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x9B63E3F: (below main) (libc-start.c:203)
==1124== 
==1124== 56 bytes in 1 blocks are possibly lost in loss record 114 of 254
==1124==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==1124==    by 0x14C5C80: newblock (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x14C68E7: gclone (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x143C8F1: constpi (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x143C9E5: mppi (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x13FD14B: factor_bound (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x13FDAD5: DDF (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x13FF2F1: ZX_DDF (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x13FF468: ZX_factor (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x13B2D46: nffactor (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0xE5769A: giac::pari_nffactor(giac::gen const&, giac::gen const&, giac::dbgprint_vector<giac::gen> const&, giac::gen&, giac::context const*) (pari.cc:1140)
==1124==    by 0x5F6523: giac::ext_factor(giac::tensor<giac::gen> const&, giac::gen const&, giac::gen&, giac::tensor<giac::gen>&, std::vector<giac::facteur<giac::tensor<giac::gen> >, std::allocator<giac::facteur<giac::tensor<giac::gen> > > >&, bool, giac::gen&) (gausspol.cc:5728)
==1124== 
==1124== 64 bytes in 1 blocks are possibly lost in loss record 148 of 254
==1124==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==1124==    by 0x14C5C80: newblock (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x143F0AE: constlog2 (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x143F225: mplog2 (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x143FE09: logr_abs (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x143BD05: trans_eval (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x13FDBF7: DDF (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x13FF2F1: ZX_DDF (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x13FF468: ZX_factor (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x13B2D46: nffactor (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0xE5769A: giac::pari_nffactor(giac::gen const&, giac::gen const&, giac::dbgprint_vector<giac::gen> const&, giac::gen&, giac::context const*) (pari.cc:1140)
==1124==    by 0x5F6523: giac::ext_factor(giac::tensor<giac::gen> const&, giac::gen const&, giac::gen&, giac::tensor<giac::gen>&, std::vector<giac::facteur<giac::tensor<giac::gen> >, std::allocator<giac::facteur<giac::tensor<giac::gen> > > >&, bool, giac::gen&) (gausspol.cc:5728)
==1124== 
==1124== 640 bytes in 1 blocks are definitely lost in loss record 205 of 254
==1124==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==1124==    by 0x78B6A65: XGetVisualInfo (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==1124==    by 0x124A150: fl_open_display(_XDisplay*) (Fl_x.cxx:642)
==1124==    by 0x1249D81: fl_open_display() (Fl_x.cxx:596)
==1124==    by 0x11EF420: Fl_Gl_Choice::find(int, int const*) (Fl_Gl_Choice.cxx:110)
==1124==    by 0x11EF0F5: Fl::gl_visual(int, int*) (gl_start.cxx:113)
==1124==    by 0x11DF5DF: main (icas.cc:905)
==1124== 
==1124== 640 bytes in 1 blocks are definitely lost in loss record 206 of 254
==1124==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==1124==    by 0x78B6A65: XGetVisualInfo (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==1124==    by 0x6CB3E03: ??? (in /usr/lib/x86_64-linux-gnu/libGL.so.1.5.08005)
==1124==    by 0x6CB5F2B: ??? (in /usr/lib/x86_64-linux-gnu/libGL.so.1.5.08005)
==1124==    by 0x6CB60BE: ??? (in /usr/lib/x86_64-linux-gnu/libGL.so.1.5.08005)
==1124==    by 0x11EF43B: Fl_Gl_Choice::find(int, int const*) (Fl_Gl_Choice.cxx:111)
==1124==    by 0x11EF0F5: Fl::gl_visual(int, int*) (gl_start.cxx:113)
==1124==    by 0x11DF5DF: main (icas.cc:905)
==1124== 
==1124== 28,808 bytes in 1 blocks are possibly lost in loss record 247 of 254
==1124==    at 0x4C28147: operator new[](unsigned long) (vg_replace_malloc.c:348)
==1124==    by 0xC294BF: giac::builtin_lexer_functions() (global.cc:6682)
==1124==    by 0xC29582: giac::builtin_lexer_functions_begin() (global.cc:6689)
==1124==    by 0xC1F69C: giac::lexer_functions_register(giac::unary_function_ptr const&, char const*, int) (global.cc:5480)
==1124==    by 0x11D53A3: giac::unary_function_ptr::unary_function_ptr(giac::unary_function_abstract const*, int, int) (unary.cc:134)
==1124==    by 0x5B426C: __static_initialization_and_destruction_0(int, int) (sym2poly.cc:174)
==1124==    by 0x5B456C: global constructors keyed to _ZN4giac8dbgprintERKNS_6tensorINS_3genEEE (sym2poly.cc:4142)
==1124==    by 0x187933C: __libc_csu_init (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x9B63E3F: (below main) (libc-start.c:203)
==1124== 
==1124== 524,296 bytes in 1 blocks are possibly lost in loss record 254 of 254
==1124==    at 0x4C28BED: malloc (vg_replace_malloc.c:263)
==1124==    by 0x14879BE: pari_var_init (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0x14C6228: pari_init_opts (in /home/parisse/giac-1.4.9/src/icas)
==1124==    by 0xE4FD4D: giac::do_giac_pari_init(long) (pari.cc:100)
==1124==    by 0xE4FE47: giac::get_pari_avma() (pari.cc:127)
==1124==    by 0xE57604: giac::pari_nffactor(giac::gen const&, giac::gen const&, giac::dbgprint_vector<giac::gen> const&, giac::gen&, giac::context const*) (pari.cc:1128)
==1124==    by 0x5F6523: giac::ext_factor(giac::tensor<giac::gen> const&, giac::gen const&, giac::gen&, giac::tensor<giac::gen>&, std::vector<giac::facteur<giac::tensor<giac::gen> >, std::allocator<giac::facteur<giac::tensor<giac::gen> > > >&, bool, giac::gen&) (gausspol.cc:5728)
==1124==    by 0x5F4DC6: giac::ext_factor(giac::tensor<giac::gen> const&, giac::gen const&, giac::gen&, giac::tensor<giac::gen>&, std::vector<giac::facteur<giac::tensor<giac::gen> >, std::allocator<giac::facteur<giac::tensor<giac::gen> > > >&, bool, giac::gen&) (gausspol.cc:5617)
==1124==    by 0x601BE9: giac::do_factor(giac::tensor<giac::gen> const&, giac::tensor<giac::gen>&, std::vector<giac::facteur<giac::tensor<giac::gen> >, std::allocator<giac::facteur<giac::tensor<giac::gen> > > >&, bool, bool, bool, giac::gen const&, giac::gen&) (gausspol.cc:6577)
==1124==    by 0x6029FC: giac::factor(giac::tensor<giac::gen> const&, giac::tensor<giac::gen>&, std::vector<giac::facteur<giac::tensor<giac::gen> >, std::allocator<giac::facteur<giac::tensor<giac::gen> > > >&, bool, bool, bool, giac::gen const&, giac::gen&) (gausspol.cc:6679)
==1124==    by 0x5A8C25: giac::factor(giac::tensor<giac::gen> const&, giac::dbgprint_vector<giac::gen> const&, bool, bool, giac::gen, giac::gen&, giac::context const*) (sym2poly.cc:3267)
==1124==    by 0x5A957A: giac::var_factor(giac::gen const&, giac::dbgprint_vector<giac::gen> const&, bool, bool, giac::gen const&, giac::context const*) (sym2poly.cc:3299)
==1124== 
==1124== LEAK SUMMARY:
==1124==    definitely lost: 1,296 bytes in 3 blocks
==1124==    indirectly lost: 29 bytes in 1 blocks
==1124==      possibly lost: 553,300 bytes in 6 blocks
==1124==    still reachable: 1,625,474 bytes in 1,132 blocks
==1124==         suppressed: 0 bytes in 0 blocks
==1124== Reachable blocks (those to which a pointer was found) are not shown.
==1124== To see them, rerun with: --leak-check=full --show-reachable=yes
==1124== 
==1124== For counts of detected and suppressed errors, rerun with: -v
==1124== ERROR SUMMARY: 9 errors from 9 contexts (suppressed: 13 from 7)

infinity0
Messages : 36
Inscription : dim. févr. 05, 2017 5:46 pm

Re: chk_cas hangs on armv7 hard-float (Debian armhf)

Message par infinity0 » jeu. sept. 06, 2018 4:10 am

I have a very strange minimal example which exhibits the failure:

Code : Tout sélectionner

is_prime(9856989898997);

is_prime(1999);

is_prime(25);

is_prime(97160249868928888261606009);

FF:=GF(2,2,['a','FF']);
factor(x^3-1,FF(a));

F4:=GF(2,2,['j','F4']);
l:=[0,F4(j)];
([u,v]$(u=l))$(v=l);

factor(x^4+1,exp(i*pi/4));
factor(x^4+1,exp(i*pi/4)+1);
Running "../src/icas" on the whole example hangs, but succeeds if you comment out any of the groups (each group being separated by two newlines). What's more, the larger test "testcas" also succeeds if you comment out any of the groups from the minimal example (which are all taken from testcas). So for example if I comment out is_prime(25) the whole test testcas magically succeeds.

In other words the failure is not by factor() itself but by the specific combination of the commands in the above minimal example. The PARI stack warnings appear to be a red herring, they still get printed even when the test succeeds after commenting out any subgroup as I mentioned.

Does this hopefully give you some more ideas about what might be wrong?

https://wiki.debian.org/ArchitectureSpe ... mo#Summary contains details about the armhf architecture such as "sizeof (void*) == 4" etc.

infinity0
Messages : 36
Inscription : dim. févr. 05, 2017 5:46 pm

Re: chk_cas hangs on armv7 hard-float (Debian armhf)

Message par infinity0 » jeu. sept. 06, 2018 4:22 am

If it helps, here is a backtrace of all threads during the hang (scroll a bit down for the backtrace):

Code : Tout sélectionner

(sid_armhf-dchroot)infinity0@amdahl:~/giac/check$ ../src/icas testcas4 2>/dev/null &
[1] 23094
(sid_armhf-dchroot)infinity0@amdahl:~/giac/check$ 1,
1,
0,
0,
GF(2,a^2+a+1,[a,FF],undef),
((1 % 2)*x+1 % 2)*((1 % 2)*x+FF(a))*(x+FF(a+1)),
GF(2,j^2+j+1,[j,F4],undef),
[0,F4(j)],
[0,0],[F4(j),0],[0,F4(j)],[F4(j),F4(j)],
(x+(1-i)/sqrt(2))*(x+(1+i)/sqrt(2))*(x+(-1-i)/sqrt(2))*(x+(-1+i)/sqrt(2)),

(sid_armhf-dchroot)infinity0@amdahl:~/giac/check$ gdb -q -p 23094
Attaching to process 23094
[New LWP 23122]
[New LWP 23123]
[New LWP 23124]
[New LWP 23125]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/arm-linux-gnueabihf/libthread_db.so.1".
__libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47
47      ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S: No such file or directory.
(gdb) thread apply all bt

Thread 5 (Thread 0x1d03880 (LWP 23125)):
#0  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:46
#1  0xf57aefd4 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x24312ac) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#2  __pthread_cond_wait_common (abstime=0x0, mutex=0x24312b0, cond=0x2431280) at pthread_cond_wait.c:502
#3  __pthread_cond_wait (cond=cond@entry=0x2431280, mutex=mutex@entry=0x24312b0) at pthread_cond_wait.c:655
#4  0xf6253e34 in mt_queue_run (arg=<optimized out>) at ../src/mt/pthread.c:146
#5  0xf57aa614 in start_thread (arg=0x14665558) at pthread_create.c:463
#6  0xf547d90c in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 4 (Thread 0x107d880 (LWP 23124)):
#0  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:46
#1  0xf57aefd4 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x243123c) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#2  __pthread_cond_wait_common (abstime=0x0, mutex=0x2431240, cond=0x2431210) at pthread_cond_wait.c:502
#3  __pthread_cond_wait (cond=cond@entry=0x2431210, mutex=mutex@entry=0x2431240) at pthread_cond_wait.c:655
#4  0xf6253e34 in mt_queue_run (arg=<optimized out>) at ../src/mt/pthread.c:146
#5  0xf57aa614 in start_thread (arg=0x14665558) at pthread_create.c:463
#6  0xf547d90c in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 3 (Thread 0xff89d880 (LWP 23123)):
#0  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:46
#1  0xf57aefd4 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x24311cc) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#2  __pthread_cond_wait_common (abstime=0x0, mutex=0x24311d0, cond=0x24311a0) at pthread_cond_wait.c:502
#3  __pthread_cond_wait (cond=cond@entry=0x24311a0, mutex=mutex@entry=0x24311d0) at pthread_cond_wait.c:655
#4  0xf6253e34 in mt_queue_run (arg=<optimized out>) at ../src/mt/pthread.c:146
#5  0xf57aa614 in start_thread (arg=0x14665558) at pthread_create.c:463
#6  0xf547d90c in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 2 (Thread 0xf5157880 (LWP 23122)):
#0  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:46
#1  0xf57aefd4 in futex_wait_cancelable (private=<optimized out>, expected=0, futex_word=0x2431a04) at ../sysdeps/unix/sysv/linux/futex-internal.h:88
#2  __pthread_cond_wait_common (abstime=0x0, mutex=0x2431a08, cond=0x24319d8) at pthread_cond_wait.c:502
#3  __pthread_cond_wait (cond=0x24319d8, mutex=0x2431a08) at pthread_cond_wait.c:655
#4  0xf62540f4 in mtpthread_queue_submit (junk=<optimized out>, workid=4, work=0x23f4310) at ../src/mt/pthread.c:245
#5  0xf5f4dc30 in polint_chinese (worker=<optimized out>, mA=mA@entry=0x23f450c, P=<optimized out>) at ../src/basemath/arith1.c:2766
#6  0xf5f5288c in nmV_polint_center_tree (m2=0x23f43fc, R=0x23f4444, T=0x23f44f8, P=0x23f4500, mA=0x23f450c) at ../src/basemath/arith1.c:2830
#7  nmV_chinese_center (A=0x23f450c, P=0x23f4500, pt_mod=0xf5156170) at ../src/basemath/arith1.c:3114
#8  0xf612a38a in gen_inccrt (str=0xf626540c "ZM_inv_r", worker=worker@entry=0x23f4a8c, dB=dB@entry=0x0, n=n@entry=1, mmin=mmin@entry=4, p=p@entry=0xf5156240, pt_H=pt_H@entry=0xf5156238, pt_mod=pt_mod@entry=0xf515623c,
    crt=crt@entry=0xf5f527f5 <nmV_chinese_center>, center=center@entry=0xf5eab975 <FpM_center>) at ../src/headers/pariinl.h:218
#9  0xf5f2d4ee in ZM_inv (A=<optimized out>, pden=pden@entry=0x0) at ../src/basemath/alglin1.c:3811
#10 0xf61071e2 in bestlift_init (a=7, a@entry=0, nf=nf@entry=0x23feef0, C=C@entry=0x23f5040, L=L@entry=0xf5156454) at ../src/basemath/nffactor.c:1359
#11 0xf6109d5a in nfsqff (nf=0x23feef0, pol=0x23fe200, fl=fl@entry=0, den=<optimized out>, den@entry=0xf62c4c14 <readonly_constants+16>) at ../src/basemath/nffactor.c:1910
#12 0xf610bd2c in nffactor (nf=<optimized out>, nf@entry=0x23ffe9c, pol=pol@entry=0x23fff18) at ../src/basemath/nffactor.c:636
#13 0xf69e40b6 in giac::pari_nffactor (p=..., pmin=..., lv=..., res=..., contextptr=contextptr@entry=0x0) at pari.cc:1140
#14 0xf65e8998 in giac::ext_factor (p=..., e=..., an=..., p_content=..., f=std::vector of length 0, capacity 0, complexmode=false, extra_div=...) at gausspol.cc:5728
#15 0xf65e9218 in giac::ext_factor (p=..., e=..., an=..., p_content=..., f=std::vector of length 0, capacity 0, complexmode=complexmode@entry=true, extra_div=...) at gen.h:1550
#16 0xf65e6334 in giac::do_factor (p=..., p_content=..., f=std::vector of length 0, capacity 0, isprimitive=<optimized out>, with_sqrt=with_sqrt@entry=true, complexmode=true, complexmode@entry=false, divide_an_by=..., extra_div=...)
    at gausspol.cc:6577
#17 0xf65e696e in giac::factor (p=..., p_content=..., f=std::vector of length 0, capacity 0, isprimitive=isprimitive@entry=false, with_sqrt=with_sqrt@entry=true, complexmode=complexmode@entry=false, divide_an_by=..., extra_div=...)
    at gausspol.cc:6679
#18 0xf65b659a in giac::factor (p=..., l=..., fixed_order=fixed_order@entry=false, with_sqrt=with_sqrt@entry=true, divide_an_by=..., extra_div=..., contextptr=contextptr@entry=0xfffe899c) at sym2poly.cc:3267
---Type <return> to continue, or q <return> to quit---
#19 0xf65b7130 in giac::var_factor (e=..., l=..., fixed_order=fixed_order@entry=false, with_sqrt=with_sqrt@entry=true, divide_an_by=..., contextptr=contextptr@entry=0xfffe899c) at gen.h:1550
#20 0xf65b7a34 in giac::in_factor (e_=..., with_sqrt=with_sqrt@entry=true, divide_an_by=..., contextptr=contextptr@entry=0xfffe899c) at sym2poly.cc:3367
#21 0xf65b7d82 in giac::factor (ee=..., with_sqrt=with_sqrt@entry=true, divide_an_by=..., contextptr=contextptr@entry=0xfffe899c) at vector.h:285
#22 0xf65b8078 in giac::factorcollect (args=..., with_sqrt=<optimized out>, contextptr=contextptr@entry=0xfffe899c) at vector.h:28
#23 0xf65b83f6 in giac::_factor (args=..., contextptr=0xfffe899c) at sym2poly.cc:3686
#24 0xf6a9c782 in giac::unary_function_eval::operator() (this=<optimized out>, arg=..., context_ptr=<optimized out>) at unary.h:200
#25 0xf67381a2 in giac::symbolic::eval (this=this@entry=0x10a4034, level=level@entry=25, contextptr=contextptr@entry=0xfffe899c) at gen.h:475
#26 0xf6b06c90 in giac::gen::in_eval (this=this@entry=0xf515723c, level=level@entry=25, evaled=..., contextptr=contextptr@entry=0xfffe899c) at gen.cc:2187
#27 0xf69b3fca in giac::gen::eval (contextptr=0xfffe899c, level=25, this=0xf515723c) at gen.h:704
#28 giac::protectevalorevalf (g=..., level=level@entry=25, approx=<optimized out>, contextptr=contextptr@entry=0xfffe899c) at prog.cc:8170
#29 0xf69b431a in giac::protecteval (g=..., level=25, contextptr=contextptr@entry=0xfffe899c) at prog.cc:8191
#30 0xf68beac0 in giac::in_thread_eval (arg=0x109ddd0) at vector.h:217
#31 0xf57aa614 in start_thread (arg=0x14665558) at pthread_create.c:463
#32 0xf547d90c in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Thread 1 (Thread 0xf51aa010 (LWP 23094)):
#0  __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47
#1  0xf5458900 in __GI___nanosleep (requested_time=requested_time@entry=0xfffe87d4, remaining=remaining@entry=0x0) at ../sysdeps/unix/sysv/linux/nanosleep.c:28
#2  0xf547929e in usleep (useconds=useconds@entry=1000) at ../sysdeps/posix/usleep.c:32
#3  0x00495562 in xcas::icas_eval (g=..., gg=..., reading_file=<optimized out>, filename=..., contextptr=0xfffe899c) at Xcas1.cc:3375
#4  0x0047716e in main (ARGC=<optimized out>, ARGV=<optimized out>) at icas.cc:1724
(gdb)
testcas4 is the file with my minimal example, nothing commented out

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: chk_cas hangs on armv7 hard-float (Debian armhf)

Message par parisse » jeu. sept. 06, 2018 11:07 am

Can you check what happens if PARI is disabled? (--disable-pari in configure)
I ask because of

Code : Tout sélectionner

... in polint_chinese (worker=<optimized out>, mA=mA@entry=0x23f450c, P=<optimized out>) at ../src/basemath/arith1.c:2766

infinity0
Messages : 36
Inscription : dim. févr. 05, 2017 5:46 pm

Re: chk_cas hangs on armv7 hard-float (Debian armhf)

Message par infinity0 » ven. sept. 07, 2018 3:18 am

If I disable PARI then check_cas passes successfully without any changes needed.

We're using PARI 2.11.0-1 which was released to Debian a few months ago.

parisse
Messages : 5734
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: chk_cas hangs on armv7 hard-float (Debian armhf)

Message par parisse » ven. sept. 07, 2018 11:20 am

Then it's either a bug in pari or a bug in the interaction code (pari.cc from giac). But it's difficult to know where!

Répondre