[SAOC 2024] - Fix Segmentation fault when compiling druntime Weekly update #3

Johan j at j.nl
Mon Oct 7 18:37:31 UTC 2024


On Sunday, 6 October 2024 at 22:25:30 UTC, Dennis wrote:
> ## Fix Segmentation when Compiling druntime
>
> ### Task Accomplished
> After moving the newScope function (which is a semantic import) 
> from attrib.d to dsymbolsem.d, and turning it into a visitor. I 
> encountered an error with the following description:
> ```make -C druntime
> make[2]: Entering directory '/home/dencomac/DL/dmd/druntime'
> ../generated/linux/release/64/dmd -c -conf= -Isrc -Iimport -w 
> -de -preview=dip1000 -preview=fieldwise -m64 -fPIC 
> -preview=dtorfields -O -release -inline -version=Shared -fPIC 
> -version=Shared -fPIC -I. -P=-I. src/core/stdc/errno.c 
> -of../generated/linux/release/64/errno_c.o
> make[2]: *** [Makefile:394: 
> ../generated/linux/release/64/errno_c.o] Segmentation fault
> make[2]: Leaving directory '/home/dencomac/DL/dmd/druntime'
> make[1]: *** [Makefile:89: druntime] Error 2
> make[1]: Leaving directory '/home/dencomac/DL/dmd'
> make: *** [posix.mak:8: all] Error 2
> ```
> It became a challenge to me and to the reviewers.  It was a 
> runtime error. Although the dmd compiler was built 
> successfully, when druntime(core runtime library that provides 
> essential low-level support for the D) was tested, it failed.

Hi Dennis, all,

I'm sorry to say, but I am not feeling very happy about this 
project.
It is a very invasive change to the compiler, that I feel should 
not be undertaken by someone with relatively little experience in 
D, let alone D compiler frontend development.
What are the safety checks to prevent _any_ actual change in 
compiler output?
The test suite of the compiler (and druntime, and Phobos) is 
*very* scant and lacks rigorous testing in many places. Which 
means that you cannot rely on the testsuite to verify that indeed 
no change happened to the compiler output. There is the project 
builder (buildkite?) which expands the testsuite, that's nice, 
but but still.

Are there any extra checks done to see whether binary output of 
the compiler has changed upon any PR submitted? (for a number of 
large code bases?)

-Johan



More information about the Digitalmars-d mailing list