www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12066] New: dmd on osx 10.9 in 32 bit mode memory corruption

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12066

           Summary: dmd on osx 10.9 in 32 bit mode memory corruption
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Mac OS X
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: braddr puremagic.com



---
I haven't been able to reproduce this on linux or osx 10.9 in 64 bit mode. 
Valgrind doesn't yet work on 10.9, so won't help.  This is the first time I'm
trying with 10.9, so I don't know if it's a regression or always been buggy. 
10.9 is the first osx release that ships without gcc, only with llvm.

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix

(gdb doesn't ship with osx, I installed it via macports since I don't have the
time to learn lldb)

$ ggdb --args ../dmd/src/dmd -I../druntime/import  -w -m32  -O -release
-unittest -c -ofgenerated/osx/release/32/unittest/std/format.o
-deps=generated/osx/release/32/unittest/std/format.deps.tmp std/format.d

(gdb) run
Starting program:
/Users/braddr/sandbox/d/d-tester/client/master-test-Darwin_32/dmd/src/dmd
-I../druntime/import -w -m32 -O -release -unittest -c
-ofgenerated/osx/release/32/unittest/std/format.o
-deps=generated/osx/release/32/unittest/std/format.deps.tmp std/format.d
DMD v2.065-devel-af8917b DEBUG

Program received signal SIGSEGV, Segmentation fault.
0x9bb226f5 in ?? ()
(gdb) bt








(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program:
/Users/braddr/sandbox/d/d-tester/client/master-test-Darwin_32/dmd/src/dmd
-I../druntime/import -w -m32 -O -release -unittest -c
-ofgenerated/osx/release/32/unittest/std/format.o
-deps=generated/osx/release/32/unittest/std/format.deps.tmp std/format.d
DMD v2.065-devel-af8917b DEBUG

Program received signal SIGILL, Illegal instruction.
0x9bb226e8 in ?? ()
(gdb) bt









(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y

Starting program:
/Users/braddr/sandbox/d/d-tester/client/master-test-Darwin_32/dmd/src/dmd
-I../druntime/import -w -m32 -O -release -unittest -c
-ofgenerated/osx/release/32/unittest/std/format.o
-deps=generated/osx/release/32/unittest/std/format.deps.tmp std/format.d
DMD v2.065-devel-af8917b DEBUG
[Inferior 1 (process 84289) exited normally]


(gdb) run
Starting program:
/Users/braddr/sandbox/d/d-tester/client/master-test-Darwin_32/dmd/src/dmd
-I../druntime/import -w -m32 -O -release -unittest -c
-ofgenerated/osx/release/32/unittest/std/format.o
-deps=generated/osx/release/32/unittest/std/format.deps.tmp std/format.d
DMD v2.065-devel-af8917b DEBUG
[Inferior 1 (process 84303) exited normally]
(gdb) run
Starting program:
/Users/braddr/sandbox/d/d-tester/client/master-test-Darwin_32/dmd/src/dmd
-I../druntime/import -w -m32 -O -release -unittest -c
-ofgenerated/osx/release/32/unittest/std/format.o
-deps=generated/osx/release/32/unittest/std/format.deps.tmp std/format.d
DMD v2.065-devel-af8917b DEBUG
dmd(84304,0xa05de1a8) malloc: *** error for object 0x157f7a04: incorrect
checksum for freed object - object was probably modified after being freed.
*** set a breakpoint in malloc_error_break to debug

Program received signal SIGABRT, Aborted.
0x927cb952 in ?? ()
(gdb) bt











backend/symbol.c:62

Backtrace stopped: previous frame inner to this frame (corrupt stack?)

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 02 2014
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12066


Brad Roberts <braddr puremagic.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|dmd on osx 10.9 in 32 bit   |dmd on osx 10.[89] in 32
                   |mode memory corruption      |bit mode memory corruption



---
The same with osx 10.8 and the llvm that ships with it.  Switch both to
apple-gcc42 via macports, and both 32 and 64 bit builds are fine.  Something is
definitely up with llvm + dmd + 32bits.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 21 2014