Prefetching can corrupt .blend files #78837
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
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 & 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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & 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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#78837
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?
System Information
Operating system: Windows-10-10.0.18362-SP0 64 Bits
Graphics card: Radeon RX 570 Series ATI Technologies Inc. 4.5.13572 Core Profile Context 19.11.2 26.20.13031.15006
Blender Version
Broken: version: 2.90.0 Alpha, branch: master, commit date: 2020-07-04 15:31, hash:
464aaf2701
Short description of error.
Prefetching can corrupt .blend files. Following steps may not work on all hardware. This is quite random issue as far as I can tell.
Exact steps for others to reproduce the error
#78837.blend
.blend file is now broken -
seq->effectdata
is corrupted.Added subscriber: @jordanp.lawson
On further testing many other actions seem to crash the file, like rendering from the first frame. Just before these crashes began, I used the opacity property to have my intro fade in from black, maybe it's related.
Added subscriber: @iss
Changed status from 'Needs Triage' to: 'Confirmed'
Thanks for report.
There seems to be issue with prefetching corrupting .blend files. There have been several reports for this, I have not been able to reproduce this issue until now.
I will leave notes for me to look into this:
Added subscriber: @Sergey
Modifications of strips should stop and re-initialize the pre-fetch job. This is because prefetch is sharing data from the main database, and can access/write to it from a no-main thread.
There are two possible ways to solve the problem:
DEG_graph_build_for_render_pipeline
). It still would need to be re-started after modifications, but at least this could happen as a "listener" of the dependency graph.@Sergey Prefetching is stopped when cache is invalidated, which should be every time some strip is changed. Also I am already using
DEG_graph_build_for_render_pipeline
, but maybe incorrectly?Bigger issue is actual file corruption. I am not sure what is mechanism of that yet. I will trace it. Prefetch should not touch any data in bmain other than own structs.
Scrolling in VSE crashes blender.to Prefetching can corrupt .blend filesI thought I fixed this already. It seems that files get corrupted because of typo:
Second issue I described in comment seems to go away as well, so it only looked like thread race.
If you're using
DEG_graph_build_for_render_pipeline
, then the stopping prefetch on cache invalidation seems fine.I do see some issues in the
seqprefetch.c
though. Summary goes as:DEG_graph_build_for_render_pipeline
is happen from main thread.DEG_evaluate_on_framechange
to update depsgraph for the new frame from the prefetch job.The reason of this is because first evaluation of the depsgraph needs to run copy-on-write operations, which do access original datablocks. So if the copy-on-write happens from a thread, while someone is modifying strip you will run into threading conflicts.
Building depsgraph and evaluating it once from the main thread makes sure that no user interaction happens during copy-on-write is in progress.
This issue was referenced by
3058bf0757
This issue was referenced by
75a09ba2ed
Changed status from 'Confirmed' to: 'Resolved'
I see issue with initializing depsgraph from thread. I will change to do this from main thread.