On Friday, 26 August 2016 at 21:26:13 UTC, unDEFER wrote:


BUT in gdb it runs successfully and I see red window.
What I'm doing wrong? How gdb can make not working code working?

I can tell you that your code compiles and runs fine for me on Windows using dub. It's also not so unusual for a program to segfault outside of gdb but run successfully inside. Normally, in C or C++, the likely culprit is the use of unintialized variables, but in D all variables are default initialized unless you explicitly tell the compiler not to initialize them. I'm not a heavy linux user, but I did a quick google and one recommendation I found repeated on Stack Overflow in this case is to capture a core dump. See [1] for an example.


[1] http://stackoverflow.com/questions/7057651/cannot-reproduce-segfault-in-gdb

Reply via email to