Blender 4.4 randomly crashes (heap-use-after-free) #129661

Closed
opened 2024-10-31 23:57:17 +01:00 by Weizhen Huang · 2 comments
Member

System Information
Operating system: macOS-14.5-arm64-arm-64bit 64 Bits
Graphics card: Metal API Apple M2 Max 1.2

Blender Version
Broken: version: 4.4.0 Alpha, branch: main, commit date: 2024-10-14 15:12, hash: 6da42e9c951b
Worked: version: 4.4.0 Alpha, branch: main, commit date: 2024-10-14 14:52, hash: c082260b502b
Caused by: 6da42e9c95

Short description of error
When rendering scene with Cycles, Blender would sometimes crash in libdispatch.dylib.

Exact steps for others to reproduce the error
The crash can not be reliably reproduced, but if Blender is built with ASAN, it always throws a heap-use-after-free error, so I believe that is the cause.

Steps:

  1. Build Blender with WITH_COMPILER_ASAN:BOOL=ON
  2. Open Blender and Load Factory Settings.
  3. Change Render Engine to Cycles.
  4. Change Viewport Shading to Rendered.
  5. Close Blender, or switch to other Viewport Shading modes.
  6. A heap-use-after-free error is thrown, as in the attached log.
**System Information** Operating system: macOS-14.5-arm64-arm-64bit 64 Bits Graphics card: Metal API Apple M2 Max 1.2 **Blender Version** Broken: version: 4.4.0 Alpha, branch: main, commit date: 2024-10-14 15:12, hash: `6da42e9c951b` Worked: version: 4.4.0 Alpha, branch: main, commit date: 2024-10-14 14:52, hash: `c082260b502b` Caused by: 6da42e9c951b **Short description of error** When rendering scene with Cycles, Blender would sometimes crash in `libdispatch.dylib`. **Exact steps for others to reproduce the error** The crash can not be reliably reproduced, but if Blender is built with ASAN, it always throws a `heap-use-after-free` error, so I believe that is the cause. Steps: 1. Build Blender with `WITH_COMPILER_ASAN:BOOL=ON` 2. Open Blender and Load Factory Settings. 3. Change Render Engine to Cycles. 4. Change Viewport Shading to Rendered. 5. Close Blender, or switch to other Viewport Shading modes. 6. A `heap-use-after-free` error is thrown, as in the attached log.
Author
Member
cc @fclem @James-McCarthy-4
Weizhen Huang changed title from Blender randomly crashes (`heap-use-after-free`) to Blender 4.4 randomly crashes (`heap-use-after-free`) 2024-11-01 00:11:26 +01:00

The issue is we're tearing down the context before all GPU work has completed. I don't understand the interaction with 6da42e9c95 but the fix is simple enough. Will put up a PR shortly.

The issue is we're tearing down the context before all GPU work has completed. I don't understand the interaction with [6da42e9c95 ](https://projects.blender.org/blender/blender/commit/6da42e9c951) but the fix is simple enough. Will put up a PR shortly.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2024-11-12 16:49:09 +01:00
Sign in to join this conversation.
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 project
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#129661
No description provided.