2024-10-11 19:33 AEDT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000560mercuryBugpublic2022-05-31 16:24
Reporterwangp 
Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
StatusnewResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000560: asm_fast.gc crashes on aarch64 with gcc 10.2
DescriptionConfigure enables asm_fast.gc by default on aarch64 but it doesn't work with newer versions of gcc:

gcc 10.2, Debian 11 - crash
gcc 8.3.0, Debian 10 - ok
gcc 6.3.0, Debian 9 - ok

reg.gc works so far on a few small programs. I have not tried a bootcheck yet (emulation is slow).
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0001195

juliensf (administrator)

Does the crash with the sample programs occur with GCC 10.2 occur with:

    a. --mercury-linkage shared
    b. --mercury-linkage static
    c. both

Have you tried compiling with gcc -O0?

~0001196

wangp (developer)

It crashes in all three cases (--mercury-linkage shared, --mercury-linkage static, compiling the standard library and hello.m with gcc -O0).

~0001197

wangp (developer)

Debian 11 also has a package for gcc version 9.3.0.

The sample programs also crash in asm_fast.gc using gcc 9.3.0 in all three cases (--mercury-linkage shared, --mercury-linkage static, compiling the standard library and hello.m with gcc -O0).

~0001198

juliensf (administrator)

In the absence of an immediate fix, I suggest we disable the use of asm_fast as the LLDS base grade on aarch64 for GCC >= 9 on both the master and release branches (assuming reg.gc is ok.)

~0001199

wangp (developer)

It has something to do with PIC. Adding this to Mmake.params and compiling the sample programs without PIC makes them not crash:

EXTRA_CFLAGS = -fno-pic -fno-PIC -static
EXTRA_MLFLAGS = -static

(That makes me a bit suspicious that it is something similar to the PIC register issue on x86, but it might be completely unrelated.)

For now I agree we should disable asm_fast on aarch64 with GCC >= 9. I'm doing a partial bootcheck on reg.gc to make sure that works ok.
+Notes

-Issue History
Date Modified Username Field Change
2022-05-27 17:37 wangp New Issue
2022-05-27 17:38 wangp Severity minor => crash
2022-05-27 17:50 juliensf Note Added: 0001195
2022-05-30 12:10 wangp Note Added: 0001196
2022-05-31 12:37 wangp Note Added: 0001197
2022-05-31 14:18 juliensf Note Added: 0001198
2022-05-31 16:24 wangp Note Added: 0001199
+Issue History