mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 09:23:44 +00:00
There is an issue on Linux/aarch64 with older versions of gcc where a
commit performed on a thread using the gcc __builtin_longjmp function
causes an assertion failure in pthread_create() if the Mercury runtime
is dynamically linked:
pthread_create.c:430: start_thread: Assertion `freesize < pd->stackblock_size' failed.
or a crash if the Mercury runtime is statically linked:
*** Mercury runtime: caught segmentation violation ***
cause: address not mapped to object
The gcc versions tested are:
BAD - gcc version 6.3.0 20170516 (Debian 6.3.0-18) from Debian 9
BAD - gcc version 8.3.0 (Debian 8.3.0-2) from Debian 10
OK - gcc version 10.2.1 20210110 (Debian 10.2.1-6) from Debian 11
on Debian with glibc.
runtime/mercury.h:
Define MR_USE_GCC_BUILTIN_SETJMP_LONGJMP if we decide to use gcc's
__builtin_setjmp and __builtin_longjmp functions instead of the
standard functions.
Use standard setjmp/longjmp on aarch64 if gcc version is < 10.
Update the comment for MR_builtin_jmp_buf to refer to the GCC manual
instead of the GCC source code. Use an array of 'intptr_t's instead
of 'void *'s, to match the manual.
tests/hard_coded/Mmakefile
tests/hard_coded/thread_commit.m:
tests/hard_coded/thread_commit.exp:
tests/hard_coded/thread_commit.exp2:
Add test case.
2 lines
28 B
Plaintext
2 lines
28 B
Plaintext
spawn_native not supported.
|