Seg-fault in monoid construction

17 views
Skip to first unread message

Michael Burr

unread,
Feb 23, 2022, 3:36:41 PMFeb 23
to Macaulay2
I've compiled Macaulay2 from source on Clemson's supercomputer (https://www.palmetto.clemson.edu/palmetto/) and I'm getting a surprising sporadic seg-fault.  I'm writing to see if anyone has had similar experiences.  Around 30% of the time, the following code causes a seg-fault:

restart -- restarting may be needed to observe the behavior
R = QQ[x_1..x_21,MonomialOrder => Lex]
nvars = 38
degs = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2}
orders = append((monoid R).Options.MonomialOrder, Eliminate 21)
monoid[Variables => nvars, Degrees => degs, MonomialOrder => orders]

I can't replicate the seg-fault on either my mac laptop or the online M2 test servers, so I believe that this is a system-specific issue.  Also, I've never observed the crash if I prepend the Eliminate 21.

I compiled M2 from source (using gmake) using M2 releases 1.19.1.1 and 1.18.0.1.  To get it to compile, I needed to apply the patch to m4 described here: (http://git.openembedded.org/openembedded-core/tree/meta/recipes-devtools/m4/m4/m4-1.4.18-glibc-change-work-around.patch) and to link in openblas.  

The server has somewhat older software pre-installed, e.g., gcc-8.4.1, gmp-6.1.2, mpfr-4.0.2, eigen-3.3.7, openblas-0.3.10.  The server is running CentOS Linux 8 (Core) on an (x86_64) Intel(R) Xeon(R) CPU E5-2680 v3 @ 2.50GHz

Any ideas or similar experiences would be appreciated.

Daniel R. Grayson

unread,
Feb 24, 2022, 4:03:03 PMFeb 24
to Macaulay2
Do you get a backtrace, showing which line of the source code was being executed at the time of the fault?

If not, you could recompile from scratch with --enable-debug given to the configure command, and more information would
be available.  You could then even debug it with gdb.


Michael Burr

unread,
Feb 25, 2022, 11:15:08 AMFeb 25
to Macaulay2
I tried --enable-debug and the error no longer occurred (either when running M2 directly or within gdb/valgrind).  The identical installation without --enable-debug produces the crash.  The stack trace is:

-- SIGSEGV
-* stack trace, pid: 1201327
 0# stack_trace(std::ostream&, bool) at /usr/include/boost/stacktrace/stacktrace.hpp:217
 1# segv_handler at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/main.cpp:244
 2# 0x000014EF8A2A8400 in /lib64/libc.so.6
 3# GC_malloc_kind in /lib64/libgc.so.1
 4# getmem_atomic at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/M2mem.c:119
 5# Monoid::make_one() const at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/e/../../../../Macaulay2/e/monoid.cpp:502
 6# Monomial::compare(Monoid const*, Monomial const&) const at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/e/../../../../Macaulay2/e/monomial.cpp:86
 7# interface_rawCompareMonomial at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/interface.dd:163
 8# evaluate_evalraw at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1303
 9# evaluate_applyEEE at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:947 (discriminator 1)
10# binarycomparison at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/actors3.d:211
11# evaluate_evalraw at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1295
12# evaluate_applyEEE at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:947 (discriminator 1)
13# binarycomparison at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/actors3.d:211
14# lessequalfun2 at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/actors3.d:553
15# evaluate_evalraw at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1295
16# evaluate_evalraw at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1263
17# scan_1 at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/actors3.d:1918
18# evaluate_evalraw at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1303
19# evaluate_eval at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1263 (discriminator 1)
20# evaluate_evalAllButTail at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1263
21# evaluate_applyFCC at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:600
22# evaluate_evalraw at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1299
23# evaluate_eval at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1263 (discriminator 1)
24# evaluate_applyFCCS at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:839 (discriminator 4)
25# evaluate_evalraw at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1299
26# evaluate_applyFCE at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:749
27# iteratedApply at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/actors3.d:2286 (discriminator 6)
28# evaluate_applyFCC at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:668
29# evaluate_evalraw at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1310
30# evaluate_evalexcept at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1444
31# readeval4 at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/interp.dd:179
32# loadprint(M2_string_struct*, parse_DictionaryClosure_struct*, char) at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/interp.dd:345 (discriminator 1)
33# commandInterpreter_2(tagged_union*) at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/interp.dd:458 (discriminator 1)
34# evaluate_evalraw at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1303
35# evaluate_evalraw at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1263
36# evaluate_evalraw at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1263 (discriminator 2)
37# evaluate_evalexcept at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/evaluate.d:1444
38# readeval4 at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/interp.dd:179
39# readeval(parse_TokenFile_struct*, char, char) at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/interp.dd:285
40# interp_process at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/interp.dd:606
41# interpFunc(ArgCell*) at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/d/../../../../Macaulay2/d/main.cpp:196
42# ThreadTask::run(SupervisorThread*) at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/system/../../../../Macaulay2/system/supervisor.cpp:377
43# SupervisorThread::threadEntryPoint() at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/system/../../../../Macaulay2/system/supervisor.cpp:426
44# SupervisorThread::threadEntryPoint(void*) at /home/burr2/M2/M2nodebug/M2/M2/BUILD/build/Macaulay2/system/../../../../Macaulay2/system/supervisor.hpp:100
45# 0x000014EF8B33F85F in /lib64/libgc.so.1
46# GC_call_with_stack_base in /lib64/libgc.so.1
47# 0x000014EF8AEFD14A in /lib64/libpthread.so.0
48# clone in /lib64/libc.so.6
-- end stack trace *-

Daniel R. Grayson

unread,
Feb 25, 2022, 11:45:38 AMFeb 25
to Macaulay2
That's mysterious - I wonder what GC_malloc_kind is. This libgc bug report looks sort of similar:


Can you reproduce the bug in that report?

Reply all
Reply to author
Forward
0 new messages