Dope Sheet Editor, crash right clicking on a Mask channel #76669

Closed
opened 2020-05-12 07:15:02 +02:00 by Philippe · 14 comments

System Information
Operating system: Windows 10
Graphics card: Quadro M1000M/PCIe/SSE2

Blender Version
Broken:
2.83 (sub 15), branch: master, commit date: 2020-05-11 19:18, hash: 8956e9e5f6
2.90 (sub 1), branch: master, commit date: 2020-05-12 04:41, hash: 859eee7e15

Worked:
2.82 (sub 7), branch: master, commit date: 2020-03-12 05:06, hash: 375c7dc4ca

Short description of error
EXCEPTION_ACCESS_VIOLATION trying to open menu for a Mask channel in Dope Sheet Editor

Exact steps for others to reproduce the error

  1. Open Blender
  2. Open Image Editor
  3. Add a mask
  4. Open Dope Sheet Editor
  5. Display Mask
  6. Right click on channel
    #76669.blend
**System Information** Operating system: Windows 10 Graphics card: Quadro M1000M/PCIe/SSE2 **Blender Version** Broken: 2.83 (sub 15), branch: master, commit date: 2020-05-11 19:18, hash: 8956e9e5f6c0 2.90 (sub 1), branch: master, commit date: 2020-05-12 04:41, hash: 859eee7e1510 Worked: 2.82 (sub 7), branch: master, commit date: 2020-03-12 05:06, hash: 375c7dc4caf4 **Short description of error** EXCEPTION_ACCESS_VIOLATION trying to open menu for a Mask channel in Dope Sheet Editor **Exact steps for others to reproduce the error** 1. Open Blender 2. Open Image Editor 3. Add a mask 4. Open Dope Sheet Editor 5. Display Mask 6. Right click on channel [#76669.blend](https://archive.blender.org/developer/F8530038/T76669.blend)
Author

Added subscriber: @Greatoak

Added subscriber: @Greatoak

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Exception thrown: read access violation.
strip was 0xFFFFFFFFFFFFFF3F.

>	blender.exe!ed_screen_context(const bContext * C, const unsigned char * member, bContextDataResult * result) Line 520	C

 	blender.exe!ctx_data_get(bContext * C, const unsigned char * member, bContextDataResult * result) Line 343	C
 	blender.exe!CTX_data_get(const bContext * C, const unsigned char * member, PointerRNA * r_ptr, ListBase * r_lb, short * r_type) Line 500	C
 	blender.exe!pyrna_struct_getattro(BPy_StructRNA * self, _object * pyname) Line 4283	C
 	[External Code]	
 	blender.exe!bpy_class_call(bContext * C, PointerRNA * ptr, FunctionRNA * func, ParameterList * parms) Line 8505	C
 	blender.exe!menu_draw(const bContext * C, Menu * menu) Line 849	C
 	blender.exe!UI_menutype_draw(bContext * C, MenuType * mt, uiLayout * layout) Line 5549	C
 	blender.exe!UI_popup_menu_invoke(bContext * C, const unsigned char * idname, ReportList * reports) Line 573	C
 	blender.exe!wm_call_menu_exec(bContext * C, wmOperator * op) Line 1835	C
 	blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1282	C
 	blender.exe!wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties, const unsigned char * kmi_idname) Line 2102	C
 	blender.exe!wm_handlers_do_keymap_with_keymap_handler(bContext * C, wmEvent * event, ListBase * handlers, wmEventHandler_Keymap * handler, wmKeyMap * keymap, const bool do_debug_handler) Line 2412	C
 	blender.exe!wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2707	C
 	blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2834	C
 	blender.exe!wm_event_do_handlers(bContext * C) Line 3321	C
 	blender.exe!WM_main(bContext * C) Line 453	C
 	blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 530	C
 	[External Code]	
Exception thrown: read access violation. strip was 0xFFFFFFFFFFFFFF3F. ``` > blender.exe!ed_screen_context(const bContext * C, const unsigned char * member, bContextDataResult * result) Line 520 C blender.exe!ctx_data_get(bContext * C, const unsigned char * member, bContextDataResult * result) Line 343 C blender.exe!CTX_data_get(const bContext * C, const unsigned char * member, PointerRNA * r_ptr, ListBase * r_lb, short * r_type) Line 500 C blender.exe!pyrna_struct_getattro(BPy_StructRNA * self, _object * pyname) Line 4283 C [External Code] blender.exe!bpy_class_call(bContext * C, PointerRNA * ptr, FunctionRNA * func, ParameterList * parms) Line 8505 C blender.exe!menu_draw(const bContext * C, Menu * menu) Line 849 C blender.exe!UI_menutype_draw(bContext * C, MenuType * mt, uiLayout * layout) Line 5549 C blender.exe!UI_popup_menu_invoke(bContext * C, const unsigned char * idname, ReportList * reports) Line 573 C blender.exe!wm_call_menu_exec(bContext * C, wmOperator * op) Line 1835 C blender.exe!wm_operator_invoke(bContext * C, wmOperatorType * ot, wmEvent * event, PointerRNA * properties, ReportList * reports, const bool poll_only, bool use_last_properties) Line 1282 C blender.exe!wm_handler_operator_call(bContext * C, ListBase * handlers, wmEventHandler * handler_base, wmEvent * event, PointerRNA * properties, const unsigned char * kmi_idname) Line 2102 C blender.exe!wm_handlers_do_keymap_with_keymap_handler(bContext * C, wmEvent * event, ListBase * handlers, wmEventHandler_Keymap * handler, wmKeyMap * keymap, const bool do_debug_handler) Line 2412 C blender.exe!wm_handlers_do_intern(bContext * C, wmEvent * event, ListBase * handlers) Line 2707 C blender.exe!wm_handlers_do(bContext * C, wmEvent * event, ListBase * handlers) Line 2834 C blender.exe!wm_event_do_handlers(bContext * C) Line 3321 C blender.exe!WM_main(bContext * C) Line 453 C blender.exe!main(int argc, const unsigned char * * UNUSED_argv_c) Line 530 C [External Code] ```
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Philipp Oeser self-assigned this 2020-05-12 11:45:03 +02:00
Member

Caused by f8c4f5e308, will check...

Caused by f8c4f5e308, will check...
Member

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren
Member

Issue seems to be polling extrapolation_type in DOPESHEET_MT_channel_context_menu with a copy of the Context

if bpy.ops.graph.extrapolation_type.poll(context.copy()):

Getting a copy of the context then fails on the selected_nla_strips context member [I assume this is problematic in conjunction with ANIM_animdata_get_context].
But before digging deeper: @dr.sybren: do you remember why it was necessary to poll with a copy of the context? (you added this in a52f6d7a31)
I mean it is probably better to make sure this is also fine with using a copy of the context -- but I could not spot issues just doing it like:

P1384: T76669_snippet



diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index 3f8c41e4f21..33f183e16d5 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -644,7 +644,7 @@ class DOPESHEET_MT_channel_context_menu(Menu):
         layout.separator()
         layout.operator("anim.channels_editable_toggle")
 
-        if bpy.ops.graph.extrapolation_type.poll(context.copy()):
+        if bpy.ops.graph.extrapolation_type.poll():
             operator = "graph.extrapolation_type"
         else:
             operator = "action.extrapolation_type"

(note it might also be good to check the ANIM_animdata_context_getdata -> actedit_get_context -> SACTCONT_MASK case [since this only seems to be problematic for masks...])

Issue seems to be polling `extrapolation_type` in `DOPESHEET_MT_channel_context_menu` with a **copy of the Context** ``` if bpy.ops.graph.extrapolation_type.poll(context.copy()): ``` Getting a copy of the context then fails on the `selected_nla_strips` context member [I assume this is problematic in conjunction with `ANIM_animdata_get_context`]. But before digging deeper: @dr.sybren: do you remember why it was necessary to poll with a **copy of the context**? (you added this in a52f6d7a31) I mean it is probably better to make sure this is also fine with using a **copy of the context** -- but I could not spot issues just doing it like: [P1384: T76669_snippet](https://archive.blender.org/developer/P1384.txt) ``` diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 3f8c41e4f21..33f183e16d5 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -644,7 +644,7 @@ class DOPESHEET_MT_channel_context_menu(Menu): layout.separator() layout.operator("anim.channels_editable_toggle") - if bpy.ops.graph.extrapolation_type.poll(context.copy()): + if bpy.ops.graph.extrapolation_type.poll(): operator = "graph.extrapolation_type" else: operator = "action.extrapolation_type" ``` (note it might also be good to check the `ANIM_animdata_context_getdata` -> `actedit_get_context` -> `SACTCONT_MASK` case [since this only seems to be problematic for masks...])
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

@JacquesLucke : here is a report for your D7702: Fix selected_nla_strips when used in other editors, checking this as well...

@JacquesLucke : here is a report for your [D7702: Fix selected_nla_strips when used in other editors](https://archive.blender.org/developer/D7702), checking this as well...

The problem with the poll() function calls is that it doesn't expect a bpy.types.Context object, but rather a dictionary. context.copy() returns its own values, but then as such a dictionary. If the context-less call uses the correct context (I wasn't sure about that at the time, and I'm still not sure whether it would use the current or the global context) removing context.copy() is fine by me.

The problem with the `poll()` function calls is that it doesn't expect a `bpy.types.Context` object, but rather a dictionary. `context.copy()` returns its own values, but then as such a dictionary. If the context-less call uses the correct context (I wasn't sure about that at the time, and I'm still not sure whether it would use the current or the global context) removing `context.copy()` is fine by me.

This issue was referenced by e5bb02aaa4

This issue was referenced by e5bb02aaa41615d9f48376e53e5cf7569e1bc1d2
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Member

Ok, lets call this done for now...
Still a bit confused why this wasnt an issue with the original context, but fix seems good and safe, thx everyone involved!

Ok, lets call this done for now... Still a bit confused why this wasnt an issue with the original context, but fix seems good and safe, thx everyone involved!
Sign in to join this conversation.
6 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blender/blender#76669
No description provided.