Maniphest T80596

Convert to Curve from Mesh crashes Blender
Closed, Resolved

Assigned To
Sebastian Parborg (zeddb)
Authored By
Simon Thommes (simonthommes)
Sep 8 2020, 3:31 PM
Tags
  • BF Blender
  • Modeling
Subscribers
Joseph Brandenburg (TheAngerSpecialist)
michael campbell (3di)
Robert Guetzkow (rjg)
Sebastian Parborg (zeddb)
Simon Thommes (simonthommes)

Description

System Information
Operating system: Linux-5.4.0-7634-generic-x86_64-with-debian-bullseye-sid 64 Bits
Graphics card: Quadro RTX 6000/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 440.100

Blender Version
Broken: version: 2.91.0 Alpha, branch: master, commit date: 2020-09-08 11:23, hash: rBab6f59ff3b8c
Worked: v2.83.5

Short description of error
The convert Curve from Mesh operator does not work and in some cases crashes Blender immediately.

Exact steps for others to reproduce the error
Add a plane -> Convert to Curve from Mesh -> Crash

(Note: on the default cube it does not crash, but also does not do any conversion)

Revisions and Commits

rB Blender

Related Objects

Mentioned In
T80575: convert to mesh from curve not work. don't workht key and menu
Mentioned Here
rBf20f82ce3ee5: Fix segfaults when deleting objects with upstream bullet lib

Event Timeline

Simon Thommes (simonthommes) created this task.Sep 8 2020, 3:31 PM
Robert Guetzkow (rjg) changed the task status from Needs Triage to Confirmed.EditedSep 8 2020, 4:48 PM
Robert Guetzkow (rjg) triaged this task as High priority.
Robert Guetzkow (rjg) added a subscriber: Robert Guetzkow (rjg).

I can confirm this issue. object_convert_exec tries to remove the object from the rigid bodies by calling ED_rigidbody_object_remove. However, since it isn't a rigid body and there's also no other rigid body in the scene the RigidBodyWorld is NULL when calling BKE_ptcache_id_from_rigidbody and it tries to dereference it.

If you add rigid body physics to the plane or any other object in the scene it won't crash, since a rigid body world exists.

BKE_ptcache_id_from_rigidbody(PTCacheID * pid, Object * ob, RigidBodyWorld * rbw) Line 1854	C
BKE_rigidbody_remove_object(Main * bmain, Scene * scene, Object * ob, const bool free_us) Line 1567	C
ED_rigidbody_object_remove(Main * bmain, Scene * scene, Object * ob) Line 106	C
object_convert_exec(bContext * C, wmOperator * op) Line 2577	C
WM_menu_invoke_ex(bContext * C, wmOperator * op, int opcontext) Line 972	C
WM_menu_invoke(bContext * C, wmOperator * op, const wmEvent * UNUSED_event) Line 993	C
wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1301	C
wm_operator_call_internal(bContext * C, wmOperatorType * ot, PointerRNA * properties, ReportList * reports, const short context, const bool poll_only, wmEvent * event) Line 1514	C
WM_operator_name_call_ptr(bContext * C, wmOperatorType * ot, short context, PointerRNA * properties) Line 1563	C
ui_apply_but_funcs_after(bContext * C) Line 928	C
ui_handler_region_menu(bContext * C, const wmEvent * event, void * UNUSED_userdata) Line 10739	C
wm_handler_ui_call(bContext * C, wmEventHandler_UI * handler, const wmEvent * event, int always_pass) Line 639	C
wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2755	C
wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2866	C
wm_event_do_handlers(bContext * C) Line 3290	C
WM_main(bContext * C) Line 485	C
main(int argc, const unsigned char * * UNUSED_argv_c) Line 531	C
Robert Guetzkow (rjg) added a project: Modeling.Sep 8 2020, 4:50 PM
Robert Guetzkow (rjg) added a subscriber: Joseph Brandenburg (TheAngerSpecialist).
Joseph Brandenburg (TheAngerSpecialist) added a comment.Sep 8 2020, 9:26 PM

thank you for closing mine. I am so embarrassed that I forgot to search 😭

Robert Guetzkow (rjg) added a comment.Sep 8 2020, 9:28 PM

@Joseph Brandenburg (TheAngerSpecialist) Don't worry about it.

Robert Guetzkow (rjg) added a subscriber: Sebastian Parborg (zeddb).Sep 8 2020, 9:45 PM

@Sebastian Parborg (zeddb) This issue was introduced by rBf20f82ce3ee55c12adcec024e0133e71183e07b3 with the changes to BKE_rigidbody_remove_object.

Sebastian Parborg (zeddb) closed this task as Resolved by committing rBd51c8f78ff8a: Fix T80596: Convert to Curve from Mesh crashes Blender.Sep 9 2020, 11:49 AM
Sebastian Parborg (zeddb) claimed this task.
Sebastian Parborg (zeddb) added a commit: rBd51c8f78ff8a: Fix T80596: Convert to Curve from Mesh crashes Blender.
Sebastian Parborg (zeddb) added a comment.Sep 9 2020, 11:51 AM

Thanks for bisecting and providing the backtrace!

The issue was two fold:

  1. First I should check if rbw is null before trying to get a pointcache from it.
  1. This would only trigger when using the convert function as it does not have a sanity check. (Is this object actually a rigid body object?)

So I fixed both.

Robert Guetzkow (rjg) added a subscriber: michael campbell (3di).