Thread overview
Having issues chasing down a segfault
Oct 04
Joakim
Oct 04
kinke
October 04
So I have an open-source project that I've been working on.  LDC has been my compiler of choice on Windows (32-bit) for a while now, but a couple of commits back it started behaving weird.  The program compiles just fine without errors, but when attempting to run the program a segfault occurs.  This does not happen when compiling with DmD.

GDB has been unhelpful with trying to locate the source of the problem, and my co-conspirator has been unable to help because he's on Linux and doesn't get any errors.  So, the problem is either with LDC or with the Visual Studio linker, and I don't know how to diagnose from here.

The commit that caused the problem can be found on my GitHub here:
https://github.com/swashdev/SwashRL/commit/fd093849446735cda7730982c58c791bfd5ad77a
October 04
On Thursday, 4 October 2018 at 07:20:24 UTC, Philip Pavlick wrote:
> So I have an open-source project that I've been working on.  LDC has been my compiler of choice on Windows (32-bit) for a while now, but a couple of commits back it started behaving weird.  The program compiles just fine without errors, but when attempting to run the program a segfault occurs.  This does not happen when compiling with DmD.
>
> [...]

Please file an issue on github with the compiler version:

https://github.com/ldc-developers/ldc/issues
October 04
On Thursday, 4 October 2018 at 07:20:24 UTC, Philip Pavlick wrote:
> GDB has been unhelpful with trying to locate the source of the problem

Try the Visual Studio debugger (and obviously build with -g); the VisualD plugin might help too.

> So, the problem is either with LDC or with the Visual Studio linker, and I don't know how to diagnose from here.

Not so sure about that, DMD isn't exactly bug-free. ;) Are you using matching LDC and DMD versions?
Wrt. linker, you can also give LLD a shot by adding `-link-internally` to the LDC command line.