Maniphest T96032

Wrongly applying constraint make crashing Blender
Closed, Resolved

Assigned To
Henrik Dick (weasel)
Authored By
Anys Bouchafra (anys_b)
Feb 25 2022, 11:49 AM
Tags
  • BF Blender
  • Python API
  • Animation & Rigging
Subscribers
Anys Bouchafra (anys_b)
Henrik Dick (weasel)
Omar Emara (OmarSquircleArt)
Philipp Oeser (lichtwerk)

Description

System Information
Operating system: Microsoft Windows 10 Professionnel
Graphics card: Nvidia Gefroce RTX 2080 Super

Blender Version
Blender 3.0.0, hash: f1cca3055776 , branch: master

Seems like it was wrong since the beginning in rBd6891d9bee2b: Add Extras Dropdown Menu to Constraints

Short description of error
Blender crash when we use bpy.ops.constraint.apply(constraint="Transform Cache") when there are no constraint to apply instead of raising an error.

Exact steps for others to reproduce the error
Open a scene with a cube and run bpy.ops.constraint.apply(constraint="Transform Cache") in script mode

Revisions and Commits

rB Blender
D14195

Related Objects

Mentioned Here
rBd6891d9bee2b: Add Extras Dropdown Menu to Constraints
rBf1cca3055776: Blender 3.0 - version bump -> release

Event Timeline

Anys Bouchafra (anys_b) created this task.Feb 25 2022, 11:49 AM
Anys Bouchafra (anys_b) added a project: Python API.
Omar Emara (OmarSquircleArt) changed the task status from Needs Triage to Confirmed.Feb 25 2022, 11:58 AM
Omar Emara (OmarSquircleArt) added a subscriber: Omar Emara (OmarSquircleArt).
* thread #1, name = 'blender', stop reason = signal SIGSEGV: invalid address (fault address: 0x60)
  * frame #0: 0x00007ffff7f31a61 libc.so.6`__strcpy_avx2 + 33
    frame #1: 0x0000000004926959 blender`constraint_apply_exec(C=0x00007ffff39485c8, op=0x00007fffca86c448) at object_constraint.c:1518:3
    frame #2: 0x0000000003666117 blender`wm_operator_invoke(C=0x00007ffff39485c8, ot=0x00007ffff3e71b48, event=0x0000000000000000, properties=0x00007fffffffce00, reports=0x00007fffd9a2c9e8, poll_only=false, use_last_properties=true) at wm_event_system.c:1335:16
    frame #3: 0x000000000365cfd9 blender`wm_operator_call_internal(C=0x00007ffff39485c8, ot=0x00007ffff3e71b48, properties=0x00007fffffffce00, reports=0x00007fffd9a2c9e8, context=WM_OP_EXEC_DEFAULT, poll_only=false, event=0x0000000000000000) at wm_event_system.c:1564:16
    frame #4: 0x000000000365db68 blender`WM_operator_call_py(C=0x00007ffff39485c8, ot=0x00007ffff3e71b48, context=WM_OP_EXEC_DEFAULT, properties=0x00007fffffffce00, reports=0x00007fffd9a2c9e8, is_undo=false) at wm_event_system.c:1638:12
    frame #5: 0x00007ffff78270a8 libpython3.10.so.1.0`___lldb_unnamed_symbol5938 + 104
    frame #6: 0x00007ffff7821613 libpython3.10.so.1.0`_PyObject_MakeTpCall + 675
    frame #7: 0x00007ffff781c676 libpython3.10.so.1.0`_PyEval_EvalFrameDefault + 20934
    frame #8: 0x00007ffff78274e8 libpython3.10.so.1.0`_PyFunction_Vectorcall + 120
    frame #9: 0x00007ffff782097d libpython3.10.so.1.0`_PyObject_FastCallDictTstate + 397
    frame #10: 0x00007ffff7830299 libpython3.10.so.1.0`_PyObject_Call_Prepend + 105
    frame #11: 0x00007ffff7902f4e libpython3.10.so.1.0`___lldb_unnamed_symbol7289 + 110
    frame #12: 0x00007ffff7821613 libpython3.10.so.1.0`_PyObject_MakeTpCall + 675
    frame #13: 0x00007ffff781d3ba libpython3.10.so.1.0`_PyEval_EvalFrameDefault + 24330
    frame #14: 0x00007ffff7816422 libpython3.10.so.1.0`___lldb_unnamed_symbol5914 + 66
    frame #15: 0x00007ffff78cb370 libpython3.10.so.1.0`PyEval_EvalCode + 144
    frame #16: 0x00007ffff78d2c0d libpython3.10.so.1.0`___lldb_unnamed_symbol6658 + 253
    frame #17: 0x00007ffff78276ec libpython3.10.so.1.0`___lldb_unnamed_symbol5940 + 92
    frame #18: 0x00007ffff78177e4 libpython3.10.so.1.0`_PyEval_EvalFrameDefault + 820
    frame #19: 0x00007ffff78274e8 libpython3.10.so.1.0`_PyFunction_Vectorcall + 120
    frame #20: 0x00007ffff7817b05 libpython3.10.so.1.0`_PyEval_EvalFrameDefault + 1621
    frame #21: 0x00007ffff78274e8 libpython3.10.so.1.0`_PyFunction_Vectorcall + 120
    frame #22: 0x00007ffff7817b05 libpython3.10.so.1.0`_PyEval_EvalFrameDefault + 1621
    frame #23: 0x00007ffff78274e8 libpython3.10.so.1.0`_PyFunction_Vectorcall + 120
    frame #24: 0x00007ffff7817b05 libpython3.10.so.1.0`_PyEval_EvalFrameDefault + 1621
    frame #25: 0x00007ffff78274e8 libpython3.10.so.1.0`_PyFunction_Vectorcall + 120
    frame #26: 0x00007ffff78177e4 libpython3.10.so.1.0`_PyEval_EvalFrameDefault + 820
    frame #27: 0x00007ffff78274e8 libpython3.10.so.1.0`_PyFunction_Vectorcall + 120
    frame #28: 0x00000000040f2587 blender`bpy_class_call(C=0x00007ffff39485c8, ptr=0x00007fffffffe048, func=0x0000000013aa1170, parms=0x00007fffffffe028) at bpy_rna.c:8540:13
    frame #29: 0x00000000040892b5 blender`rna_operator_execute_cb(C=0x00007ffff39485c8, op=0x00007fffca86c5c8) at rna_wm.c:1317:3
    frame #30: 0x0000000003666117 blender`wm_operator_invoke(C=0x00007ffff39485c8, ot=0x00007fffeb3c18c8, event=0x00007fffda531d68, properties=0x00007fffd924d168, reports=0x0000000000000000, poll_only=false, use_last_properties=true) at wm_event_system.c:1335:16
    frame #31: 0x0000000003669101 blender`wm_handler_operator_call(C=0x00007ffff39485c8, handlers=0x00007fffeb26f080, handler_base=0x00007fffeb643fe8, event=0x00007fffda531d68, properties=0x00007fffd924d168, kmi_idname="CONSOLE_OT_execute") at wm_event_system.c:2324:16
    frame #32: 0x00000000036679ac blender`wm_handlers_do_keymap_with_keymap_handler(C=0x00007ffff39485c8, event=0x00007fffda531d68, handlers=0x00007fffeb26f080, handler=0x00007fffeb643fe8, keymap=0x00007fffd9195868, do_debug_handler=false) at wm_event_system.c:2677:21
    frame #33: 0x0000000003666ecc blender`wm_handlers_do_intern(C=0x00007ffff39485c8, win=0x00007fffeb24c208, event=0x00007fffda531d68, handlers=0x00007fffeb26f080) at wm_event_system.c:3004:26
    frame #34: 0x000000000365ff49 blender`wm_handlers_do(C=0x00007ffff39485c8, event=0x00007fffda531d68, handlers=0x00007fffeb26f080) at wm_event_system.c:3145:16
    frame #35: 0x0000000003669b7e blender`wm_event_do_region_handlers(C=0x00007ffff39485c8, event=0x00007fffda531d68, region=0x00007fffeb26ef48) at wm_event_system.c:3516:10
    frame #36: 0x0000000003660b11 blender`wm_event_do_handlers_area_regions(C=0x00007ffff39485c8, event=0x00007fffda531d68, area=0x00007fffeb1e55c8) at wm_event_system.c:3546:10
    frame #37: 0x0000000005320311 blender`::GHOST_DispatchEvents(systemhandle=0x00007ffff39485c8) at GHOST_C-api.cpp:247:11
    frame #38: 0x000000000369c29a blender`wm_window_process_events(C=0x7e8c81c0ca1ada00) at wm_window.c:1516:16
    frame #39: 0x0000000003655557 blender`WM_main(C=0x00007ffff39485c8) at wm.c:623:5
    frame #40: 0x0000000002e18ab4 blender`main(argc=1, argv=0x00007fffffffe9e8) at creator.c:544:5
    frame #41: 0x00007ffff7df7b25 libc.so.6`__libc_start_main + 213
    frame #42: 0x0000000002e1867e blender`_start + 46

In:

   1516   /* Store name temporarily for report. */
   1517   char name[MAX_NAME];
-> 1518   strcpy(name, con->name);
   1519   const bool is_first_constraint = con != constraints->first;
Philipp Oeser (lichtwerk) triaged this task as High priority.Feb 25 2022, 12:37 PM
Philipp Oeser (lichtwerk) added a project: Animation & Rigging.
Philipp Oeser (lichtwerk) added subscribers: Henrik Dick (weasel), Philipp Oeser (lichtwerk).

Seems like it was wrong since the beginning in rBd6891d9bee2b: Add Extras Dropdown Menu to Constraints, still setting to High prio since it is a crash in a recent feature.

CC @Henrik Dick (weasel)

Philipp Oeser (lichtwerk) updated the task description.Feb 25 2022, 12:37 PM
Henrik Dick (weasel) added a comment.Feb 25 2022, 2:55 PM

It actually happens not only with the new operators, but also with the old ones like bpy.ops.constraint.delete(constraint="Transform Cache").

Henrik Dick (weasel) claimed this task.Feb 25 2022, 2:56 PM
Philipp Oeser (lichtwerk) lowered the priority of this task from High to Normal.Feb 25 2022, 2:59 PM
In T96032#1313966, @Henrik Dick (weasel) wrote:

It actually happens not only with the new operators, but also with the old ones like bpy.ops.constraint.delete(constraint="Transform Cache").

Oops, sorry, true.

Henrik Dick (weasel) closed this task as Resolved by committing rB8c932ab43c28: Fix T96032: add null check to constraint operators.Feb 28 2022, 6:33 PM
Henrik Dick (weasel) added a commit: rB8c932ab43c28: Fix T96032: add null check to constraint operators.