Compositor ACCESS VIOLATION when updating datablocks from handlers #107248
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#107248
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: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 526.98
Blender Version
Broken: version: 3.5.1 Release Candidate, branch: blender-v3.5-release, commit date: 2023-04-05 07:29, hash:
8f3faae18b
Worked: (newest version of Blender that worked as expected)
Short description of error
re-created because #102234 was closed before fixed.
provided blend is as small as simplified as possible without losing the problem. Supplied addon was already reduced from 8000 lines of code.
Access violation during playback in full frame compositor mode if datablocks updated from frame change handler.
Exact steps for others to reproduce the error
Hi, some of our in house tools appear to not work with the full frame compositor. Please use the massively cut down demo addon and scene file below:
https://archive.blender.org/developer/F13841850/full_frame_bug_demo_addon.zip
https://archive.blender.org/developer/F13841851/full_frame_bug_scene_and_assetts.zip
https://archive.blender.org/developer/F13842038/compositor_bug_original.crash.txt
Steps:
Open Blender 3.4
Turn on the Full Frame compositor in the experimental section of the preferences.
unzip the 'full frame bug scene and assetts' file.
Open the enclosed .blend file (with load UI enabled).
Go to Scene.002 if it's not already there.
In the compositor options make sure mode is set to tiled.
Press right arrow once to refresh the compositor backdrop. It should show the monkeys.
Press spacebar to play the timeline (The image datablocks will be updated each frame based on the active timeline camera markers of both scenes.)
Stop playback
Switch to Full Frame Compositor mode in the compositor's options
Press the spacebar again to recommence playback. It usually crashes immediately.
If it doesn't crash immediately, stop and start playback a few times, switch to the other scene playback there then swap back to scene.002, try swapping modes and playing back a few times, or try reopening the file or re-installing the demo addon. Once it does crash, re-opening the file will often cause tiled rendering to also crash next time blender is opened. After a closing down blender and re-opening a few times, Tiled mode will become stable once more, saving the file after successfully getting tiled mode working again usually resolves permanently until the next time Full Frame mode is attempted.
The crash always happens on line 56 of scene_helpers.py when the image datablocks filepath is given the new string. I've added print statements either side to demonstrate this. After the initial access violation, it will sometimes manage a few more lines of code before finally crashing completely.
Although render.render is called on line 70 of the scene_helpers , this doesn't appear to be related, as the issue happens even when that line is commented out. Also the handler has checks to ensure it's only executed once per frame and not when render.render instigates another call to the frame change handler. Additionally the viewport is locked during rendering as advised in the handlers section of the python API.
Similar to #107235 .
Can confirm this.
Note: I can even repro with
Tiled
.This is what ASAN has to say:
Full frame compositor ACCESS VIOLATION when updating datablocks from handlers (works fine in tiled mode) #102234to Compositor ACCESS VIOLATION when updating datablocks from handlersA much smaller reproducable case:
Is very easy to see the problem in a build with an address sanitizer enabled.
I think the proper solution to the problem would be to use implicit shading of the pixels buffer between
ImBuf
and the OpenEXR handle.Hi @Sergey , does this commit automatically fix the issue or are changes to the script also needed? Does your commit also open up the ability via the python API to access and modify the render results prior to it writing out? If so, do you have a link to the documentation of those new functions please?
I don't think changes in the script are needed. At least not for the crash I've managed to reproduce and fix.
Does the issue still happen for you?
Keep in mind, it is rather a big change, which also relied on a bigger refactor done in a separate commit, and it was not safe for 3.6, so the fix is only available for 4.0.
Thanks, I'll try in 4.0 then :)
Hi @Sergey I just tested in 4.0 (today's build) and it now seems to crash immediately during playback even when full frame compositor isn't enabled. Still working fine in 3.51 if full frame compositor isn't enabled.
To replicate:
download this blend file (attached), unzip and open
install the addon from the initial report (above).
go to the compositor
press right arrow once to update the backdrop
press play
crash (see below error logs)
Hi again @Sergey , I just realised the included exr sequence made the zipped blend file too large to attach here. Please download it from here instead:
https://www.dropbox.com/s/9raz9ysooj15dlw/access%20violation.zip?dl=1
I wasn't able to reproduce crash with the steps provided in the previous comment.
The way how repro case is organized makes it quite hard to know if the test environment is really the same. For example, the image uses an absolute path to a drive which does not necessarily exist on developer's machines, and the addon uses the path as part of a hashing sued for image file name. So I had to modify that part of the addon to make hashes match between path which works, and the provided image names.
There is a very good reason we ask to simplify the repro case as much as possible:
I was able to reproduce two other issues, with completely other steps:
buffer_
in theMultilayerBaseOperation::update_memory_buffer_partial
isnullptr
. Not sure it is a separate issue, as it might be that removing the link first makes animation to stop and leave the scene in some limbo state, and it just crashes in a slightly different place.The speculation is that when you do a first compositor recalc links are still used from the old state of the file, and starting playback would load a new file, rename the sockets, links gets lost, the addon seems this and attempts to stop the animation playback. Which would make it the same issue as #109127.
Anyway, I suggest subsrcibing the #109127, and if that is not the source of crash you're running into make a more isolated reported.
@Sergey I'm really sorry, I hadn't realised that our hashing method was based on the camera scene and viewlayer at the time of originally submitting this bug, and because we now only use the scene and viewlayer, the hash was incorrect as you pointed out.
Please accept my humble apologies for missing that.
As the issue isn't related to #109127 (because nothing is deleted here, and no links are removed/created), I've created a further simplified addon and generated a new bug report here:
#109168
This time I've included two blend files to show that the issue is only present in blender 4.0.
Sorry again for my mistake. I think my Boss is going to contact you too as he's getting a bit panicked due to several thousand people being reliant on this being fixed :s
No problem, don't worry about it :)
Is good to know that no links are removed for you. Would mean there is potentially a 3rd way you usecase crashes Blender.
Thanks for the more isolated report.