Mercury Bugs - mercury
View Issue Details
0000434mercuryBugpublic2017-03-29 09:552018-01-09 10:42
Reporterjuliensf 
Assigned Towangp 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Platformx86_64-pc-linux-gnuOSAlpine LinuxOS Version3.5
Product Version 
Target VersionFixed in Version 
Summary0000434: Alpine Linux / musl libc / x86_64 support
DescriptionInstalling rotd-2017-03-28 from the source distribution on Alpine Linux (x86_64-pc-linux-gnu) results in a successful install, but the executables (e.g. hello world) generated by the compiler abort with:

    GC_is_visible test failed
    Aborted

This seems to be occurring in every grade.
TagsNo tags attached.
Attached Files

Notes
(0000945)
FlyingJester   
2017-03-30 18:46   
I can confirm the same issue on VoidLinux for amd64, using musl.

A possible clue to the issue is that using "--linkage static --mercury-linkage static" produces working executables.
(0000955)
wangp   
2017-06-25 11:32   
Progress:

- upstream bdwgc has the necessary changes for musl (including parallel marking)

- need to compile bdwgc with -DNO_GETCONTEXT -DHAVE_DL_ITERATE_PHDR

- there is some other difference between the autotools-based buid and the Makefile.direct-based build. Mercury programs would crash when linked with libgc.{a,so} produced by Makefile.direct, but would run correctly when linked with the libgc produced by the autotools-generated makefile.

- thread.spawn/spawn_native will need to set a reasonable stack size as musl gives threads something like 80 kB by default. We should also allow the user to choose a stack size when creating a thread.
(0000959)
wangp   
2018-01-09 10:42   
Fixed as of commit 323bad9ff

Issue History
2017-03-29 09:55juliensfNew Issue
2017-03-30 18:46FlyingJesterNote Added: 0000945
2017-06-25 11:32wangpNote Added: 0000955
2018-01-09 10:42wangpAssigned To => wangp
2018-01-09 10:42wangpStatusnew => resolved
2018-01-09 10:42wangpResolutionopen => fixed
2018-01-09 10:42wangpNote Added: 0000959