Regression: VSE crashes blender #120871

Closed
opened 2024-04-21 12:22:51 +02:00 by Arnaud Schaer · 4 comments

System Information
Operating system: windows 10
Graphics card: RTX3090 (or RTX A1000on another system)

Blender Version
Broken: 4.1.0, 4.1.1
Worked: 4.0.2

Short description of error
I have a loooot of crashes of blender in VSE SINCE 4.1.0. I cannot pinpoint each, as they are numerous and not always reproductible, but it ranges from crash on :

  • moving the current frame
  • resizing a (meta) strip
  • moving a strip ...

But what is interesting here is a very simple scene. I don'say I always reproduce the crash with any file, but with the joined file I do :
it consists (after simplification) of only 1 strip, the audi strip of an mkv.

If :

  • I open the .blend with 4.1.0 or 4.1.1 : no issue ... yet.

  • now click on "video editing workspace" : blender crashes.

  • open the file with 4.0.2 : you can do anything it wont crash.

  • save the file with 4.0.2 : it still crashes 4.1.x (that's why I saved it in another workspace and not in VSE)

  • delete the audi strip, save the file : 4.1.x does not crash anymore.

I litterally spent 80% of my time recovering from crashes in VSE 4.1.x, and 90% of time when VSE crashes, .blend file AND .blend1 file are all corrupt.

since 4.1.x introduced numerous "improvements" (threading) to VSE please, can you investigate ? Because right now VSE is unusable for mo (and I'm a beginner, so I don't do furious things)

**System Information** Operating system: windows 10 Graphics card: RTX3090 (or RTX A1000on another system) **Blender Version** Broken: 4.1.0, 4.1.1 Worked: 4.0.2 **Short description of error** I have a loooot of crashes of blender in VSE SINCE 4.1.0. I cannot pinpoint each, as they are numerous and not always reproductible, but it ranges from crash on : - moving the current frame - resizing a (meta) strip - moving a strip ... But what is interesting here is a very simple scene. I don'say I always reproduce the crash with any file, but with the joined file I do : it consists (after simplification) of only 1 strip, the audi strip of an mkv. If : - I open the .blend with 4.1.0 or 4.1.1 : no issue ... yet. - now click on "video editing workspace" : blender crashes. - open the file with 4.0.2 : you can do anything it wont crash. - save the file with 4.0.2 : it still crashes 4.1.x (that's why I saved it in another workspace and not in VSE) - delete the audi strip, save the file : 4.1.x does not crash anymore. I litterally spent 80% of my time recovering from crashes in VSE 4.1.x, and 90% of time when VSE crashes, .blend file AND .blend1 file are all corrupt. since 4.1.x introduced numerous "improvements" (threading) to VSE please, can you investigate ? Because right now VSE is unusable for mo (and I'm a beginner, so I don't do furious things)
Arnaud Schaer added the
Type
Report
Status
Needs Triage
Priority
Normal
labels 2024-04-21 12:22:52 +02:00

Thanks for the report. I can reproduce the crash here, from the first look seems to not be related to any threading things, but rather to "retuming keys", whatever they are. Will investigate and try to fix.

Thanks for the report. I can reproduce the crash here, from the first look seems to not be related to any threading things, but rather to "retuming keys", whatever they are. Will investigate and try to fix.
Iliya Katushenock changed title from VSE crashes blender to Regression: VSE crashes blender 2024-04-21 14:00:49 +02:00
Iliya Katushenock added the
Module
VFX & Video
label 2024-04-21 14:01:10 +02:00
Aras Pranckevicius self-assigned this 2024-04-21 14:06:29 +02:00

From what I can tell, this seems to be caused by 4e10aa6e71 (fix for #115086), cc @iss. What happens now with this repro file is:

  • There's a single sound clip, from frames 0 to 193. However, the same clip has "hold offset start" set to frame 2188 (in code, seq->anim_startofs is 2188).

I don't even know what "hold offset start" is, but with these values this then happens inside SEQ_retiming_sound_animation_data_set (right at start of the function, i.e. code added by revision 4e10aa6e71):

  • BKE_sound_set_scene_sound_pitch_constant_range is called with frame_start=-2188 (note: negative), frame_end=0.
  • Which calls AUD_SequenceEntry_setConstantRangeAnimationData with the same frame range.
  • Which calls AnimateableProperty::writeConstantRange with the same frame range.
  • Code in there allocates buffer space only based on position_end, which is zero!
  • And then proceeds to write into negative buffer indices, corrupting other random memory.

Now, I don't understand any of this code, but it feels like maybe both of these might be true:

  • Inside Blender code of SEQ_retiming_sound_animation_data_set, maybe there's some sanitization / range check / clamping is needed, so that whatever the code is trying to do, does not result in garbage / out of range frame values that would be passed into audaspace.
  • Inside audaspace code of writeConstantRange, there's no validation of the inputs at all. It gets negative frames, it proceeds to corrupt memory. I don't even know if negative frame indices are valid inside audaspace. Maybe not?
From what I can tell, this seems to be caused by 4e10aa6e71 (fix for #115086), cc @iss. What happens now with this repro file is: - There's a single sound clip, from frames 0 to 193. However, the same clip has "hold offset start" set to frame 2188 (in code, `seq->anim_startofs` is 2188). I don't even know what "hold offset start" is, but with these values this then happens inside `SEQ_retiming_sound_animation_data_set` (right at start of the function, i.e. code added by revision 4e10aa6e71): - `BKE_sound_set_scene_sound_pitch_constant_range` is called with frame_start=-2188 (note: negative), frame_end=0. - Which calls `AUD_SequenceEntry_setConstantRangeAnimationData` with the same frame range. - Which calls `AnimateableProperty::writeConstantRange` with the same frame range. - Code in there allocates buffer space only based on `position_end`, which is zero! - And then proceeds to write into negative buffer indices, corrupting other random memory. Now, I don't understand any of this code, but it feels like maybe both of these might be true: - Inside Blender code of `SEQ_retiming_sound_animation_data_set`, maybe there's some sanitization / range check / clamping is needed, so that whatever the code is trying to do, does not result in garbage / out of range frame values that would be passed into audaspace. - Inside audaspace code of `writeConstantRange`, there's no validation of the inputs at all. It gets negative frames, it proceeds to corrupt memory. I don't even know if negative frame indices are valid inside audaspace. Maybe not?
Author

Hi, "hold offset start/end" are set when "hard" cutting strips (instead of "strip offset start/end" when "soft" cutting strips )

Hi, "hold offset start/end" are set when "hard" cutting strips (instead of "strip offset start/end" when "soft" cutting strips )
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-04-22 14:45:38 +02:00

Indeed Audaspace can not handle negative offsets. Just sanitizing this with sound strips may cause AV sync issues, but it's the only solution. I think that hold offsets were forbidden for sound strips, not sure at what level, pretty sure RNA could set these anyway.

Indeed Audaspace can not handle negative offsets. Just sanitizing this with sound strips may cause AV sync issues, but it's the only solution. I think that hold offsets were forbidden for sound strips, not sure at what level, pretty sure RNA could set these anyway.
Sign in to join this conversation.
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
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#120871
No description provided.