Debugging InvalidMemoryOperationError

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jul 11 06:01:31 PDT 2016


On Monday, 11 July 2016 at 12:42:26 UTC, Sam wrote:
> #3  0x0000000000670d53 in _d_assert ()
> #4  0x000000000053d8e2 in 
> std.typecons.__T10RefCountedTS4cram8wrappers54__T5RcPtrTS4cram6htslib10cram_sliceS15cram_free_sliceZ5RcPtr7PayloadVE3std8typecons24RefCountedAutoInitializei0Z.RefCounted.__dtor() ()


I'm not 100% sure but this is saying an assert in RefCounted's 
destructor and looking at Phobos source, there's just one:

assert(_refCounted._store._count > 0);


The stack trace also says this is being triggered from the 
garbage collector. Do you have a dynamic array of RefCounted 
objects, or one inside a class object?


I'm not sure as to the nature of the bug but refcounted inside a 
GC object isn't going to work well anyway.

> * the wiki suggests that you need a debug build of the standard 
> library to get accurate stack traces. is this just for line 
> numbers or could the stack be completely wrong?

just line numbers and I don't think it even applies here since it 
is a template.


More information about the Digitalmars-d-learn mailing list