Rhino crashes when changing texture mapping if attached to RhinoDoc.TextureMappingEvent


I am experiencing a very strange crash, that happens only under very specific circumstances. Any kind of help appreciated.

Software: Windows 10, Rhino 5.0 64bit
Model: Simple model with a cube that has a texture mapping assigned.
GPU: Nvidia GTX 1060, 385.41 driver

I select the cube, go to the texture mapping panel and change some parameters of the mapping, for example the XYZ position.

Normally the event RhinoDoc.TextureMappingEvent is now fired and the texture moves in the viewport. In most cases this works like a charm, but sometimes not. I get the following error:
sometimes (but not always) preceded by

The crash happens only if I am attached to the event AND the plugin we develop is opened. It’s a renderer with a separate window which has an OpenGL context, don’t know if this can be a part of the problem.

There is more potential for crashes.

If I attach to the event, trigger the event by modifying a texture mapping, then close Rhino, I get the following error window:

The event has to do something, being empty is not enough:

        RhinoDoc.TextureMappingEvent += OnTextureMappingEvent;

    private void OnTextureMappingEvent(object sender, RhinoDoc.TextureMappingEventArgs args)
        Console.WriteLine($"Texture mapping {args.EventType} ({args.OldMapping} => {args.NewMapping})");

Have you allowed the system to send the crash report?

Yes, I did send the report.

@nathanletwory Have you been able to locate my crash report? I did not hear back from anyone regarding the report, yet.

Sorry no, I’ll let @brian and @tim check if they can find the report.

@nathanletwory Is there anything else I can do to help you locate/fix the crash?

If you can it’d be useful if you could test this scenario with Rhino WIP as well. Any fixes to this would go in the upcoming Rhino 6. AFAIK there won’t be Rhino 5 service releases for bug fixes anymore.

Behaviour in Rhino 6 - (6.0.17255.11421, 12.09.2017)

I don’t get this very easy reproducible crash on shutdown, but another thing.

If I change the texture mapping parameters very often (hold down up/down arrow key in spinner inputs), Rhino crashes after some time (approx. 100 changes)


Before it does, AppDomain.CurrentDomain.FirstChanceException reports this exception.

System.Runtime.InteropServices.SEHException (0x80004005): Eine externe Komponente hat eine Ausnahme ausgelöst.
bei UnsafeNativeMethods.ON_Object_Delete(IntPtr pObject)
bei UnsafeNativeMethods.ON_Object_Delete(IntPtr pObject)
bei Rhino.Runtime.CommonObject.Dispose(Boolean disposing)
bei Rhino.Runtime.CommonObject.Finalize()

How can I send you a crash report? Is it created if I click on close?

Top of the stack trace:

opennurbs.dll!00007ffed12e1f34() Unknown No symbols loaded.
opennurbs.dll!00007ffed12e1a27() Unknown No symbols loaded.
opennurbs.dll!00007ffed12f3999() Unknown No symbols loaded.
RhinoCore.dll!00007ffed1dcf883() Unknown No symbols loaded.
RhinoCore.dll!00007ffed1dce0e9() Unknown No symbols loaded.
RhinoCore.dll!00007ffed1c82f00() Unknown No symbols loaded.
RhinoCore.dll!00007ffed1c8345a() Unknown No symbols loaded.
mscoreei.dll!00007ffee5a85e61() Unknown No symbols loaded.
KernelBase.dll!00007fff01546913() Unknown No symbols loaded.
ntdll.dll!00007fff04d16711() Unknown No symbols loaded.
ntdll.dll!00007fff04ce9010() Unknown No symbols loaded.
ntdll.dll!00007fff04cea07d() Unknown No symbols loaded.
ntdll.dll!00007fff04c59c58() Unknown No symbols loaded.
ntdll.dll!00007fff04ce90fe() Unknown No symbols loaded.
opennurbs.dll!00007ffed15033bd() Unknown No symbols loaded.
RhinoCore.dll!00007ffed28a273c() Unknown No symbols loaded.
RhinoCore.dll!00007ffed289deb9() Unknown No symbols loaded.
RhinoCore.dll!00007ffed28bef9b() Unknown No symbols loaded.
RhinoCore.dll!00007ffed28b6940() Unknown No symbols loaded.
RhinoCore.dll!00007ffed28b817b() Unknown No symbols loaded.
mfc140u.dll!_AfxDispatchCmdMsg(CCmdTarget * pTarget, unsigned int nID, int pfn, void(CCmdTarget::*)() pExtra, void * nSig, unsigned __int64 pHandlerInfo, AFX_CMDHANDLERINFO *) Line 78 C++ Symbols loaded.
mfc140u.dll!CCmdTarget::OnCmdMsg(unsigned int nID, int nCode, void * pExtra, AFX_CMDHANDLERINFO * pHandlerInfo) Line 372 C++ Symbols loaded.
mfc140u.dll!CWnd::ReflectChildNotify(unsigned int uMsg, unsigned __int64 wParam, __int64 lParam, __int64 * pResult) Line 3474 C++ Symbols loaded.
mfc140u.dll!CWnd::SendChildNotifyLastMsg(int64 * pResult) Line 3389 C++ Symbols loaded.
* hWndChild, __int64 * pResult) Line 3426 C++ Symbols loaded.
mfc140u.dll!CWnd::OnCommand(unsigned __int64 wParam, __int64 lParam) Line 2780 C++ Symbols loaded.
mfc140u.dll!CWnd::OnWndMsg(unsigned int message, unsigned __int64 wParam, __int64 lParam, __int64 * pResult) Line 2107 C++ Symbols loaded.
mfc140u.dll!CWnd::WindowProc(unsigned int message, unsigned __int64 wParam, __int64 lParam) Line 2093 C++ Symbols loaded.

I could net provoke a crash without the Console.Writeline attached to RhinoDoc.TextureMappingEvent. So it might have to do with it.

Hi @Simon_Weinberger,

When Rhino crashes, are you submitting a crash report?

Also, are you capable of providing step-by-step instruction on how to reproduce the crash? We’d love to be able to repeat it (here).


– Dale

Create a plugin with the following code:

    protected override LoadReturnCode OnLoad(ref string errorMessage)
        RhinoDoc.TextureMappingEvent += (sender, args) =>
            Console.WriteLine($"Texture Mapping: {args.EventType} - {args.OldMapping} --> {args.NewMapping}");

        RhinoApp.WriteLine("TextureMappingEvent attached");

        return LoadReturnCode.Success;

Open RhinoWIP, load the plugin, create a cube, assign a material with a texture, apply a box mapping, click into XYZ rotation input, press and hold up arrow key. Watch the texture changing. Repeatedly click into other XYZ rotation inputs while still holding the arrow key. At some point it crashes.

It takes some time. Right now I needed to rotate from 0/0/0 to 129.8/27.5/28.5 using the up arrow key. I have the feeling it is more often crashing when I click into a rotation input during the first change than during stepping up in a single box, but I had both crashes happen.

If I debug with VS2017, it seems like I can create a crashdump from there. TextureMappingEventCrash.zip (400.5 KB)

Please let me know if I can help any further.

Btw: I can’t submit a crash report, because I don’t get such a nice window I did get in Rhino 5. I get the following crash window:


If i click Debug Visual Studio opens, clicking Close closes Rhino without any further windows showing. Also I couldn’t find an automatically created crashdump. Where can it be located?

Btw: this is my model for reproduction: CrashRepro.3dm (128.9 KB)

Hi @Simon_Weinberger,

I am able to repeat this, per your instructions. I’ve reported this bug.


– Dale


I’ve just fixed this. The fix will be in the next WIP. There’s a bug in the way the TextureMapping object is created that causes a double delete. It’s only when you access the old or new texture mapping properties that the bug arises.

Thanks for finding and reporting this.

  • Andy

RH-41505 is fixed in the latest WIP

WIP 6.0.17269.9391 works for me - both with the simple test plugin and our own plugin

Is there any change for the fix to be shipped for Rhino 5?

Hi Simon,

Sorry no. There will be no more Rhino 5 service releases.

– Dale