Hard crash using template_keymap_item_properties with wm.context_toggle #116854

Closed
opened 2024-01-06 21:59:10 +01:00 by Owen-Lewery · 3 comments

System Information
Operating system: macOS, Linux debian bookworm
Graphics card: Radeon Pro 560X 4G, Nvidia GTX 1050

Blender Version
Broken: 4.0.0 - 4.1 alpha
Worked: 3.6.7

I use the Python API template_keymap_item_properties perhaps unwisely to help users configure operators for later invocation. This has worked fine since at least 3.3. Starting with 4.0.0 doing so causes a hard crash when configuring wm.context_toggle or wm.context_toggle_enum IFF the Context Attributes box is empty. This is the operator invoked by the n key by default in many views. Clicking in the box with content in it works as expected unless you hit delete to clear the content - this also crashes Blender.

This works fine in the keymap prefs so it's possible that the UI there is doing some additional setup that I'm not aware of. If so I'd love to know how to do that. Alternatively I'd love to know a better way than making a fake keymap item to get the magic of template_keymap_item_properties.

Either way this is a hard crash in a place that otherwise works ok.

Exact steps for others to reproduce the error

  1. Open the included .blend,
  2. In the scripts workspace run operator_modal.py
  3. Two operators are shown, render.render and wm.context_toggle. You can interact with most boxes but if you click in 'Context Attributes of the latter Blender (4.0.0+) will crash.

I tried to trace this in lldb but only got this much:

Process 3854181 stopped

  • thread #1, name = 'blender', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
    frame #0: 0x00007fffe6574d59 libc.so.6___lldb_unnamed_symbol4373 + 25 libc.so.6___lldb_unnamed_symbol4373:
    -> 0x7fffe6574d59 <+25>: vpcmpeqb (%rdi), %ymm0, %ymm1
    0x7fffe6574d5d <+29>: vpmovmskb %ymm1, %eax
    0x7fffe6574d61 <+33>: testl %eax, %eax
    0x7fffe6574d63 <+35>: je 0x7fffe6574dc0 ; <+128>
    (lldb) bt
  • thread #1, name = 'blender', stop reason = signal SIGSEGV: invalid address (fault address: 0x0)
    • frame #0: 0x00007fffe6574d59 libc.so.6___lldb_unnamed_symbol4373 + 25 frame #1: 0x00007ffff784a6ad libasan.so.8::__interceptor_strlen(s=0x0000000000000000) at sanitizer_common_interceptors.inc:387:31
      (lldb)
**System Information** Operating system: macOS, Linux debian bookworm Graphics card: Radeon Pro 560X 4G, Nvidia GTX 1050 **Blender Version** Broken: 4.0.0 - 4.1 alpha Worked: 3.6.7 I use the Python API `template_keymap_item_properties` perhaps unwisely to help users configure operators for later invocation. This has worked fine since at least 3.3. Starting with 4.0.0 doing so causes a hard crash when configuring `wm.context_toggle` or `wm.context_toggle_enum` IFF the Context Attributes box is empty. This is the operator invoked by the **n** key by default in many views. Clicking in the box with content in it works as expected _unless_ you hit delete to clear the content - this also crashes Blender. This works fine in the keymap prefs so it's possible that the UI there is doing some additional setup that I'm not aware of. If so I'd love to know how to do that. Alternatively I'd love to know a better way than making a fake keymap item to get the magic of `template_keymap_item_properties`. Either way this is a hard crash in a place that otherwise works ok. **Exact steps for others to reproduce the error** 1. Open the included .blend, 2. In the scripts workspace run `operator_modal.py` 3. Two operators are shown, `render.render` and `wm.context_toggle`. You can interact with most boxes but if you click in 'Context Attributes of the latter Blender (4.0.0+) will crash. I tried to trace this in lldb but only got this much: Process 3854181 stopped * thread #1, name = 'blender', stop reason = signal SIGSEGV: invalid address (fault address: 0x0) frame #0: 0x00007fffe6574d59 libc.so.6`___lldb_unnamed_symbol4373 + 25 libc.so.6`___lldb_unnamed_symbol4373: -> 0x7fffe6574d59 <+25>: vpcmpeqb (%rdi), %ymm0, %ymm1 0x7fffe6574d5d <+29>: vpmovmskb %ymm1, %eax 0x7fffe6574d61 <+33>: testl %eax, %eax 0x7fffe6574d63 <+35>: je 0x7fffe6574dc0 ; <+128> (lldb) bt * thread #1, name = 'blender', stop reason = signal SIGSEGV: invalid address (fault address: 0x0) * frame #0: 0x00007fffe6574d59 libc.so.6`___lldb_unnamed_symbol4373 + 25 frame #1: 0x00007ffff784a6ad libasan.so.8`::__interceptor_strlen(s=0x0000000000000000) at sanitizer_common_interceptors.inc:387:31 (lldb)
Owen-Lewery added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2024-01-06 21:59:10 +01:00
Iliya Katushenock added the
Interest
Python API
label 2024-01-06 22:00:37 +01:00
Member

Thanks for the report. Can confirm the crash.

Thanks for the report. Can confirm the crash.
Member

Some commit between 23862ec60e - 66d20c8723 affected this, checking further.

Some commit between 23862ec60e38 - 66d20c8723e6 affected this, checking further.
Member

Git bisect points to 6ba0346797
@joshm-2

Git bisect points to 6ba0346797f43cd73eb1003ce65a62b8409203fb @joshm-2
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-01-10 03:47:17 +01:00
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
2 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#116854
No description provided.