Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
347 stars 231 forks source link

monomial exponent overflow: pos int32_t + pos int32_t #1984

Open d-torrance opened 3 years ago

d-torrance commented 3 years ago

The error below occurred while running the tests for the new SuperLinearAlgebra package in an s390x PPA build in Ubuntu 20.04:

/<<BUILDDIR>>/macaulay2-1.17.2.1+git202103071350/M2/usr-dist/s390x-Linux-Ubuntu-20.04/bin/M2 -q --no-preload --stop --silent -e "needsPackage(\"SuperLinearAlgebra\",LoadDocumentation=>true,DebuggingMode=>true); check(SuperLinearAlgebra,UserMode=>false,Verbose=>true); exit 0" 
 -- capturing check(0, "SuperLinearAlgebra")                                 -- 0.0996036 seconds elapsed
 -- capturing check(1, "SuperLinearAlgebra")                                 -- 0.0331882 seconds elapsed
 -- capturing check(2, "SuperLinearAlgebra")                                terminate called after throwing an instance of 'exc::overflow_exception'
  what():  monomial exponent overflow: pos int32_t + pos int32_t
Aborted (core dumped)
make[4]: *** [Makefile:41: check-SuperLinearAlgebra] Error 134
d-torrance commented 3 years ago

It also happened in an amd64 build in Ubuntu 20.10.

d-torrance commented 3 years ago

Not sure if this is the same bug, but I tried reproducing this locally, and got a segfault:

 -- capturing check(2, "SuperLinearAlgebra")                                -- SIGSEGV
-* stack trace, pid: 572941
 0# stack_trace(std::ostream&, bool) at ./M2/Macaulay2/d/main.cpp:124
 1# segv_handler at ./M2/Macaulay2/d/main.cpp:241
 2# 0x00007F7E10517950 in /lib/x86_64-linux-gnu/libc.so.6
 3# GC_malloc_kind in /lib/x86_64-linux-gnu/libgc.so.1
 4# getmem_atomic at ./M2/Macaulay2/d/M2mem.c:96
 5# M2_makearrayint at ./M2/Macaulay2/d/M2.d:42
 6# IM2_FreeModule_get_degrees at interface/freemodule.cpp:93
 7# interface_rawMultiDegree at ./M2/Macaulay2/d/interface.dd:1165
 8# evaluate_evalraw at ./M2/Macaulay2/d/evaluate.d:1297
 9# evaluate_evalSequence at ./M2/Macaulay2/d/evaluate.d:1257
d-torrance commented 3 years ago

Also happened on another test from the same package in an armhf PPA build on Ubuntu 18.04:

 -- skipping  check(2, "SuperLinearAlgebra")                                 -- 0.000155924 seconds elapsed
 -- capturing check(3, "SuperLinearAlgebra")                                terminate called after throwing an instance of 'exc::overflow_exception'
  what():  monomial exponent overflow: pos int32_t + pos int32_t
Aborted (core dumped)
Makefile:41: recipe for target 'check-SuperLinearAlgebra' failed
make[4]: *** [check-SuperLinearAlgebra] Error 134
d-torrance commented 2 years ago

Got another segfault in check(3, "SuperLinearAlgebra") with a different backtrace in an arm64 PPA build in Ubuntu 22.04:

 -- capturing check(3, "SuperLinearAlgebra")                                -- SIGSEGV
-* stack trace, pid: 27892
 0# stack_trace(std::ostream&, bool) at ./M2/Macaulay2/d/main.cpp:127
 1# segv_handler at ./M2/Macaulay2/d/main.cpp:243
 2# 0x0000FFFF9DC51688 in linux-vdso.so.1
 3# GC_set_fl_marks in /lib/aarch64-linux-gnu/libgc.so.1
 4# GC_mark_thread_local_fls_for in /lib/aarch64-linux-gnu/libgc.so.1
 5# GC_mark_thread_local_free_lists in /lib/aarch64-linux-gnu/libgc.so.1
 6# GC_push_roots in /lib/aarch64-linux-gnu/libgc.so.1
 7# GC_mark_some in /lib/aarch64-linux-gnu/libgc.so.1
 8# GC_stopped_mark in /lib/aarch64-linux-gnu/libgc.so.1
 9# GC_try_to_collect_inner in /lib/aarch64-linux-gnu/libgc.so.1
10# GC_try_to_collect_general in /lib/aarch64-linux-gnu/libgc.so.1
11# GC_gcollect in /lib/aarch64-linux-gnu/libgc.so.1
12# CollectGarbage at ./M2/Macaulay2/d/actors.d:1178
13# evaluate_evalraw at ./M2/Macaulay2/d/evaluate.d:1439
d-torrance commented 2 years ago

Yet another different backtrace for this test, this time from an s390x PPA build in Ubuntu 22.04:

 -- capturing check(3, "SuperLinearAlgebra")                                -- SIGSEGV
-* stack trace, pid: 24736
 0# stack_trace(std::ostream&, bool) at ./M2/Macaulay2/d/main.cpp:127
 1# segv_handler at ./M2/Macaulay2/d/main.cpp:243
 2# 0x000003FF7DF76296
 3# rawNonTermOrderVariables at interface/monomial-ordering.cpp:503
 4# Monoid::Monoid(MonomialOrdering const*, M2_ArrayString_struct*, PolynomialRing const*, M2_arrayint_struct*, M2_arrayint_struct*) at ./M2/Macaulay2/e/monoid.cpp:189
 5# Monoid::create(MonomialOrdering const*, M2_ArrayString_struct*, PolynomialRing const*, M2_arrayint_struct*, M2_arrayint_struct*) at ./M2/Macaulay2/e/monoid.cpp:82
 6# IM2_Monoid_make at interface/monoid.cpp:34
 7# interface_rawMonoid_1 at ./M2/Macaulay2/d/interface.dd:595
 8# evaluate_evalraw at ./M2/Macaulay2/d/evaluate.d:1303
 9# assignelemfun at ./M2/Macaulay2/d/evaluate.d:139
10# evaluate_evalraw at ./M2/Macaulay2/d/evaluate.d:1379
d-torrance commented 2 years ago

Another test failure with a different backtrace, from an amd64 PPA build in Ubuntu 18.04:

 -- capturing check(2, "SuperLinearAlgebra")                                -- SIGSEGV
-* stack trace, pid: 133983
 0# stack_trace(std::ostream&, bool) at ./M2/Macaulay2/d/main.cpp:127
 1# segv_handler at ./M2/Macaulay2/d/main.cpp:244
 2# 0x00007F9DE7E46F10 in /lib/x86_64-linux-gnu/libc.so.6
 3# 0x00007F9DE96CC743 in /usr/lib/x86_64-linux-gnu/libgc.so.1
 4# nets_HorizontalJoin at ./M2/Macaulay2/d/nets.d:118
 5# evaluate_evalraw at ./M2/Macaulay2/d/evaluate.d:1303
 6# evaluate_evalraw at ./M2/Macaulay2/d/evaluate.d:1364
 7# evaluate_evalraw at ./M2/Macaulay2/d/evaluate.d:1414
 8# evaluate_applyFCE at ./M2/Macaulay2/d/evaluate.d:749
 9# method1 at ./M2/Macaulay2/d/actors5.d:669