Every single D program that I compile with dmd crashes with a segfault when I to run them.
I stripped more and more out of the program I was writing to get the smallest program that does this and this
void main() {}
will crash with a segfault.
I have not used D or dmd in a few weeks, but it was working fine last I noticed. I have not upgraded or changed dmd in that time, and can not think of any other change or update that might have affected dmd.
Since finding that this was happening with dmd, I have re-installed the operating system and all the software and the same behaviour persists.
I have tried building dmd from source but the first thing it does is run a ../generated/build program, but that is a D program so it crashes.
It also happens if I dub init a new project, dub build it and run the output. It is not just calling using dmd alone that produces executables that crash.
I have tried reverting to former versions of dmd, versions that I am pretty sure that I have used successfully before, and programs built with them also crash now where they did not crash before.
The Linux distribution is lxle, but /etc/os-release identifies the system as Ubuntu 18.04.4 LTS.
Any help or ideas about what is causing this behaviour, and how to fix it, would be hugely appreciated.
Thank you.
Edit
ldd shows
linux-gate.so.1 (0xb7f4b000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xb7e7c000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0xb7e72000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xb7e54000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7c78000)
/lib/ld-linux.so.2 (0xb7f4d000)
I have no idea if that is typical, but the files listed there exist, or are symlinks to files that exist.
break main and run in gdb gives
Starting program: /home/ant/dtest/dtest
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00448865 in _D2rt19sections_elf_shared10_tlsRangesFNbNcNdNiZSQBv4util9container5array__T5ArrayTAvZQk ()
but I don't know what to do with that information.
Further edit
Adding --DRT-gcopts="parallel:0" to the dmd command line made no difference to the program's behaviour. The generated program still crashes with a seg fault (and a claim that the core was dumped but no noticeable coredump file).