Wintab crash on window close. #85799

Closed
opened 2021-02-19 19:55:56 +01:00 by Ernesto Méndez · 22 comments

System Information
Operating system: Windows 10
Graphics card: Nvidia Quadro P5000

Blender Version
Broken: 2.91.2
Worked: N/A

OBJ Importer crashes while attempting to import OBJ file.

Steps to reproduce:

  1. Download attached OBJ
  2. File > Import > Wavefront (obj)
  3. Select OBJ, click "Import OBJ"

Actual Behavior:
Blender crashes.

Expected Behavior:
The OBJ file is imported successfully.


testPM3D_Sphere3D1.zip

**System Information** Operating system: Windows 10 Graphics card: Nvidia Quadro P5000 **Blender Version** Broken: 2.91.2 Worked: N/A OBJ Importer crashes while attempting to import OBJ file. **Steps to reproduce:** 1. Download attached OBJ 2. File > Import > Wavefront (obj) 3. Select OBJ, click "Import OBJ" **Actual Behavior:** Blender crashes. **Expected Behavior:** The OBJ file is imported successfully. --- [testPM3D_Sphere3D1.zip](https://archive.blender.org/developer/F9818660/testPM3D_Sphere3D1.zip)

Added subscriber: @mendezcode

Added subscriber: @mendezcode

#86039 was marked as duplicate of this issue

#86039 was marked as duplicate of this issue

Added subscriber: @StephenSwaney

Added subscriber: @StephenSwaney

Imports fine here. Linux 2.92.0 RC and 2.91.2
I suspect a local problem.
Any interesting error messages?

Imports fine here. Linux 2.92.0 RC and 2.91.2 I suspect a local problem. Any interesting error messages?

Seems like it's something with my system... You know what... I should've provided you with more debugging info, my bad.

Here's what I get when I run it from the console:

Read prefs: C:\Users\me\AppData\Roaming\Blender Foundation\Blender\2.91\config\userpref.blend
found bundled python: C:\Programs\blender\2.91\python
Error   : EXCEPTION_ACCESS_VIOLATION
Address : 0x00007FF8E52427DA
Module  : Wintab32.dll
Thread  : 000056c4
Writing: C:\Users\me\AppData\Local\Temp\blender.crash.txt```

I think this may be an isolated issue on my system if it imports fine for you. I haven't updated Windows in a while to keep it running stable, so this may be the cause.

In any case, I have attached the crash report.

[blender.crash.txt.zip](https://archive.blender.org/developer/F9823628/blender.crash.txt.zip)

Thanks!
Seems like it's something with my system... You know what... I should've provided you with more debugging info, my bad. Here's what I get when I run it from the console: ```PS C:\Programs\blender> .\blender.exe Read prefs: C:\Users\me\AppData\Roaming\Blender Foundation\Blender\2.91\config\userpref.blend found bundled python: C:\Programs\blender\2.91\python Error : EXCEPTION_ACCESS_VIOLATION Address : 0x00007FF8E52427DA Module : Wintab32.dll Thread : 000056c4 Writing: C:\Users\me\AppData\Local\Temp\blender.crash.txt``` I think this may be an isolated issue on my system if it imports fine for you. I haven't updated Windows in a while to keep it running stable, so this may be the cause. In any case, I have attached the crash report. [blender.crash.txt.zip](https://archive.blender.org/developer/F9823628/blender.crash.txt.zip) Thanks!

Update: I have installed the latest GPU drivers, but it seems this is related to the tablet drivers (based on searches for wintab32.dll)... I do use a tablet screen, so I think this may have something to do with Wacom's drivers or something...

Update: I have installed the latest GPU drivers, but it seems this is related to the tablet drivers (based on searches for wintab32.dll)... I do use a tablet screen, so I think this may have something to do with Wacom's drivers or something...

Changed status from 'Needs Triage' to: 'Resolved'

Changed status from 'Needs Triage' to: 'Resolved'
Ernesto Méndez self-assigned this 2021-02-21 03:18:15 +01:00

Sooo.... I was able to fix it! This actually is not a localized problem but it does seem like a bug.

I was able to import fine after setting the Tablet API to "Windows Ink" on Preferences > Input.

2021-02-20 22-14-30.png

That being said, this doesn't seem to be a bug with the OBJ importer per se, but this highlights another possible bug which involves Blender crashing when using "WinTab" as tablet API for some reason.

In any case, I'm glad it's solved, thanks again!

Sooo.... I was able to fix it! This actually is not a localized problem but it does seem like a bug. I was able to import fine after setting the Tablet API to "Windows Ink" on Preferences > Input. ![2021-02-20 22-14-30.png](https://archive.blender.org/developer/F9823692/2021-02-20_22-14-30.png) That being said, this doesn't seem to be a bug with the OBJ importer per se, but this highlights another possible bug which involves Blender crashing when using "WinTab" as tablet API for some reason. In any case, I'm glad it's solved, thanks again!
Member

Added subscribers: @PrototypeNM1, @ankitm

Added subscribers: @PrototypeNM1, @ankitm
Member
CC @PrototypeNM1

Changed status from 'Resolved' to: 'Confirmed'

Changed status from 'Resolved' to: 'Confirmed'

What's happening here is that while the window is being destroyed, it closes the Wintab context via WTClose. The Wintab library must be calling one of the Win32 functions which allows callbacks to the Windows event loop to run, which calls an event which uses Wintab after it's closed and while Ghost's window is half torn down.

The solution here is to not trust Wintab when tearing down the window to not reenter, and close before the GHOST_WindowWin32's destructor. Reopening as this is a legitimate issue.

Edit: The issue is reentrancy while GHOST_WindowWin32 is being torn down, but it's not Wintab that triggers it, Wintab being passed a closed context is just the last step. Looks like it's the call to DestroyWindow from the stack trace.

Edit2: Without logging with the specific device, it could be quite difficult to narrow down the exact cause. E.g. it could be that the Wintab library is not handling multiple contexts for a single process correctly and thus closing the wrong one, or reentrancy is causing a half-destroyed window with closed Wintab context to crash.

~~What's happening here is that while the window is being destroyed, it closes the Wintab context via WTClose. The Wintab library must be calling one of the Win32 functions which [allows callbacks to the Windows event loop to run](https://docs.microsoft.com/en-us/windows/win32/winauto/guarding-against-reentrancy-in-hook-functions), which calls an event which uses Wintab after it's closed and while Ghost's window is half torn down.~~ ~~The solution here is to not trust Wintab when tearing down the window to not reenter, and close before the GHOST_WindowWin32's destructor. Reopening as this is a legitimate issue.~~ Edit: The issue is reentrancy while GHOST_WindowWin32 is being torn down, but it's not Wintab that triggers it, Wintab being passed a closed context is just the last step. Looks like it's the call to DestroyWindow from the stack trace. Edit2: Without logging with the specific device, it could be quite difficult to narrow down the exact cause. E.g. it could be that the Wintab library is not handling multiple contexts for a single process correctly and thus closing the wrong one, or reentrancy is causing a half-destroyed window with closed Wintab context to crash.
Ernesto Méndez was unassigned by Ankit Meel 2021-02-21 07:38:43 +01:00
Nicholas Rishel self-assigned this 2021-02-21 08:06:56 +01:00

Added subscribers: @kamiyu1031, @rjg

Added subscribers: @kamiyu1031, @rjg
Nicholas Rishel changed title from OBJ Importer Crash to Wintab crash on window close. 2021-03-02 19:26:04 +01:00

@mendezcode @kamiyu1031 Could you recreate the crash in this build, copy the content of blender_debug_output.txt to this link, and link the result here?

@mendezcode @kamiyu1031 Could you recreate the crash in [this build](https:*builder.blender.org/download/T85799/T85799-blender-2.93.0-577577bd6d3a-windows64.zip), copy the content of blender_debug_output.txt to [this link](https:*developer.blender.org/paste/edit/form/default/), and link the result here?

Changed status from 'Confirmed' to: 'Needs User Info'

Changed status from 'Confirmed' to: 'Needs User Info'

@PrototypeNM1 Tested and crash persists, here's the paste: https://developer.blender.org/P2009

@PrototypeNM1 Tested and crash persists, here's the paste: https://developer.blender.org/P2009
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

Could you upload C:\Users\mdz\AppData\Local\Temp\blender.crash.txt ?

Could you upload `C:\Users\mdz\AppData\Local\Temp\blender.crash.txt` ?

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

@mendezcode Could you confirm is the issue is still present in current daily builds ? There were a lot of recent changes with how Wintab opened and closed in Blender which should resolve any issues.

@mendezcode Could you confirm is the issue is still present in [current daily builds ](https://builder.blender.org/download/daily/blender-3.0.0-alpha+master.e3bdb189a777-windows.amd64-release.zip)? There were a lot of recent changes with how Wintab opened and closed in Blender which should resolve any issues.

@PrototypeNM1 tested and the issue is no longer present, it has been fixed.

@PrototypeNM1 tested and the issue is no longer present, it has been fixed.
Member

Changed status from 'Needs User Info' to: 'Resolved'

Changed status from 'Needs User Info' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#85799
No description provided.