Page MenuHome

Multi window measure crash
Closed, ResolvedPublic

Description

Blender Version

Broken: e80cbdac331a

Short description of error

Using Measuring tool on a project that has more than one window causes a crash.

Exact steps for others to reproduce the error

  • Open
  • Select Measure from a toolbar
  • Measure in 3D view
  • Crash

Exact steps for others to reproduce the error from scratch

  • Factory Startup
  • Add New Workspace --> Layout
  • Window --> New Main Window
  • (In new window) switch to Layout.001
  • Measure in 3D View
  • Crash

Event Timeline

Sebastian Parborg (zeddb) triaged this task as Confirmed, Medium priority.

Backtrace:

Thread 1 "blender" received signal SIGSEGV, Segmentation fault.
0x0000555557805cec in BLI_findindex (listbase=0x18, vlink=0x7fffdebf8dc8) at /home/zed/prog/blender/source/blender/blenlib/intern/listbase.c:619
warning: Source file is more recent than executable.
619	  link = listbase->first;
(gdb) bt
#0  0x0000555557805cec in BLI_findindex (listbase=0x18, vlink=0x7fffdebf8dc8) at /home/zed/prog/blender/source/blender/blenlib/intern/listbase.c:619
#1  0x0000555557bd8119 in wm_gizmogroup_gizmo_register (gzgroup=0x0, gz=0x7fffdebf8dc8)
    at /home/zed/prog/blender/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c:139
#2  0x0000555557bd6637 in wm_gizmo_register (gzgroup=0x0, gz=0x7fffdebf8dc8)
    at /home/zed/prog/blender/source/blender/windowmanager/gizmo/intern/wm_gizmo.c:145
#3  0x0000555557bd64d8 in WM_gizmo_new_ptr (gzt=0x7fffe32f5788, gzgroup=0x0, properties=0x0)
    at /home/zed/prog/blender/source/blender/windowmanager/gizmo/intern/wm_gizmo.c:102
#4  0x0000555558567ed9 in ruler_item_add (gzgroup=0x0) at /home/zed/prog/blender/source/blender/editors/space_view3d/view3d_gizmo_ruler.c:145
#5  0x000055555856a8db in view3d_ruler_add_invoke (C=0x7fffe3c58188, op=0x7fffcadfe8c8, event=0x7fffc63eb908)
    at /home/zed/prog/blender/source/blender/editors/space_view3d/view3d_gizmo_ruler.c:1063
#6  0x0000555557ba0c0c in wm_operator_invoke (C=0x7fffe3c58188, ot=0x7fffde9fb608, event=0x7fffc63eb908, properties=0x7fffffffdc30, reports=0x0,
    poll_only=false, use_last_properties=false) at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:1401
#7  0x0000555557ba2beb in wm_handler_operator_call (C=0x7fffe3c58188, handlers=0x7fffca97df50, handler_base=0x7fffcada3a48, event=0x7fffc63eb908,
    properties=0x7fffffffdc30) at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:2225
#8  0x0000555557ba37c2 in wm_handlers_do_intern (C=0x7fffe3c58188, event=0x7fffc63eb908, handlers=0x7fffca97df50)
    at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:2566
#9  0x0000555557ba44d3 in wm_handlers_do (C=0x7fffe3c58188, event=0x7fffc63eb908, handlers=0x7fffca97df50)
    at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:2826
#10 0x0000555557ba5a4b in wm_event_do_handlers (C=0x7fffe3c58188) at /home/zed/prog/blender/source/blender/windowmanager/intern/wm_event_system.c:3257
#11 0x0000555557b9923c in WM_main (C=0x7fffe3c58188) at /home/zed/prog/blender/source/blender/windowmanager/intern/wm.c:418
#12 0x0000555557507daf in main (argc=1, argv=0x7fffffffe078) at /home/zed/prog/blender/source/creator/creator.c:500
Campbell Barton (campbellbarton) raised the priority of this task from Confirmed, Medium to Confirmed, High.Apr 23 2019, 2:15 AM

Basically WM_gizmomap_group_find(gzmap, view3d_gzgt_ruler_id) is returning NULL in view3d_ruler_add_invoke() in this case.

@Christopher Anderssarian (Christopher_Anderssarian) can you still reproduce it from scratch?

Although I can reproduce with your file, I cannot reproduce it if I start from a blank file.
Which steps did you take to create it? (there are many ways of creating a new window).

Note: I could not reproduce even in the old Blender mentioned in the report (5d8030b8f3cf). So it would definitively help to get the exact steps to reproduce it in a new file.

@Christopher Anderssarian (Christopher_Anderssarian) Which steps did you take to create it?

Apologies for not detailing the steps...
I still get a crash with blender-2.80.0-git.c13e10a7404d-windows64 from scratch...

Got to reproduce with your steps from scratch, thanks.

So, this seems to happen when the windows have a mismatching active tool.

In ED_gizmo_poll_or_unlink_delayed_from_tool_ex we test if tref_rt->gizmo_group != VIEW3D_GGT_ruler.
If any window doesn't have the tool, will call the free routines that will remove the ruler group from gzmap.

I still don't understand in our design why ruler and spin are added on the fly and removed. While other tools and gizmos are there permanently.
All in all the design or implementation of this poll/unlink delayed doesn't play well with multi-window.

Some comments by @Campbell Barton (campbellbarton):

We may need to adjust how gizmo maps work. Currently they're per 3D view type, which doesn't work with workspaces that have different tools.
Fixes could be...

  • Only have one window active at a time, so the active windows workspace defines the gizmo state.
  • Allow multiple tool gizmos to be active at once, then only use them when they are in a workspace which activates them through tools.

I have a fix for this however there is another issue relating to multi-window support which needs to be fixed for multiple windows to be working properly. Once T66200 is resolved, I'll commit the fix for this issue.