Thread overview
[Issue 22460] -lowmem causes segfault on OpenBSD 64-bit
[Issue 22460] Unittest build of d_do_test.d triggers RangeError on OpenBSD
Nov 02, 2021
Brian Callahan
Nov 02, 2021
Brian Callahan
Nov 02, 2021
Brian Callahan
Dec 11, 2021
Brian Callahan
November 01, 2021
https://issues.dlang.org/show_bug.cgi?id=22460

moonlightsentinel@disroot.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |moonlightsentinel@disroot.o
                   |                            |rg
            Summary|OpenBSD: dmd                |Unittest build of
                   |auto-tester-test fails      |d_do_test.d triggers
                   |immediately                 |RangeError on OpenBSD

--- Comment #1 from moonlightsentinel@disroot.org ---
The failure occurs when compiling the unittests of the test tools `d_do_test.d`. The stack trace suggests that it's a a failure in the frontend which is quite surprising. Might be a memory corruption introduced by the GC given that the unittests are built with `-lowmem`.

Check whether -lowmem makes a difference, i.e. if the following succeeds:

dmd -m64 -fPIC -g -i -Itools -version=NoMain -unittest tools/d_do_test.d

--
November 02, 2021
https://issues.dlang.org/show_bug.cgi?id=22460

--- Comment #2 from Brian Callahan <bcallah@openbsd.org> ---
Yes, your command succeeded. I was even able to run the resulting program and
got:
1 modules passed unittests

--
November 02, 2021
https://issues.dlang.org/show_bug.cgi?id=22460

--- Comment #3 from Brian Callahan <bcallah@openbsd.org> ---
Further analysis suggests that using -lowmem immediately segfaults full stop no matter what you are compiling with dmd on 64-bit OpenBSD DMD.

I did not even think to check it because -lowmem works fine on 32-bit OpenBSD DMD. So this is a bug specifically on 64-bit OpenBSD DMD.

--
November 02, 2021
https://issues.dlang.org/show_bug.cgi?id=22460

Brian Callahan <bcallah@openbsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Unittest build of           |-lowmem causes segfault on
                   |d_do_test.d triggers        |OpenBSD 64-bit
                   |RangeError on OpenBSD       |

--
December 11, 2021
https://issues.dlang.org/show_bug.cgi?id=22460

Brian Callahan <bcallah@openbsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #4 from Brian Callahan <bcallah@openbsd.org> ---
This ended up being a problem on my system, not a problem with DMD. Nothing needing fixing, DMD is working fine.

--