wmTimer, wmJob and WM_report issue - can lead to crash #105369
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#105369
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
The Problem
Report #105160 unveils a critical issue in wmTimer handling.
Essentially, in several places of WM code timers are looped over in that way:
This is actually not working as expected, because during the processing of a wmTimer, other wmTimers may be added or removed and freed, The latter will lead to a crash if it is the next timer in the list (
LISTBASE_FOREACH_MUTABLE
only protects against removal/freeing of the current item).The typical identified case if a job timer updating or ending its job, which job callbacks would call
WM_report
, which ends up removing/freeing a timer and adding a new one for the report 'popup' in the UI.Proposed Solutions
This issue has potential solutions at several levels.
1. Simple Fix the Current Issue
The issue with
WM_report
modifying timers could be addressed by having a flag in the WindowManager marking timers as being processed, in which caseWM_report
(or more preciselywm_add_reports
) should not callWM_report_banner_show
.WM_report_banner_show
call could then be added at the end of the loops over wmTimer.2. More General Fix
Making wmTimer loop safe in general could be achieved by deferring their deletion (tagging them to be deleted, and actually deleting them in a second, safe loop).
@ideasman42 @brecht, could use your feedback on this one. Think it's a fairly bad issue, and would rather fix it for 3.5 (and backport to previous LTS)?
I'd go with deferred deletion. I couldn't think of another solution that is watertight.
Committed as
d66672e17a
.This unfortunately needs to be re-opened, when massively generating reports from threaded code it still causes several issues. Will update description for specific info.
Actually better use a new task imho: #112537