Page MenuHome

Appending Collections to a new empty file and trying to save that file causes Blender to crash [cause identified!]
Confirmed, NormalPublicBUG

Description

System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: GeForce GTX 1070 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 441.87

Blender Version
Broken: version: 2.82 (sub 6), branch: master, commit date: 2020-01-21 19:12, hash: rBbda0c0847b5e (broken also in 2.81a)
Worked: (optional)

Short description of error
Appending all Collections from this specific blend-file to a completely new and empty file and then trying to save that new file, causes Blender to crash without giving any errors messages.

Exact steps for others to reproduce the error

  1. Create new empty file of General type.
  2. Delete all other objects in that file but leave Camera in
  3. Go to File > Append.
  4. Select the attached blend-file and from that blend-file, choose to append all the Collections that are in it. Note: append menu has "Localize all" setting enabled.
  5. After succesfully appending the Collections, try to save the current blend-file. Blender should now crash

Note: A difference I noticed between 2.81a and 2.82 beta: after appending the Collections in 2.82, there appears to be a link between the new blend-file and the one that you appended the Collections from. You can see this link in the Outliner-panel if you click "Display mode" drop down menu and select "Blender file" (icon with three images on top of each other). Why does blender create such link between these two files, especially if "Localize all" is selected? This link prevents from saving over the original blend-file, if you try to do that.

Event Timeline

NKO (NKO) changed the visibility from "Public (No Login Required)" to "All Users".
NKO (NKO) updated the task description. (Show Details)Fri, Jan 24, 7:16 PM

Possible cause identified: in the attached blend-file, I had saved it while the object "Sphere" (in "Hahmo" collection) is in sculpt mode. If I exit the sculpt mode, save the blend file, and then follow the steps as described in the bug report, Blender no longer crashes while saving the new file. Curiously enough, when the original blend-file is saved while "Sphere" object is in Sculpt mode, one cannot even select that "Sphere" in the new file that it is appended to, as Blender says "No active object found".

NKO (NKO) renamed this task from Appending Collections to a new empty file and trying to save that file causes Blender to crash to Appending Collections to a new empty file and trying to save that file causes Blender to crash [cause identified!] .Fri, Jan 24, 7:29 PM

I can confirm the bug on Ubuntu. I can crash it in 2.81a (from apt) or in the daily build from the buildbot (24 Jan 2020). I haven't noticed any differences in behaviour except that 2.82 shows the unusual linked data in the Blend File section of the outliner, whereas 2.81a does not; however they both create the link and show it in the Data API section (more on that below).

The 2.82 I'm using:
version: 2.82 (sub 6), branch: master, commit date: 2020-01-24 11:47, hash: 18343c230d2c, type: Release
build date: 2020-01-24, 11:52:37
The simple .blends I'm using:

Here's my crash log from reproducing the bug as described above:

# Blender 2.82 (sub 6), Commit date: 2020-01-24 11:47, Hash 18343c230d2c
bpy.ops.object.select_all(action='SELECT')  # Operator
bpy.ops.object.delete(use_global=False)  # Operator
Deleted 3 object(s)  # Info
bpy.ops.outliner.item_activate(extend=False, deselect_all=True)  # Operator
bpy.ops.outliner.collection_delete(hierarchy=False)  # Operator
bpy.context.space_data.bookmarks_active = 0  # Property
bpy.context.space_data.system_bookmarks_active = 0  # Property
bpy.context.space_data.params.filename = "before.blend"  # Property
bpy.context.space_data.recent_folders_active = 0  # Property
bpy.context.space_data.display_mode = 'DATA_API'  # Property
bpy.context.space_data.params.filename = "save_maybe.blend"  # Property

# backtrace
./blender(BLI_system_backtrace+0x1d) [0x6fb801d]
./blender() [0x16575b9]
/lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f0753d91f20]
./blender(ED_editors_flush_edits_ex+0xae) [0x5d14bee]
./blender() [0x1828286]
./blender() [0x18209d3]
./blender() [0x1823bcb]
./blender() [0x1824d5c]
./blender(wm_event_do_handlers+0x312) [0x1825432]
./blender(WM_main+0x20) [0x181b680]
./blender(main+0x317) [0x159dca7]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f0753d74b97]
./blender() [0x1653e6c]

The crash still occurs after running user_clear() on the library datablock. The crash even occurs after right-clicking the library and deleting it in the outliner. I haven't been able to find a way to remap the users and prevent a crash, so I think that's not possible either.

I''m doing some tests, and it looks like there are indeed some weird behaviours. Check this out:


In the Data API section of the outliner, I can keep opening the Original ID tab forever! It looks like the one user of this library datablock is the library itself.
Appending a multi-res object in sculpt mode is particularly weird: the object appears in the outliner, but not in the viewport. It's invisible! I can select the object itself from the outliner, but I cannot make it the active object. I can enter edit mode on the object by clicking on its mesh in the outliner. When I re-enter object mode, it will then show up in the viewport with the modifier as a completely normal object. This file will no longer crash when I save.
When I append a simple mesh that was saved in sculpt mode, the mesh object is again impossible to make the active selection in the viewport, although it is selectable and visible. I can't mode-switch with the pie-menu or the menu in the 3D view, but using the outliner to force it into edit mode works as normal, prevents the crash and restores normal behavior, as it does in Multires.
The behaviour for dyntopo is exactly the same, except entering edit mode causes a crash instead of preventing one:

# Blender 2.82 (sub 6), Commit date: 2020-01-24 11:47, Hash 18343c230d2c
'/home/theangerspecialist/My Stuff/bug-testing-playground/before.blend': not a library  # Error
bpy.ops.outliner.item_activate(extend=False, deselect_all=True)  # Operator

# backtrace
./blender(BLI_system_backtrace+0x1d) [0x6fb801d]
./blender() [0x16575b9]
/lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f55d8e5df20]
./blender() [0x1da7377]
./blender(ED_object_sculptmode_exit_ex+0x4e) [0x1da820e]
./blender() [0x1da82d1]
./blender() [0x181fedb]
./blender() [0x1820147]
./blender(WM_operator_name_call_ptr+0x1a) [0x182054a]
./blender(ED_object_mode_compat_set+0x40) [0x1d24020]
./blender() [0x1d2156e]
./blender() [0x181fedb]
./blender() [0x1820147]
./blender(WM_operator_name_call_ptr+0x1a) [0x182054a]
./blender() [0x1efc2d3]
./blender() [0x181fc6d]
./blender() [0x18225b7]
./blender() [0x1823250]
./blender() [0x182509e]
./blender(wm_event_do_handlers+0x4f5) [0x1825615]
./blender(WM_main+0x20) [0x181b680]
./blender(main+0x317) [0x159dca7]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f55d8e40b97]
./blender() [0x1653e6c]

Interestingly, appending just the object doesn't seem to cause a crash, although it still creates the unwanted link. I was able to cause the crash by appending the Scene and saving.

Note that in the cases where I was able to prevent the crash, the link is gone when I reopen the file, it seems the garbage collection is able to catch it after the object's mode is reset.

Linking instead of appending still crashes. Oddly enough, trying to enter edit mode on the linked-in mesh from the outliner now enters sculpt mode *in a linked datablock.* That's weird. Here's the crash log for trying to use sculpt tools in this bizzare state:

# Blender 2.81 (sub 16), Commit date: 2019-11-20 14:27, Hash 26bd5ebd42e3
bpy.ops.outliner.item_activate(extend=False, deselect_all=True)  # Operator
bpy.context.space_data.display_mode = 'LIBRARIES'  # Property
bpy.ops.outliner.item_activate(extend=False, deselect_all=True)  # Operator
bpy.ops.outliner.collection_link()  # Operator
bpy.context.space_data.display_mode = 'VIEW_LAYER'  # Property
bpy.ops.outliner.item_activate(extend=False, deselect_all=True)  # Operator
bpy.ops.object.delete(use_global=False)  # Operator
Deleted 1 object(s)  # Info
bpy.ops.outliner.item_activate(extend=False, deselect_all=True)  # Operator
bpy.ops.outliner.item_activate(extend=False, deselect_all=True)  # Operator
bpy.ops.outliner.item_activate(extend=False, deselect_all=True)  # Operator
bpy.ops.outliner.item_activate(extend=False, deselect_all=True)  # Operator
bpy.ops.outliner.item_activate(extend=False, deselect_all=True)  # Operator

# backtrace
/snap/blender/34/./blender(BLI_system_backtrace+0x1d) [0x14ee85d]
/snap/blender/34/./blender() [0x12cbb79]
/lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f3fdfba6f20]
/snap/blender/34/./blender() [0x2f5faff]
/snap/blender/34/./blender() [0x2f6267a]
/snap/blender/34/./blender() [0x16a2cdd]
/snap/blender/34/./blender() [0x16a547a]
/snap/blender/34/./blender() [0x16a60a0]
/snap/blender/34/./blender() [0x16a7eac]
/snap/blender/34/./blender(wm_event_do_handlers+0x4f5) [0x16a8765]
/snap/blender/34/./blender(WM_main+0x20) [0x169dce0]
/snap/blender/34/./blender(main+0x2fe) [0x1237f7e]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f3fdfb89b97]
/snap/blender/34/./blender() [0x12c849c]


I can only enter this weird sculpt mode if I link a collection in.
Linking the scene is exactly the same, with the exception that, when I switch to the linked scene I'm already in the weird sculpt mode! No switching in the outliner necesary.

What a fun bug to investigate ๐Ÿ˜

I'm going to post this now, but I'll come back if I can get it to crash from autosaving.

Edit: After bringing the data in, creating a new object then entering edit mode and returning to object mode also causes a crash. Fun!
Here it is:

# Blender 2.82 (sub 6), Commit date: 2020-01-24 11:47, Hash 18343c230d2c
bpy.ops.mesh.primitive_circle_add(radius=1, enter_editmode=False, location=(0, 0, 0))  # Operator
bpy.ops.transform.translate(value=(-2.44598, -3.8721, 3.63129), orient_type='GLOBAL', orient_matrix=((1, 0, 0), (0, 1, 0), (0, 0, 1)), orient_matrix_type='GLOBAL', mirror=True, use_proportional_edit=False, proportional_edit_falloff='SMOOTH', proportional_size=1, use_proportional_connected=False, use_proportional_projected=False)  # Operator
bpy.ops.object.editmode_toggle()  # Operator
bpy.ops.object.editmode_toggle()  # Operator

# backtrace
./blender(BLI_system_backtrace+0x1d) [0x6fb801d]
./blender() [0x16575b9]
/lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f3f2faa5f20]
./blender(ED_editors_flush_edits_ex+0xa5) [0x5d14be5]
./blender() [0x1dfbc8f]
./blender(BKE_undosys_step_push_with_type+0xe9) [0x1f88c89]
./blender(ED_undo_push+0x90) [0x1dfb0d0]
./blender() [0x181f9a3]
./blender() [0x181ffe6]
./blender() [0x1820147]
./blender(WM_operator_name_call_ptr+0x1a) [0x182054a]
./blender(ED_object_mode_compat_set+0x40) [0x1d24020]
./blender() [0x1d1ff4f]
./blender() [0x181fedb]
./blender() [0x1820147]
./blender(WM_operator_name_call_ptr+0x1a) [0x182054a]
./blender() [0x1e10042]
./blender() [0x1e203d7]
./blender() [0x1822fa3]
./blender() [0x1824d5c]
./blender(wm_event_do_handlers+0x312) [0x1825432]
./blender(WM_main+0x20) [0x181b680]
./blender(main+0x317) [0x159dca7]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f3f2fa88b97]
./blender() [0x1653e6c]
Richard Antalik (ISS) changed the task status from Needs Triage to Confirmed.Mon, Jan 27, 2:07 PM
Richard Antalik (ISS) changed the visibility from "All Users" to "Public (No Login Required)".
Bastien Montagne (mont29) changed the subtype of this task from "Report" to "Bug".