Page MenuHome

2.80 Crash on selecting an entire collection and snappping cursor to active.
Closed, ResolvedPublic

Description

System Information

Operating system: Ubuntu 18.04.1 LTS
Graphics card: GeForce GTX 960M/PCIe/SSE2

Blender Version
Broken: 2.80, 81ea815dcb6, blender2.8, 2018-12-12 23:51
Worked: 2.80, b87b6e8e289, blender2.8, 2018-12-12 00:16

Short description of error

Blender crashes when selecting an entire collection and attempting to snap cursor to active.
Unfortunetly I was unable to reproduce the crash on a new clean file, thus I will attach the one which crashes hoping that it will help you isolate the problem.
I tested the same blend file, and same steps, on 2 different 2.80 builds from the same day, and only the second one crashed.

Exact steps for others to reproduce the

After opening the file, and without clicking on anything (looks like the issue might be related to the fact that nothing is currently active), do the following

  1. Right click on the collection named Ball, and on the menu click Select Objects
  2. Object -> Snap -> Cursor to active

After that, 81ea815dcb6 crashes at least on my system.

Please let me know if I can provide any additional information.


Best regards,
Paolo

Event Timeline

Confirmed with a build from today.

ob is nullptr below (from view3d_snap.c)

static bool snap_calc_active_center(bContext *C, const bool select_only, float r_center[3])
{
	Object *ob = CTX_data_active_object(C);
	return ED_object_calc_active_center(ob, select_only, r_center);
}

I can repro with the default scene as follows:

  • Start with default scene
  • Create a new collection (any name will do)
  • Create a cube in that new collection, and immediately delete it
    • At this point no _active_ object will be tracked
  • Right-Click on the original "Collection" which is still present and Select Objects
  • SHIFT-S -> Cursor to Active
    • Crash
Sebastian Parborg (zeddb) triaged this task as Confirmed, Medium priority.Dec 19 2018, 1:48 PM

I can reproduce this as well.

Backtrace:

Thread 1 "blender" received signal SIGSEGV, Segmentation fault.
0x000055555757a540 in ED_object_calc_active_center (ob=0x0, select_only=false, r_center=0x7fffeab730e0)
    at /home/zed/programmering/blender_master/blender/source/blender/editors/object/object_utils.c:130
130		if (ob->mode & OB_MODE_EDIT) {
(gdb) bt
#0  0x000055555757a540 in ED_object_calc_active_center (ob=0x0, select_only=false, r_center=0x7fffeab730e0)
    at /home/zed/programmering/blender_master/blender/source/blender/editors/object/object_utils.c:130
#1  0x00005555571bc50e in snap_calc_active_center (C=0x7fffefc30288, select_only=false, r_center=0x7fffeab730e0)
    at /home/zed/programmering/blender_master/blender/source/blender/editors/space_view3d/view3d_snap.c:762
#2  0x00005555571bc55c in snap_curs_to_active_exec (C=0x7fffefc30288, UNUSED_op=0x7fffd4463bc8)
    at /home/zed/programmering/blender_master/blender/source/blender/editors/space_view3d/view3d_snap.c:770
#3  0x000055555704e00d in wm_operator_invoke (C=0x7fffefc30288, ot=0x7fffea9ba7c8, event=0x7fffe8e22c88, properties=0x7fffffffd570, reports=0x0,
    poll_only=false, use_last_properties=true) at /home/zed/programmering/blender_master/blender/source/blender/windowmanager/intern/wm_event_system.c:1337
#4  0x000055555704e6aa in wm_operator_call_internal (C=0x7fffefc30288, ot=0x7fffea9ba7c8, properties=0x7fffffffd570, reports=0x0, context=1, poll_only=false,
    event=0x7fffe8e22c88) at /home/zed/programmering/blender_master/blender/source/blender/windowmanager/intern/wm_event_system.c:1534
#5  0x000055555704e8cd in WM_operator_name_call_ptr (C=0x7fffefc30288, ot=0x7fffea9ba7c8, context=1, properties=0x7fffffffd570)
    at /home/zed/programmering/blender_master/blender/source/blender/windowmanager/intern/wm_event_system.c:1582
#6  0x0000555557386394 in ui_apply_but_funcs_after (C=0x7fffefc30288)
    at /home/zed/programmering/blender_master/blender/source/blender/editors/interface/interface_handlers.c:769
#7  0x000055555739f223 in ui_popup_handler (C=0x7fffefc30288, event=0x7fffd4448508, userdata=0x7fffd4b19608)
    at /home/zed/programmering/blender_master/blender/source/blender/editors/interface/interface_handlers.c:9885
#8  0x000055555704bd6e in wm_handler_ui_call (C=0x7fffefc30288, handler=0x7fffd4463bc8, event=0x7fffd4448508, always_pass=0)
    at /home/zed/programmering/blender_master/blender/source/blender/windowmanager/intern/wm_event_system.c:573
#9  0x0000555557050938 in wm_handlers_do_intern (C=0x7fffefc30288, event=0x7fffd4448508, handlers=0x7fffeaacb9a0)
    at /home/zed/programmering/blender_master/blender/source/blender/windowmanager/intern/wm_event_system.c:2374
#10 0x0000555557051301 in wm_handlers_do (C=0x7fffefc30288, event=0x7fffd4448508, handlers=0x7fffeaacb9a0)
    at /home/zed/programmering/blender_master/blender/source/blender/windowmanager/intern/wm_event_system.c:2607
#11 0x00005555570526b8 in wm_event_do_handlers (C=0x7fffefc30288)
    at /home/zed/programmering/blender_master/blender/source/blender/windowmanager/intern/wm_event_system.c:2997
#12 0x0000555557047429 in WM_main (C=0x7fffefc30288) at /home/zed/programmering/blender_master/blender/source/blender/windowmanager/intern/wm.c:427
#13 0x0000555557041d8e in main (argc=1, argv=0x7fffffffdd28) at /home/zed/programmering/blender_master/blender/source/creator/creator.c:521

I've uploaded a quick fix to D4102