[dmd-internals] What should I do to reduce this for a bugzilla entry?

Brad Roberts braddr at puremagic.com
Mon May 31 19:39:12 PDT 2010


On 5/31/2010 7:29 PM, Jason House wrote:
> Am I correct in assuming the easiest way to find out what's causing this
> issue is to make a custom build of dmd with -DLOG go GFLAGS in
> linux.mak?
> 
> $ dmd | head -n 1
> Digital Mars D Compiler v2.046
> 
> $ dmd -c *.d -offoo
> dmd: interpret.c:190: Expression*
> FuncDeclaration::interpret(InterState*, Expressions*, Expression*):
> Assertion `istate' failed.
> Aborted
> 
> $ dmd -v -c *.d -offoo
<snip>

The best method is to first cut the input files down to the smallest amount of
code you can that still triggers the bug.  Do everything you can to reduce it to
a single file with no imports.  Do that before going anywhere near the compiler
internals.  For two reasons:

 1) you'll spend a lot less time fiddling around inside the compiler and debugger

 2) you'll have the test case that needs to be added to the test suite to make
sure the bug stays fixed


Another thing to do is look at bugzilla for reports that mention that same
assertion.  It might well have been reported before.

Additionally, building from svn might show that it's already fixed.  I know that
there's been fixes for a set of ctfe (aka the interpret part of dmd) checked in
this weekend from patches that Don submitted.  It wouldn't be terribly shocking
if the bug has already been fixed.

If all that fails, it's time for both a bug report and some quality time with
gdb and the dmd source.

Hope that helps,
Brad


More information about the dmd-internals mailing list