www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - mystery crashes

reply tsbockman <thomas.bockman gmail.com> writes:
Could I persuade someone from the compiler team to take a look at 
this bug report I filed?
     https://issues.dlang.org/show_bug.cgi?id=15573

I'm trying to finish basic testing of my latest checkedint 
revision, but it's getting very difficult to work on because the 
test suite keeps crashing with unhelpful error messages like:

Program exited with code -11
Program exited with code -8
Program exited with code -4
Illegal Instruction
Segmentation fault

I have also seen what seems like stack corruption occurring, with 
variables changing value on their own, even though nothing wrote 
to them. (See the bug report.)

This is  safe code with no memory management to speak of; I think 
it's some sort of nasty bug in the compiler or in druntime, but I 
lack the knowledge required to track something like this down.
Jan 19 2016
next sibling parent "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
On Tue, Jan 19, 2016 at 10:19:22PM +0000, tsbockman via Digitalmars-d wrote:
 Could I persuade someone from the compiler team to take a look at this
 bug report I filed?
     https://issues.dlang.org/show_bug.cgi?id=15573
 
 I'm trying to finish basic testing of my latest checkedint revision,
 but it's getting very difficult to work on because the test suite
 keeps crashing with unhelpful error messages like:
 
 Program exited with code -11
 Program exited with code -8
 Program exited with code -4
 Illegal Instruction
 Segmentation fault
 
 I have also seen what seems like stack corruption occurring, with
 variables changing value on their own, even though nothing wrote to
 them. (See the bug report.)
 
 This is  safe code with no memory management to speak of; I think it's
 some sort of nasty bug in the compiler or in druntime, but I lack the
 knowledge required to track something like this down.
I took a look, and couldn't reproduce the problem (Linux/x86_64). As I said in the bug comments, this looks like the symptoms of the compiler picking up the wrong version of a library (either druntime or phobos or other 3rd party libraries), or stale object files in your build cache. Try building from a clean sandbox to see if that makes a difference (i.e., create a new chroot, install a fresh copy of the dmd toolchain in it, copy your source files over -- one by one, so that you don't accidentally pick up stale object files -- and see if the same problems occur). This may be the result of a dmd.conf misconfiguration, or maybe dmd is picking up the wrong version of dmd.conf for whatever reason. Or maybe your dmd installation is screwed up. It might be a good idea to wipe all copies of dmd from your system, including any stale files that might be left over (esp. library files and all copies of dmd.conf), reinstall dmd, and try again. T -- My program has no bugs! Only undocumented features...
Jan 19 2016
prev sibling parent "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
On Tue, Jan 19, 2016 at 04:00:32PM -0800, H. S. Teoh via Digitalmars-d wrote:
 On Tue, Jan 19, 2016 at 10:19:22PM +0000, tsbockman via Digitalmars-d wrote:
 Could I persuade someone from the compiler team to take a look at
 this bug report I filed?
     https://issues.dlang.org/show_bug.cgi?id=15573
[...]
 I took a look, and couldn't reproduce the problem (Linux/x86_64). As I
 said in the bug comments, this looks like the symptoms of the compiler
 picking up the wrong version of a library (either druntime or phobos
 or other 3rd party libraries), or stale object files in your build
 cache.
[...] I take that back; we've found that it was caused by a bad interaction between -O and -inline in dmd that triggers a codegen bug, in which the edx register was not properly initialized prior to the idiv instruction, causing the result of the integer division to be garbage. Maybe one of the compiler devs (probably Walter, as this may be backend related) could look at this? T -- I am not young enough to know everything. -- Oscar Wilde
Jan 20 2016