ID remap: crash with boid particles, colliders and baked physics cache #49608

Closed
opened 2016-10-08 01:01:11 +02:00 by Ralf Hölzemer · 9 comments

System Information
system-info.txt

Blender Version
Broken: 2.78 2dccf5a
Worked: (optional)

Bender crashes when a scene with certain elements is copied via "Full Copy" or "Link Object Data"

For the crash to happen, following circumstances must be true:

  • there is a mesh object with collision enabled under the physics tab
  • there is another mesh object with a particle system set to boids physics
  • the particle system is baked while both objects are in the scene
  • the scene is saved that way and is then reloaded in a new blender instance

Exact steps for others to reproduce the error

  • create a plane, switch to the physics tab and activate collision
  • create a cube and add a particle system to it
  • on the particle system, switch to boid physics
  • save the scene as base.blend

At this point, everything is okay but we need that clean copy on disk.

  • with the scene still open, bake the particle system
  • create a new scene via "Full Copy"

Note that the copying takes a while, but it doesn't crash blender because we didn't save and reload the scene.

  • now open base.blend again to get the original working state
  • bake the particles and save the scene as crash.blend
  • reload crash.blend and create a new scene via "Full Copy"

Backtrace:

Thread 1 "blender" received signal SIGSEGV, Segmentation fault.
0x000000000315c43e in id_relink_looper (UNUSED_user_data=0x0, UNUSED_self_id=0x7fffc2084808, id_pointer=0x7fffbd4a7008, cd_flag=257)
    at /home/ralf/Source/blender/blender/source/blender/blenkernel/intern/library.c:1156
1156			if (id->newid) {
(gdb) bt
#0  0x000000000315c43e in id_relink_looper (UNUSED_user_data=0x0, UNUSED_self_id=0x7fffc2084808, id_pointer=0x7fffbd4a7008, cd_flag=257)
    at /home/ralf/Source/blender/blender/source/blender/blenkernel/intern/library.c:1156
#1  0x000000000315e239 in library_foreach_particlesystemsObjectLooper (UNUSED_psys=0x7fffbfdc4408, id_pointer=0x7fffbd4a7008, user_data=0x7fffffffc990, cd_flag=257)
    at /home/ralf/Source/blender/blender/source/blender/blenkernel/intern/library_query.c:174
#2  0x000000000320ffc8 in BKE_particlesystem_id_loop (psys=0x7fffbfdc4408, func=0x315e1ca <library_foreach_particlesystemsObjectLooper>, userdata=0x7fffffffc990)
    at /home/ralf/Source/blender/blender/source/blender/blenkernel/intern/particle_system.c:4346
#3  0x000000000316438d in BKE_library_foreach_ID_link (id=0x7fffc2084808, callback=0x315c411 <id_relink_looper>, user_data=0x0, flag=0)
    at /home/ralf/Source/blender/blender/source/blender/blenkernel/intern/library_query.c:520
- 4  0x000000000315c4e2 in BKE_libblock_relink (id=0x7fffc2084808) at /home/ralf/Source/blender/blender/source/blender/blenkernel/intern/library.c:1173
- 5  0x00000000028a1df4 in single_object_users (bmain=0x7fffc1b41408, scene=0x7fffd02ff008, v3d=0x0, flag=0, copy_groups=true)
    at /home/ralf/Source/blender/blender/source/blender/editors/object/object_relations.c:1815
#6  0x00000000028a2c65 in ED_object_single_users (bmain=0x7fffc1b41408, scene=0x7fffd02ff008, full=true, copy_groups=true)
    at /home/ralf/Source/blender/blender/source/blender/editors/object/object_relations.c:2099
- 7  0x000000000294a1a4 in scene_new_exec (C=0x7fffd0c910b8, op=0x7fffbfc4ac08) at /home/ralf/Source/blender/blender/source/blender/editors/screen/screen_ops.c:3966
- 8  0x00000000023c9ada in WM_menu_invoke_ex (C=0x7fffd0c910b8, op=0x7fffbfc4ac08, opcontext=1) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_operators.c:1085
- 9  0x00000000023c9c27 in WM_menu_invoke (C=0x7fffd0c910b8, op=0x7fffbfc4ac08, UNUSED_event=0x7fffd0c17288) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_operators.c:1104
- 10 0x00000000023b49fa in wm_operator_invoke (C=0x7fffd0c910b8, ot=0x7fffd0cedb48, event=0x7fffd0c17288, properties=0x7fffffffdb50, reports=0x0, poll_only=false)
    at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_event_system.c:1096
#11 0x00000000023b50d7 in wm_operator_call_internal (C=0x7fffd0c910b8, ot=0x7fffd0cedb48, properties=0x7fffffffdb50, reports=0x0, context=1, poll_only=false)
    at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_event_system.c:1291
#12 0x00000000023b52c7 in WM_operator_name_call_ptr (C=0x7fffd0c910b8, ot=0x7fffd0cedb48, context=1, properties=0x7fffffffdb50)
    at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_event_system.c:1339
- 13 0x00000000027180be in ui_apply_but_funcs_after (C=0x7fffd0c910b8) at /home/ralf/Source/blender/blender/source/blender/editors/interface/interface_handlers.c:775
- 14 0x0000000002731c6e in ui_popup_handler (C=0x7fffd0c910b8, event=0x7fffbff11808, userdata=0x7fffbfcfdbe8) at /home/ralf/Source/blender/blender/source/blender/editors/interface/interface_handlers.c:10070
#15 0x00000000023b3128 in wm_handler_ui_call (C=0x7fffd0c910b8, handler=0x7fffbfc90668, event=0x7fffbff11808, always_pass=0)
    at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_event_system.c:451
- 16 0x00000000023b6c86 in wm_handlers_do_intern (C=0x7fffd0c910b8, event=0x7fffbff11808, handlers=0x7fffbfd0d770) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_event_system.c:2052
- 17 0x00000000023b6f22 in wm_handlers_do (C=0x7fffd0c910b8, event=0x7fffbff11808, handlers=0x7fffbfd0d770) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_event_system.c:2136
- 18 0x00000000023b7a02 in wm_event_do_handlers (C=0x7fffd0c910b8) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_event_system.c:2409
- 19 0x00000000023ab799 in WM_main (C=0x7fffd0c910b8) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm.c:489
#20 0x00000000023a68b7 in main (argc=1, argv=0x7fffffffe148) at /home/ralf/Source/blender/blender/source/creator/creator.c:527
(gdb) list
1151	static int id_relink_looper(void *UNUSED(user_data), ID *UNUSED(self_id), ID **id_pointer, const int cd_flag)
1152	{
1153		ID *id = *id_pointer;
1154		if (id) {
1155			/* See: NEW_ID macro */
1156			if (id->newid) {
1157				BKE_library_update_ID_link_user(id->newid, id, cd_flag);
1158				*id_pointer = id->newid;
1159			}
1160			else if (id->tag & LIB_TAG_NEW) {
**System Information** [system-info.txt](https://archive.blender.org/developer/F375281/system-info.txt) **Blender Version** Broken: 2.78 2dccf5a Worked: (optional) **Bender crashes when a scene with certain elements is copied via "Full Copy" or "Link Object Data"** For the crash to happen, following circumstances must be true: - there is a mesh object with collision enabled under the physics tab - there is another mesh object with a particle system set to boids physics - the particle system is baked while both objects are in the scene - the scene is saved that way and is then reloaded in a new blender instance **Exact steps for others to reproduce the error** - create a plane, switch to the physics tab and activate collision - create a cube and add a particle system to it - on the particle system, switch to boid physics - save the scene as [base.blend](https://archive.blender.org/developer/F375286/base.blend) **At this point, everything is okay but we need that clean copy on disk.** - with the scene still open, bake the particle system - create a new scene via "Full Copy" **Note that the copying takes a while, but it doesn't crash blender because we didn't save and reload the scene.** - now open [base.blend](https://archive.blender.org/developer/F375286/base.blend) again to get the original working state - bake the particles and save the scene as [crash.blend](https://archive.blender.org/developer/F375287/crash.blend) - reload [crash.blend](https://archive.blender.org/developer/F375287/crash.blend) and create a new scene via "Full Copy" **Backtrace:** ``` Thread 1 "blender" received signal SIGSEGV, Segmentation fault. 0x000000000315c43e in id_relink_looper (UNUSED_user_data=0x0, UNUSED_self_id=0x7fffc2084808, id_pointer=0x7fffbd4a7008, cd_flag=257) at /home/ralf/Source/blender/blender/source/blender/blenkernel/intern/library.c:1156 1156 if (id->newid) { (gdb) bt #0 0x000000000315c43e in id_relink_looper (UNUSED_user_data=0x0, UNUSED_self_id=0x7fffc2084808, id_pointer=0x7fffbd4a7008, cd_flag=257) at /home/ralf/Source/blender/blender/source/blender/blenkernel/intern/library.c:1156 #1 0x000000000315e239 in library_foreach_particlesystemsObjectLooper (UNUSED_psys=0x7fffbfdc4408, id_pointer=0x7fffbd4a7008, user_data=0x7fffffffc990, cd_flag=257) at /home/ralf/Source/blender/blender/source/blender/blenkernel/intern/library_query.c:174 #2 0x000000000320ffc8 in BKE_particlesystem_id_loop (psys=0x7fffbfdc4408, func=0x315e1ca <library_foreach_particlesystemsObjectLooper>, userdata=0x7fffffffc990) at /home/ralf/Source/blender/blender/source/blender/blenkernel/intern/particle_system.c:4346 #3 0x000000000316438d in BKE_library_foreach_ID_link (id=0x7fffc2084808, callback=0x315c411 <id_relink_looper>, user_data=0x0, flag=0) at /home/ralf/Source/blender/blender/source/blender/blenkernel/intern/library_query.c:520 - 4 0x000000000315c4e2 in BKE_libblock_relink (id=0x7fffc2084808) at /home/ralf/Source/blender/blender/source/blender/blenkernel/intern/library.c:1173 - 5 0x00000000028a1df4 in single_object_users (bmain=0x7fffc1b41408, scene=0x7fffd02ff008, v3d=0x0, flag=0, copy_groups=true) at /home/ralf/Source/blender/blender/source/blender/editors/object/object_relations.c:1815 #6 0x00000000028a2c65 in ED_object_single_users (bmain=0x7fffc1b41408, scene=0x7fffd02ff008, full=true, copy_groups=true) at /home/ralf/Source/blender/blender/source/blender/editors/object/object_relations.c:2099 - 7 0x000000000294a1a4 in scene_new_exec (C=0x7fffd0c910b8, op=0x7fffbfc4ac08) at /home/ralf/Source/blender/blender/source/blender/editors/screen/screen_ops.c:3966 - 8 0x00000000023c9ada in WM_menu_invoke_ex (C=0x7fffd0c910b8, op=0x7fffbfc4ac08, opcontext=1) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_operators.c:1085 - 9 0x00000000023c9c27 in WM_menu_invoke (C=0x7fffd0c910b8, op=0x7fffbfc4ac08, UNUSED_event=0x7fffd0c17288) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_operators.c:1104 - 10 0x00000000023b49fa in wm_operator_invoke (C=0x7fffd0c910b8, ot=0x7fffd0cedb48, event=0x7fffd0c17288, properties=0x7fffffffdb50, reports=0x0, poll_only=false) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_event_system.c:1096 #11 0x00000000023b50d7 in wm_operator_call_internal (C=0x7fffd0c910b8, ot=0x7fffd0cedb48, properties=0x7fffffffdb50, reports=0x0, context=1, poll_only=false) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_event_system.c:1291 #12 0x00000000023b52c7 in WM_operator_name_call_ptr (C=0x7fffd0c910b8, ot=0x7fffd0cedb48, context=1, properties=0x7fffffffdb50) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_event_system.c:1339 - 13 0x00000000027180be in ui_apply_but_funcs_after (C=0x7fffd0c910b8) at /home/ralf/Source/blender/blender/source/blender/editors/interface/interface_handlers.c:775 - 14 0x0000000002731c6e in ui_popup_handler (C=0x7fffd0c910b8, event=0x7fffbff11808, userdata=0x7fffbfcfdbe8) at /home/ralf/Source/blender/blender/source/blender/editors/interface/interface_handlers.c:10070 #15 0x00000000023b3128 in wm_handler_ui_call (C=0x7fffd0c910b8, handler=0x7fffbfc90668, event=0x7fffbff11808, always_pass=0) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_event_system.c:451 - 16 0x00000000023b6c86 in wm_handlers_do_intern (C=0x7fffd0c910b8, event=0x7fffbff11808, handlers=0x7fffbfd0d770) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_event_system.c:2052 - 17 0x00000000023b6f22 in wm_handlers_do (C=0x7fffd0c910b8, event=0x7fffbff11808, handlers=0x7fffbfd0d770) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_event_system.c:2136 - 18 0x00000000023b7a02 in wm_event_do_handlers (C=0x7fffd0c910b8) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm_event_system.c:2409 - 19 0x00000000023ab799 in WM_main (C=0x7fffd0c910b8) at /home/ralf/Source/blender/blender/source/blender/windowmanager/intern/wm.c:489 #20 0x00000000023a68b7 in main (argc=1, argv=0x7fffffffe148) at /home/ralf/Source/blender/blender/source/creator/creator.c:527 (gdb) list 1151 static int id_relink_looper(void *UNUSED(user_data), ID *UNUSED(self_id), ID **id_pointer, const int cd_flag) 1152 { 1153 ID *id = *id_pointer; 1154 if (id) { 1155 /* See: NEW_ID macro */ 1156 if (id->newid) { 1157 BKE_library_update_ID_link_user(id->newid, id, cd_flag); 1158 *id_pointer = id->newid; 1159 } 1160 else if (id->tag & LIB_TAG_NEW) { ```
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @cheleb

Added subscriber: @cheleb

This issue was referenced by 00dc0666b3

This issue was referenced by 00dc0666b3fedfbb24aef0e636a3227746e465f2

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Bastien Montagne self-assigned this 2016-10-08 15:21:27 +02:00
Author

Thanks for the fast response @mont29, but 00dc0666b3 doesn't actually prevent the crash for me - unless I am missing something here. I did a complete fresh build at 00dc0666b3 just to be sure. The above mentioned steps are still valid to reproduce the crash here.

Thanks for the fast response @mont29, but 00dc0666b3 doesn't actually prevent the crash for me - unless I am missing something here. I did a complete fresh build at 00dc0666b3 just to be sure. The above mentioned steps are still valid to reproduce the crash here.

Eeeeh, are you absolutely sure you built the correct revision (and used the correct build)? Because with this commit I can open your crash.blend and do full copy without any issue, including with asan build (which is very catchy about any kind of bad mem access)…

And if so, do you get the exact same back-trace?

Eeeeh, are you absolutely sure you built the correct revision (and used the correct build)? Because with this commit I can open your crash.blend and do full copy without any issue, including with asan build (which is very catchy about any kind of bad mem access)… And if so, do you get the exact same back-trace?
Author

Yes, absolutely sure with the revision and I get the exact same backtrace.

Here's a little screencap:
crash.webm

Yes, absolutely sure with the revision and I get the exact same backtrace. Here's a little screencap: [crash.webm](https://archive.blender.org/developer/F375570/crash.webm)

c275870673 should do it (stupid particle code made me forget to fix first particle's boid->ground pointer...).

c275870673 should do it (stupid particle code made me forget to fix first particle's boid->ground pointer...).
Author

Confirming c275870673 as a fix! Many thanks for your time!

Confirming c275870673 as a fix! Many thanks for your time!
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
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#49608
No description provided.