Bug 2690 – DMD aborts with MALLOC_CHECK_ set

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
Other
OS
Linux
Creation time
2009-02-25T16:51:00Z
Last change time
2014-03-01T00:36:19Z
Keywords
ice-on-invalid-code
Assigned to
bugzilla
Creator
larsivar

Comments

Comment #0 by larsivar — 2009-02-25T16:51:27Z
I don't know how common it is, but at least Ubuntu has a standard environment variable called MALLOC_CHECK_ which typically is set to 2. When it is set, memory allocations are checked (it can also be set to 3). However, with DMD 1.040 this causes an "Aborted" message. Setting MALLOC_CHECK_ to 0 makes it work again. I have tried to narrow down where it happens, but I seem to fail to get it much shorter than the following (and it seems that Exception itself from object.di may be involved): class PlatformException : Exception { this(char[] msg) { super(msg); } } class AssertException : Exception { this(char[] file, size_t line) { super("Assertion failure",file,line); } this(char[] msg, char[] file, size_t line) { super(msg,file,line); } } void setAssertHandler(int){ } This is a regression in DMD 1.040
Comment #1 by bugzilla — 2009-02-26T04:19:32Z
I didn't know about MALLOC_CHECK_. It's a great feature, and I found the (off by one) problem.
Comment #2 by bugzilla — 2009-03-11T14:54:57Z
Fixed dmd 1.041 and 2.026