Fix: Memory leak while movie strip adding for incorrect/unsupported files #109078

Merged
Richard Antalik merged 1 commits from mod_moder/blender:fix_memory_leak into main 2023-06-26 13:57:39 +02:00

Any video files in lite debug or simply incorrect files for release will cause this leak.

Any video files in lite debug or simply incorrect files for release will cause this leak.
Iliya Katushenock added 1 commit 2023-06-17 15:27:22 +02:00
Iliya Katushenock requested review from Brecht Van Lommel 2023-06-17 15:28:43 +02:00
Iliya Katushenock added this to the Video Sequencer project 2023-06-17 15:29:27 +02:00
Brecht Van Lommel refused to review 2023-06-19 10:56:14 +02:00
Brecht Van Lommel requested review from Richard Antalik 2023-06-19 10:56:15 +02:00

I wasn't able to reproduce by adding invalid file, but I assume I am doing something wrong, patch makes sense.

I wasn't able to reproduce by adding invalid file, but I assume I am doing something wrong, patch makes sense.
Richard Antalik approved these changes 2023-06-19 19:04:55 +02:00
Author
Member

@iss You can just uncheck the visibility flags in the file browser and try adding a blend file.

@iss You can just uncheck the visibility flags in the file browser and try adding a blend file.

I did disable filter and added .blend file instead of movie

I did disable filter and added .blend file instead of movie
Author
Member
Blender quit
Error: Not freed memory blocks: 1, total unfreed memory 0.000313 MB
``` Blender quit Error: Not freed memory blocks: 1, total unfreed memory 0.000313 MB ```

Here is my log:

Switching to fully guarded memory allocator.
Blender 4.0.0 Alpha
argv[0] = C:\Blender-git\build_windows_x64_vc17_Release\bin\Debug\blender.exe
argv[1] = -d
argv[2] = --debug-memory
argv[3] = -con
argv[4] = --env-system-scripts
argv[5] = C:/Blender-git/1/scripts
Read prefs: "C:\Users\John\AppData\Roaming\Blender Foundation\Blender\4.0\config\userpref.blend"
Vendor: NVIDIA Corporation
Renderer: NVIDIA GeForce RTX 3060/PCIe/SSE2
Version: 4.5.0 NVIDIA 526.98
Context Version: 4.5
Vendor: NVIDIA Corporation
Renderer: NVIDIA GeForce RTX 3060/PCIe/SSE2
Version: 4.5.0 NVIDIA 526.98
Context Version: 4.5
Vendor: NVIDIA Corporation
Renderer: NVIDIA GeForce RTX 3060/PCIe/SSE2
Version: 4.5.0 NVIDIA 526.98
Context Version: 4.5
not an anim: C:\Users\John\Desktop\work\bugs\2.stl
Saved session recovery to "C:\Users\John\AppData\Local\Temp\quit.blend"

Blender quit
Press any key to exit . . .

Can you run Blender with --debug-memory argument? it should give name of allocated block

Here is my log: ``` Switching to fully guarded memory allocator. Blender 4.0.0 Alpha argv[0] = C:\Blender-git\build_windows_x64_vc17_Release\bin\Debug\blender.exe argv[1] = -d argv[2] = --debug-memory argv[3] = -con argv[4] = --env-system-scripts argv[5] = C:/Blender-git/1/scripts Read prefs: "C:\Users\John\AppData\Roaming\Blender Foundation\Blender\4.0\config\userpref.blend" Vendor: NVIDIA Corporation Renderer: NVIDIA GeForce RTX 3060/PCIe/SSE2 Version: 4.5.0 NVIDIA 526.98 Context Version: 4.5 Vendor: NVIDIA Corporation Renderer: NVIDIA GeForce RTX 3060/PCIe/SSE2 Version: 4.5.0 NVIDIA 526.98 Context Version: 4.5 Vendor: NVIDIA Corporation Renderer: NVIDIA GeForce RTX 3060/PCIe/SSE2 Version: 4.5.0 NVIDIA 526.98 Context Version: 4.5 not an anim: C:\Users\John\Desktop\work\bugs\2.stl Saved session recovery to "C:\Users\John\AppData\Local\Temp\quit.blend" Blender quit Press any key to exit . . . ``` Can you run Blender with `--debug-memory` argument? it should give name of allocated block
Author
Member

sequencer_add_init len: 328 000001D459A6CBB8

`sequencer_add_init len: 328 000001D459A6CBB8`

Checked with lite build and I could reproduce the issue. Not sure why full build is different... I will try to force leak, perhaps reporting has changed.

Checked with lite build and I could reproduce the issue. Not sure why full build is different... I will try to force leak, perhaps reporting has changed.

Hmm seems to MSVC issue somehow. Or I have set up arguments incorrectly, but I see the leak in terminal. Will investigate, but this patch is good to go.

Hmm seems to MSVC issue somehow. Or I have set up arguments incorrectly, but I see the leak in terminal. Will investigate, but this patch is good to go.
Author
Member

Clarify that I don't have commit access, so if you don't mind, can you send it?

Clarify that I don't have commit access, so if you don't mind, can you send it?

Sorry, I thought you can push, I will do it then.

Sorry, I thought you can push, I will do it then.
Richard Antalik merged commit d392a8f111 into main 2023-06-26 13:57:39 +02:00
Iliya Katushenock deleted branch fix_memory_leak 2023-06-26 14:08:27 +02:00
Sign in to join this conversation.
No reviewers
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, 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 Assignees
2 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#109078
No description provided.