I finally got a stack trace on my InvalidMemoryOperationError

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 4 17:22:23 PDT 2015


On Friday, 5 June 2015 at 00:04:00 UTC, Etienne wrote:
> On Thursday, 4 June 2015 at 23:59:11 UTC, Vladimir Panteleev 
> wrote:
>> On Thursday, 4 June 2015 at 23:56:28 UTC, Etienne wrote:
>>> [...]
>>
>> I don't understand what you're grieving about, but:
>>
>> 1. We can't show a stack trace in an 
>> InvalidMemoryOperationError situation because we need to 
>> allocate memory for the stack trace, which we can't do in an 
>> InvalidMemoryOperationError situation.
>>
>> 2. Hope this helps: 
>> http://wiki.dlang.org/InvalidMemoryOperationError
>
> Apparently GDB couldn't stack trace the error with symbols, was
> limited to 2 frames without symbols:
> http://forum.dlang.org/thread/joefjvuxpvwsfozvykgu@forum.dlang.org#post-rpnmeklflyzodhfehari:40forum.dlang.org
> http://forum.dlang.org/thread/joefjvuxpvwsfozvykgu@forum.dlang.org?page=2#post-pjntbqmxjbyxiwevdlra:40forum.dlang.org
>
> The error also didn't occur in Windows so I couldn't use that.

Couldn't use what? The article provides information for both 
Windows and Linux.

> I think you're mixing up the "invalid state" and "unusable". 
> The GC is fully usable for the purpose of throwing, because I 
> got a 35 frame stack trace from it.

Invalid state == unusable. We need to be extremely careful in 
memory corruption conditions. For example, if the application has 
a memory-mapped file, we can corrupt data on disk if we're 
careless.


More information about the Digitalmars-d mailing list