cannot gdb LDC build binary: Segmentation fault

Siarhei Siamashka siarhei.siamashka at gmail.com
Sat Oct 8 15:53:18 UTC 2022


On Friday, 7 October 2022 at 04:40:34 UTC, mw wrote:
> Has anyone experienced such problem before?
>
> any suggestions where I should look at?

If you are compiling your program with "-release" command line 
option, then arrays bounds checking is not done in the @system 
code at all (which is all of your code by default). Either remove 
this "-release" option or try to mark all of your code as @safe 
and check whether the problem manifests itself in a nicer and 
more obvious way.

Also in GDB it's always useful to look at the output of the "bt" 
(backtrace) command. Running your program under valgrind may also 
reveal something.


More information about the Digitalmars-d-learn mailing list