Crash when moving ruler endpoints and opening or closing the toolshelf #83161

Closed
opened 2020-11-28 21:11:13 +01:00 by Stefano Bonicatti · 7 comments

System Information
Operating system: Linux-5.9.10-arch1-1-x86_64-with-arch 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 455.45.01

Blender Version
Broken: version: 2.90.0 alpha, branch: blender-v2.90-release, commit: 4387aff99e
Broken: version: 2.91.0, branch: blender-v2.91-release (built from source)
Broken: version: 2.91.0 (official release)
Broken: version: 2.92.0-fbdf1af35550 (daily build)
Worked: 2.83.8

Short description of error
When one opens or closes the toolshelf and immediately or shortly after tries to move an unselected endpoint of a ruler, Blender crashes.

Exact steps for others to reproduce the error

  1. Open blender with a default scene, toolshelf is open
  2. Click the measure tool on the toolshelf, draw the ruler
  3. Close the shelf via the T shortcut, the ruler gets unselected
  4. Keep the mouse near one of the endpoint, to be quick
  5. Open the toolshelf via the T shortcut and without waiting for it to be fully out, try to move one of the endpoints

You should be pretty fast with the two operations to reproduce this, rarely it doesn't reproduce, and sometimes it reproduces even after the toolshelf is fully out.
Some other time maybe you move the endpoint too early and the toolshelf doesn't come out, so it doesn't reproduce.

Since I have built it from source too (RelWithDebInfo) I have a stack trace:

- 0  0x00005555582f2359 in invert_snap (snap_gizmo=0x7fffd09fdc08, wm=0x7ffff4b55808, event=0x7fffd6c2f988) at /home/smjert/Development/blender/src/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c:83
- 1  ED_gizmotypes_snap_3d_update (gz=gz@entry=0x7fffd09fdc08, depsgraph=depsgraph@entry=0x7ffff01d2a08, region=0x7ffff4bd6188, v3d=v3d@entry=0x7ffff4b44c08, wm=0x7ffff4b55808, mval_fl=0x7fffffffdb6c, mval_fl@entry=0x7fffffffdb5c,
    r_loc=0x7fffca77b3f0, r_nor=0x0) at /home/smjert/Development/blender/src/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c:258
#2  0x0000555557a00a83 in view3d_ruler_item_mousemove (depsgraph=0x7ffff01d2a08, ruler_info=ruler_info@entry=0x7fffd00ecec8, ruler_item=<optimized out>, ruler_item@entry=0x7fffca77b288, mval=<optimized out>, mval@entry=0x7fffd0548aa4,
    do_thickness=<optimized out>) at /home/smjert/Development/blender/src/source/blender/editors/space_view3d/view3d_gizmo_ruler.c:391
#3  0x00005555579ffcc6 in gizmo_ruler_modal (C=C@entry=0x7ffff4524e48, gz=0x7fffca77b288, event=<optimized out>, event@entry=0x7fffd0548a88, tweak_flag=<optimized out>)
    at /home/smjert/Development/blender/src/source/blender/editors/space_view3d/view3d_gizmo_ruler.c:954
- 4  0x0000555556fe1b0e in gizmo_tweak_modal (C=0x7ffff4524e48, op=0x7fffd05bbc48, event=0x7fffd0548a88) at /home/smjert/Development/blender/src/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c:555
- 5  0x0000555556fbf128 in wm_handler_operator_call (C=C@entry=0x7ffff4524e48, handlers=handlers@entry=0x7ffff4b5e798, handler_base=handler_base@entry=0x7fffd00ece08, event=event@entry=0x7fffd0548a88, properties=<optimized out>,
    properties@entry=0x0, kmi_idname=kmi_idname@entry=0x0) at /home/smjert/Development/blender/src/source/blender/windowmanager/intern/wm_event_system.c:2022
#6  0x0000555556fbe21d in wm_handlers_do_intern (C=<optimized out>, C@entry=0x7ffff4524e48, event=<optimized out>, event@entry=0x7fffd0548a88, handlers=<optimized out>, handlers@entry=0x7ffff4b5e798)
    at /home/smjert/Development/blender/src/source/blender/windowmanager/intern/wm_event_system.c:2803
#7  0x0000555556fba08c in wm_handlers_do (C=C@entry=0x7ffff4524e48, event=event@entry=0x7fffd0548a88, handlers=handlers@entry=0x7ffff4b5e798)
    at /home/smjert/Development/blender/src/source/blender/windowmanager/intern/wm_event_system.c:2851
- 8  0x0000555556fb95c1 in wm_event_do_handlers (C=C@entry=0x7ffff4524e48) at /home/smjert/Development/blender/src/source/blender/windowmanager/intern/wm_event_system.c:3274
- 9  0x0000555556fb4140 in WM_main (C=0x7ffff4524e48) at /home/smjert/Development/blender/src/source/blender/windowmanager/intern/wm.c:476
#10 0x0000555556bc7804 in main (argc=1, argv=0x7fffffffe218) at /home/smjert/Development/blender/src/source/creator/creator.c:519

The part of code in the last stack frame is:

 80 #ifdef USE_SNAP_DETECT_FROM_KEYMAP_HACK
 81 static bool invert_snap(SnapGizmo3D *snap_gizmo, const wmWindowManager *wm, const wmEvent *event)
 82 {
 83   wmKeyMap *keymap = WM_keymap_active(wm, snap_gizmo->keymap);
 84 
 85   const int snap_on = snap_gizmo->snap_on;
 86   for (wmKeyMapItem *kmi = keymap->items.first; kmi; kmi = kmi->next) {
 87     if (kmi->flag & KMI_INACTIVE) {
 88       continue;
 89     }

and snap_gizmo->keymap seems to be NULL when it crashes, so I guess it actually crashes in the for, since the WM_keymap_active seems to handle the NULL case by returning NULL.

**System Information** Operating system: Linux-5.9.10-arch1-1-x86_64-with-arch 64 Bits Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 455.45.01 **Blender Version** Broken: version: 2.90.0 alpha, branch: blender-v2.90-release, commit: 4387aff99e01c412a360d412bf78d8bc913d4401 Broken: version: 2.91.0, branch: blender-v2.91-release (built from source) Broken: version: 2.91.0 (official release) Broken: version: 2.92.0-fbdf1af35550 (daily build) Worked: 2.83.8 **Short description of error** When one opens or closes the toolshelf and immediately or shortly after tries to move an unselected endpoint of a ruler, Blender crashes. **Exact steps for others to reproduce the error** 1) Open blender with a default scene, toolshelf is open 2) Click the measure tool on the toolshelf, draw the ruler 3) Close the shelf via the T shortcut, the ruler gets unselected 4) Keep the mouse near one of the endpoint, to be quick 5) Open the toolshelf via the T shortcut and without waiting for it to be fully out, try to move one of the endpoints You should be pretty fast with the two operations to reproduce this, rarely it doesn't reproduce, and sometimes it reproduces even after the toolshelf is fully out. Some other time maybe you move the endpoint too early and the toolshelf doesn't come out, so it doesn't reproduce. Since I have built it from source too (RelWithDebInfo) I have a stack trace: ``` - 0 0x00005555582f2359 in invert_snap (snap_gizmo=0x7fffd09fdc08, wm=0x7ffff4b55808, event=0x7fffd6c2f988) at /home/smjert/Development/blender/src/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c:83 - 1 ED_gizmotypes_snap_3d_update (gz=gz@entry=0x7fffd09fdc08, depsgraph=depsgraph@entry=0x7ffff01d2a08, region=0x7ffff4bd6188, v3d=v3d@entry=0x7ffff4b44c08, wm=0x7ffff4b55808, mval_fl=0x7fffffffdb6c, mval_fl@entry=0x7fffffffdb5c, r_loc=0x7fffca77b3f0, r_nor=0x0) at /home/smjert/Development/blender/src/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c:258 #2 0x0000555557a00a83 in view3d_ruler_item_mousemove (depsgraph=0x7ffff01d2a08, ruler_info=ruler_info@entry=0x7fffd00ecec8, ruler_item=<optimized out>, ruler_item@entry=0x7fffca77b288, mval=<optimized out>, mval@entry=0x7fffd0548aa4, do_thickness=<optimized out>) at /home/smjert/Development/blender/src/source/blender/editors/space_view3d/view3d_gizmo_ruler.c:391 #3 0x00005555579ffcc6 in gizmo_ruler_modal (C=C@entry=0x7ffff4524e48, gz=0x7fffca77b288, event=<optimized out>, event@entry=0x7fffd0548a88, tweak_flag=<optimized out>) at /home/smjert/Development/blender/src/source/blender/editors/space_view3d/view3d_gizmo_ruler.c:954 - 4 0x0000555556fe1b0e in gizmo_tweak_modal (C=0x7ffff4524e48, op=0x7fffd05bbc48, event=0x7fffd0548a88) at /home/smjert/Development/blender/src/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c:555 - 5 0x0000555556fbf128 in wm_handler_operator_call (C=C@entry=0x7ffff4524e48, handlers=handlers@entry=0x7ffff4b5e798, handler_base=handler_base@entry=0x7fffd00ece08, event=event@entry=0x7fffd0548a88, properties=<optimized out>, properties@entry=0x0, kmi_idname=kmi_idname@entry=0x0) at /home/smjert/Development/blender/src/source/blender/windowmanager/intern/wm_event_system.c:2022 #6 0x0000555556fbe21d in wm_handlers_do_intern (C=<optimized out>, C@entry=0x7ffff4524e48, event=<optimized out>, event@entry=0x7fffd0548a88, handlers=<optimized out>, handlers@entry=0x7ffff4b5e798) at /home/smjert/Development/blender/src/source/blender/windowmanager/intern/wm_event_system.c:2803 #7 0x0000555556fba08c in wm_handlers_do (C=C@entry=0x7ffff4524e48, event=event@entry=0x7fffd0548a88, handlers=handlers@entry=0x7ffff4b5e798) at /home/smjert/Development/blender/src/source/blender/windowmanager/intern/wm_event_system.c:2851 - 8 0x0000555556fb95c1 in wm_event_do_handlers (C=C@entry=0x7ffff4524e48) at /home/smjert/Development/blender/src/source/blender/windowmanager/intern/wm_event_system.c:3274 - 9 0x0000555556fb4140 in WM_main (C=0x7ffff4524e48) at /home/smjert/Development/blender/src/source/blender/windowmanager/intern/wm.c:476 #10 0x0000555556bc7804 in main (argc=1, argv=0x7fffffffe218) at /home/smjert/Development/blender/src/source/creator/creator.c:519 ``` The part of code in the last stack frame is: ``` 80 #ifdef USE_SNAP_DETECT_FROM_KEYMAP_HACK 81 static bool invert_snap(SnapGizmo3D *snap_gizmo, const wmWindowManager *wm, const wmEvent *event) 82 { 83 wmKeyMap *keymap = WM_keymap_active(wm, snap_gizmo->keymap); 84 85 const int snap_on = snap_gizmo->snap_on; 86 for (wmKeyMapItem *kmi = keymap->items.first; kmi; kmi = kmi->next) { 87 if (kmi->flag & KMI_INACTIVE) { 88 continue; 89 } ``` and `snap_gizmo->keymap` seems to be NULL when it crashes, so I guess it actually crashes in the for, since the `WM_keymap_active` seems to handle the NULL case by returning NULL.

Added subscriber: @Smjert

Added subscriber: @Smjert

Added subscriber: @mano-wii

Added subscriber: @mano-wii

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

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

Thanks for the report, I can confirm.

Thanks for the report, I can confirm.

This issue was referenced by 68f355fbee

This issue was referenced by 68f355fbee93515f83b060214776e73f775e1f07

This issue was referenced by c576d65c2f

This issue was referenced by c576d65c2f96b1b2e6ac9437a950082c9a2a753b

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Germano Cavalcante self-assigned this 2020-12-02 14:27:55 +01:00
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
3 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#83161
No description provided.