Using Clang with D
doob at me.com
Thu Jan 26 11:44:42 PST 2012
On 2012-01-26 10:29, Jacob Carlborg wrote:
> I'm trying to port a simple example that uses Clang from C to D but for
> some reason the D version results in a segmentation fault.
> This is the C code:
> This is the D code:
> The stacktrace from GDB looks like this:
> (gdb) r
> Starting program: /Users/jacob/development/d/dstep/bin/dstep NSObject.h
> Reading symbols for shared libraries .+.. done
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000004
> 0x0000000100104139 in clang_formatDiagnostic ()
> (gdb) bt
> #0 0x0000000100104139 in clang_formatDiagnostic ()
> #1 0x0000000100001648 in _Dmain ()
> #2 0x000000010001baa5 in D2rt6dmain24mainUiPPaZi7runMainMFZv ()
> #3 0x000000010001b671 in D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv ()
> #4 0x000000010001baf7 in D2rt6dmain24mainUiPPaZi6runAllMFZv ()
> #5 0x000000010001b671 in D2rt6dmain24mainUiPPaZi7tryExecMFMDFZvZv ()
> #6 0x000000010001b5f4 in main ()
> I'm using DMD 2.057 on Mac OS X compiling as 64bit.
> Any idea what I have done wrong?
I've now found out that I only get this error when compiling as 64bit.
When I compile as 32bit everything works fine.
More information about the Digitalmars-d-learn