Bug 12066 – dmd on osx 10.[89] in 32 bit mode memory corruption

Status
RESOLVED
Resolution
WONTFIX
Severity
blocker
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2014-02-02T14:34:36Z
Last change time
2019-03-27T11:15:11Z
Assigned to
No Owner
Creator
Brad Roberts

Comments

Comment #0 by braddr — 2014-02-02T14:34:36Z
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 #0 0x9bb226f5 in ?? () #1 0x97c87d1d in ?? () #2 0x002292d4 in mem_free (ptr=0x12dd0e00) at tk/mem.c:691 #3 0x12dd0e00 in ?? () #4 0x0021512b in codgen () at backend/cgcod.c:559 #5 0x00000000 in ?? () (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 #0 0x9bb226e8 in ?? () #1 0x97c7e26d in ?? () #2 0x97c87d1d in ?? () #3 0x002292d4 in mem_free (ptr=0xf7f6e00) at tk/mem.c:691 #4 0x0f7f6e00 in ?? () #5 0x0021512b in codgen () at backend/cgcod.c:559 #6 0x00000000 in ?? () (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 #0 0x927cb952 in ?? () #1 0x98aa9340 in ?? () #2 0x97c804b6 in ?? () #3 0x97c81c8d in ?? () #4 0x97c86276 in ?? () #5 0x97c85442 in ?? () #6 0x97c7ab6a in ?? () #7 0x97c7c683 in ?? () #8 0x97c879e9 in ?? () #9 0x97c88065 in ?? () #10 0x00212443 in symtab_realloc (tab=0x127f7e00, symmax=129) at backend/symbol.c:62 #11 0x00000204 in Visitor::visit (this=0xbfffec28) at ./visitor.h:275 Backtrace stopped: previous frame inner to this frame (corrupt stack?)
Comment #1 by braddr — 2014-02-21T16:30:44Z
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.
Comment #2 by greensunny12 — 2019-03-27T11:15:11Z
Closing as WONTFIX as OSX 32-bit is no longer supported.