ValueError in bpy_struct.callback_add() crashes Blender #30687
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#30687
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
%%%See the attached file (run the script and call the 'Crash' opertaor).
But basically passing the wrong value for callback_add() is crashing Blender.
e.g. context.region.callback_add(draw_callback_px, (self, context), 'BUGBUGBUGBUG')
ValueError: bpy_struct.callback_add(): 'BUGBUGBUGBUG' not found in ('POST_PIXEL', 'POST_VIEW', 'PRE_VIEW')
Program received signal SIGSEGV, Segmentation fault.
0x00000000012c74f0 in wm_event_modalkeymap (C=0x3be8a18, op=0x58610a0,
1331 if (op->type->modalkeymap) {
0 0x00000000012c74f0 in wm_event_modalkeymap (C=0x3be8a18, op=0x58610a0,
1 0x00000000012c7642 in wm_handler_operator_call (C=0x3be8a18,
2 0x00000000012c826c in wm_handlers_do (C=0x3be8a18, event=0x5665b68,
3 0x00000000012c8de2 in wm_event_do_handlers (C=0x3be8a18)
4 0x00000000012c2312 in WM_main (C=0x3be8a18)
5 0x00000000012c18a0 in main (argc=1, argv=0x7fffffffe1e8)
Blender svn (> 2.62) linux%%%
Changed status to: 'Open'
%%%You're using API in a wrong way: last argument of callback_add is supposed to be in ('POST_PIXEL', 'POST_VIEW', 'PRE_VIEW'). Your code throws an exception here which ends up partially initialized modal operator which confuses operator system at all.
Campbell, can you check if it can be easily fixed? But personally do't actually consider this is a bug, so if it'll lead to some hackinsh ways to support nicer behavior here prefer not to change this.%%%
%%%I know the last argument is supposed to be one of them. But segfault is always a bad deal.
In fact I have often faced that almost any problem in the callback function will segfault blender%%%
%%%I've modified our examples so
modal_handler_add
is always called just before returning, this way avoids possability thatself
is freed.crashing is bad but this is low level window api.
closing.%%%
Changed status from 'Open' to: 'Archived'