Windows error 0x000000BD, 189

Detailed Error Information

INVALID_STACKSEG[1]

MessageThe operating system cannot run %1.
Declared inwinerror.h

This appears to be a raw Win32 error. More information may be available in error 0x800700BD.

INVALID_HIBERNATED_STATE[2]

This is a Blue Screen of Death stop code. More information is available in the Knowledge Base article Bug Check 0xBD: INVALID_HIBERNATED_STATE.

HRESULT analysis[3]

This is probably not the correct interpretation of this error. The Win32 error above is more likely to indicate the actual problem.
FlagsSeveritySuccess

This code indicates success, rather than an error. This may not be the correct interpretation of this code, or possibly the program is handling errors incorrectly.

Reserved (R)false
OriginMicrosoft
NTSTATUSfalse
Reserved (X)false
FacilityCode0 (0x000)
NameFACILITY_NULL[3][1]
DescriptionThe default facility code.[3][1]
Error Code189 (0x00bd)

Possible solutions

1

How to diagnose a corrupted suffix pattern in a mixed managed/unmanaged x32 .NET application

c#
pinvoke
windbg
unmanaged

I finally resolved this, and found that I had made one crucial mistake. With a corrupted suffix pattern, the error will come on a free attempt, which led me to believe that it was unlikely that the allocation would have come right before the free. This was not accurate. When dealing with corruption that occurs on free, barring further information, any allocation point is equally likely. In this case, the verifier halt was coming on freeing a parameter which had been incorrectly defined as a struct of shorts instead of as a struct of ints.

Here's the offending code:

    [DllImport("gdi32.dll", CharSet = CharSet.Unicode)]
    [return: MarshalAs(UnmanagedType.Bool)]
    static extern bool GetCharABCWidths(IntPtr hdc, uint uFirstChar, uint uLastChar, [Out] ABC[] lpabc);

(This declaration is okay)

    [StructLayout(LayoutKind.Sequential)]
    public struct ABC
    {
        public short A;
        public ushort B;
        public short C;
    }

(This is not okay, per the MSDN article on the ABC struct : http://msdn.microsoft.com/en-us/library/windows/desktop/dd162454(v=vs.85).aspx )

So, if you find yourself debugging memory corruption that halts on free, keep in mind: never discount the possibility that the memory being freed was incorrectly allocated to begin with... and mind those [Out] parameters on unmanaged calls!

answered on Stack Overflow Feb 14, 2014 by ianschol
0

WinDbg with dump files when you have a classic ASP app which uses a lot of .Net via interop

.net
memory-leaks
asp-classic
windbg

You need to find the roots that holds these strings in memory. I have a few examples in my article: http://alexatnet.com/articles/net-memory-management-and-garbage-collector but generally what you might need to do is to use !gcroot command - it should traverse object graph to one of the roots that holds this object.

answered on Stack Overflow Jun 19, 2014 by Alex Netkachov
0

WinDbg with dump files when you have a classic ASP app which uses a lot of .Net via interop

.net
memory-leaks
asp-classic
windbg

There are two different heap types: native heaps (heaps of the heap manager) and managed heaps (heaps created by the .NET runtime). What you see as the output of !dumpheap is only the managed part. Since your COM objects are also using native memory, this is not included in the output.

To see the native part of the memory, try !address -summary. .NET memory will show up as <unknown> and native memory will be listed as Heap in the usage summary.

Still, !dumpheap can be helpful, e.g. to see the number of RCW objects created by your application. RCWs are not very large, therefore they might not be listed near the end of the output. Try !dumpheap -stat -type Interop to find them (if you`re using the default interop assembly).

If you know how large your COM objects are on native side, you can just multiply the number of object by the memory usage. In my typical environment, I'm using different COM objects with 5 MB to 100 MB in size, so even a few ones can cause OutOfMemoryException.

Knowing the exact size of a COM object is good for the use of GC.AddMemoryPressure which you can then use.

answered on Stack Overflow Jun 19, 2014 by Thomas Weller

Comments

Leave a comment

(plain text only)

Sources

  1. winerror.h from Windows SDK 10.0.14393.0
  2. https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/bug-check-code-reference2
  3. https://msdn.microsoft.com/en-us/library/cc231198.aspx

User contributions licensed under CC BY-SA 3.0