Crashing with animation rendering and sound #62653
Labels
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
7 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#62653
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?
System Information
Operating system: MacOS 10.14
Graphics card: Radeon Pro 580 8192 MB
Blender Version
Broken: 2.80, 3600bb79d05d-x86_64, 2019-03-16
Short description of error
Blender exits while rendering this project as an animation (fails to render). Usually seems to render first few tens of frames, but exits before getting to frame 100.
Exact steps for others to reproduce the error
Open file. Edit animation output location if necessary. Render animation.
cantrender_noaudio.blend
Added subscriber: @info-27
Changed status from 'Open' to: 'Archived'
Added subscriber: @antoniov
The crash is related to sound. Here the call stack:
I don't know who is the person to fix this.
Checking console log showed that it was a problem with a 3rd party add-on (snapscrubber). Removing the add on fixed the problem.
Changed status from 'Archived' to: 'Open'
@info-27 I got an error with sound rendering your file. Are you sure we can close it?
Added subscriber: @brecht
@brecht What can we do here?
@antoniov will comment to confirm after this render is done, But on frame 1000 without problems so far.
Ah seems there's still a problem. Crashed again with this complaint:
I have not been able to reproduce this crash on Linux. There may be random memory corruption involved, or something with thread timing.
It's likely possible to further pin down the issue.
Added subscribers: @neXyon, @LazyDodo
Can still confirm on windows, different trace than @antoniov but still coming out of audaspace though, @neXyon mind taking a peek here?
I tried to reproduce the crash, but it also didn't happen on my linux. Given the stack traces though, it looks like the issue is
BKE_sound_update_scene
being called at the same time in different threads. As such a mutex in this function should solve the problem?Added subscriber: @matc
The problem seams to have been introduced in
48f9e24f0c
Enable dependency graph update while rendering.During rendering
scene->speaker_handles
gets manipulated from both the render thread and the window event thread. This leads to a race condition, even when not using audio, as both threads attempt to delete and replace thescene->speaker_handles
. I'm not sure whether it even makes sense to add/remove sound strips to/from the samescene->sound_scene
from two places, even in a thread safe manner. Viewport and renderer would probably need each its own instance. I guess this could be solved by(TODO, move to depsgraph)
.This would be a solution to revert the problem in the meantime:
Nice find on where the problem was introduced! I'd be fine with the temporary fix. Are you sure that this doesn't prevent both calls of the two threads during rendering? One should still be done. I'm not sure what moving to the dependency graph will change here, does the dependency graph get updated from two threads as well? Or is it two different instances and thus as you said viewport and renderer each need their own sound_scene instance?
The two calls to BKE_sound_update_scene both come from a depencygraph. One holds the copies for the viewport and the other one for the renderer. Both are running in their own thread. BKE_scene_graph_update_tagged happens to not be called for the render thread. But BKE_scene_graph_update_for_newframe is called for both, which is a problem.
Apparently each dependency graph already creates a copy of sound_scene and speaker_handles. So this should be working (only tested without audio):
I added an audio track in the sequencer to do some testing. Everything seams to work fine. Only when adding another track while rendering, the added track is part of the remaining render. But this seems to be a general problem, as moving the cube in the default scene while rendering does show up in the render too. I assume this is limited to animation rendering.
I also tested one scene with audio as a track in another scene with audio. Which worked out too.
Crashing while rendering animation. Grease pencil.to Crashing with animation rendering and soundSo this fix goes in the right direction, but it's not complete. All the sound handles and state should only exist and get updated on the evaluated scene, not the original scene. That means saving audio and playback should also get data from the evaluated scene.
Assigning to @Sergey to look into.
Changed status from 'Open' to: 'Resolved'
I did a series of changes, which should have made the audio system compatible with copy-on-write concept. The latest change is in
a460e97212
.Give it a test, and if there are more issues discovered make a new report.
Changed status from 'Resolved' to: 'Open'
Re-opening. Need to re-iterate over the fix.
I can still trigger this bug fairly frequently just by rendering the default .blend file at a low resolution.
Primarily crashing in AUD_destroySet and occasionally in AUD_getSet.
Changed status from 'Open' to: 'Resolved'
Committed reworked patch at
bbaa1bffe9
. The issue is now expected to be solved.Thanks for the report, closing.