Blender 3.5 crashes after frame render complete #106977

Closed
opened 2023-04-15 02:01:47 +02:00 by Christian-Catchpole · 9 comments

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

Blender Version
Broken: version: 3.5.0, branch: blender-v3.5-release, commit date: 2023-03-29 02:56, hash: 1be25cfff18b
Worked: last 3.4 version

Short description of error

After rendering a frame, blender 3.5 crashes. Not all files seem to cause the crash, but it occurs on both my M2 air and M1 Studio Ultra. Crashes in both headless and normal mode.

Last regular log entry, then the failure...

Fra:1 Mem:6630.95M (Peak 7704.28M) | Time:00:57.24 | Compositing | De-initializing execution
libc++abi: terminating due to uncaught exception of type Iex_3_1::EnoentExc: No such file or directory.

Exact steps for others to reproduce the error
Download "Italian Flat" demo file from https://www.blender.org/download/demo-files/#cycles
Render a single frame. (Frame size percentage can be dialed down to allow render to compete faster.)

Simple file: simple_106977.blend

**System Information** Operating system: macOS-13.3.1-arm64-arm-64bit 64 Bits Graphics card: Metal API Apple M2 1.2 **Blender Version** Broken: version: 3.5.0, branch: blender-v3.5-release, commit date: 2023-03-29 02:56, hash: `1be25cfff18b` Worked: last 3.4 version **Short description of error** After rendering a frame, blender 3.5 crashes. Not all files seem to cause the crash, but it occurs on both my M2 air and M1 Studio Ultra. Crashes in both headless and normal mode. Last regular log entry, then the failure... Fra:1 Mem:6630.95M (Peak 7704.28M) | Time:00:57.24 | Compositing | De-initializing execution libc++abi: terminating due to uncaught exception of type Iex_3_1::EnoentExc: No such file or directory. **Exact steps for others to reproduce the error** Download "Italian Flat" demo file from https://www.blender.org/download/demo-files/#cycles Render a single frame. (Frame size percentage can be dialed down to allow render to compete faster.) Simple file: [simple_106977.blend](/attachments/f7b917ab-e028-4a5e-b730-bb98f70c63fd)
Christian-Catchpole added the
Priority
Normal
Type
Report
Status
Needs Triage
labels 2023-04-15 02:01:48 +02:00
Iliya Katushenock added the
Interest
Render Pipeline
label 2023-04-15 10:25:18 +02:00
Member

No repro on linux

**System Information**
Operating system: Linux-6.1.18-200.fc37.x86_64-x86_64-with-glibc2.36 64 Bits
Graphics card: AMD Radeon Graphics (renoir, LLVM 15.0.7, DRM 3.49, 6.1.18-200.fc37.x86_64) AMD 4.6 (Core Profile) Mesa 22.3.7
version: 3.5.0, branch: blender-v3.5-release, commit date: 2023-03-29 02:56, hash: `1be25cfff18b`

@mano-wii : can you repro?

No repro on linux ``` **System Information** Operating system: Linux-6.1.18-200.fc37.x86_64-x86_64-with-glibc2.36 64 Bits Graphics card: AMD Radeon Graphics (renoir, LLVM 15.0.7, DRM 3.49, 6.1.18-200.fc37.x86_64) AMD 4.6 (Core Profile) Mesa 22.3.7 version: 3.5.0, branch: blender-v3.5-release, commit date: 2023-03-29 02:56, hash: `1be25cfff18b` ``` @mano-wii : can you repro?

I can confirm the problem.
The error is in post processing.
It starts with an error when exporting EXR in composer:

__cxa_throw (@__cxa_throw:3)
Iex_3_1::throwErrnoExc(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, int) (@Iex_3_1::throwErrnoExc(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, int):459)
Iex_3_1::throwErrnoExc() (@Iex_3_1::throwErrnoExc():16)
OFileStream::OFileStream(char const*) (../source/blender/imbuf/intern/openexr/openexr_api.cpp:330)
OFileStream::OFileStream(char const*) (../source/blender/imbuf/intern/openexr/openexr_api.cpp:319)
::IMB_exr_begin_write(void *, const char *, int, int, int, const StampData *) (../source/blender/imbuf/intern/openexr/openexr_api.cpp:930)
blender::compositor::OutputOpenExrMultiLayerOperation::deinit_execution() (.../source/blender/compositor/operations/COM_OutputFileOperation.cc:430)
blender::compositor::TiledExecutionModel::execute(blender::compositor::ExecutionSystem&) (../source/blender/compositor/intern/COM_TiledExecutionModel.cc:127)
::COM_execute(RenderData *, Scene *, bNodeTree *, int, const char *) (../source/blender/compositor/intern/COM_compositor.cc:94)
::ntreeCompositExecTree(Scene *, bNodeTree *, RenderData *, int, int, const char *) (../source/blender/nodes/composite/node_composite_tree.cc:183)
do_render_compositor(Render*) (../source/blender/render/intern/pipeline.cc:1166)
do_render_full_pipeline(Render*) ../source/blender/render/intern/pipeline.cc:1367)
::RE_RenderFrame(Render *, Main *, Scene *, ViewLayer *, Object *, const int, const float, const bool) (../source/blender/render/intern/pipeline.cc:1770)
render_startjob(void*, bool*, bool*, float*) (../source/blender/editors/render/render_internal.cc:678)
do_job_thread (../source/blender/windowmanager/intern/wm_jobs.c:382)
_pthread_start (@_pthread_start:40)

Due to the error, OpenEXR itself forces Blender to close. It doesn't crash due to memory error or something.

Operating system: macOS-13.2.1-arm64-arm-64bit 64 Bits
Graphics card: Metal API Apple M1 1.2
I can confirm the problem. The error is in post processing. It starts with an error when exporting EXR in composer: ``` __cxa_throw (@__cxa_throw:3) Iex_3_1::throwErrnoExc(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, int) (@Iex_3_1::throwErrnoExc(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, int):459) Iex_3_1::throwErrnoExc() (@Iex_3_1::throwErrnoExc():16) OFileStream::OFileStream(char const*) (../source/blender/imbuf/intern/openexr/openexr_api.cpp:330) OFileStream::OFileStream(char const*) (../source/blender/imbuf/intern/openexr/openexr_api.cpp:319) ::IMB_exr_begin_write(void *, const char *, int, int, int, const StampData *) (../source/blender/imbuf/intern/openexr/openexr_api.cpp:930) blender::compositor::OutputOpenExrMultiLayerOperation::deinit_execution() (.../source/blender/compositor/operations/COM_OutputFileOperation.cc:430) blender::compositor::TiledExecutionModel::execute(blender::compositor::ExecutionSystem&) (../source/blender/compositor/intern/COM_TiledExecutionModel.cc:127) ::COM_execute(RenderData *, Scene *, bNodeTree *, int, const char *) (../source/blender/compositor/intern/COM_compositor.cc:94) ::ntreeCompositExecTree(Scene *, bNodeTree *, RenderData *, int, int, const char *) (../source/blender/nodes/composite/node_composite_tree.cc:183) do_render_compositor(Render*) (../source/blender/render/intern/pipeline.cc:1166) do_render_full_pipeline(Render*) ../source/blender/render/intern/pipeline.cc:1367) ::RE_RenderFrame(Render *, Main *, Scene *, ViewLayer *, Object *, const int, const float, const bool) (../source/blender/render/intern/pipeline.cc:1770) render_startjob(void*, bool*, bool*, float*) (../source/blender/editors/render/render_internal.cc:678) do_job_thread (../source/blender/windowmanager/intern/wm_jobs.c:382) _pthread_start (@_pthread_start:40) ``` Due to the error, OpenEXR itself forces Blender to close. It doesn't crash due to memory error or something. ``` Operating system: macOS-13.2.1-arm64-arm-64bit 64 Bits Graphics card: Metal API Apple M1 1.2 ```

I spent quite some time trying to find where the issue was introduced.
Apparently it was with library revision 63130 in Subversion: macOS Arm: library updates for 3.5

Before that, an error message appeared indicating that a directory was not found for the EXR.
Then, maybe the same error, forces Blender to close.

I spent quite some time trying to find where the issue was introduced. Apparently it was with library revision 63130 in Subversion: macOS Arm: library updates for 3.5 Before that, an error message appeared indicating that a directory was not found for the EXR. Then, maybe the same error, forces Blender to close.

Here is a much smaller file which demonstrates the problem.

Apparently, the try-catch block does not catch OpenEXR exceptions by a const reference to std::exception, even though all the exception a publicly derived from the std::exception. Replacing catch (const std::exception &exc) { with catch (const Iex::BaseExc &exc) { in the openexr_api.cpp solves this problem.

Verified that the BaseExc can be casted to std::exception by doing the following:

  catch (const Iex::BaseExc &exc) {
    const std::exception &ex = exc;
    printf("OpenEXR-save: ERROR: %s\n", ex.what());
  ...

The snippet compiles and is working properly.

Happens on both Intel and Apple Silicon devices, but not on Linux or windows.

Here is a much smaller file which demonstrates the problem. Apparently, the `try-catch` block does not catch OpenEXR exceptions by a const reference to `std::exception`, even though all the exception a publicly derived from the `std::exception`. Replacing `catch (const std::exception &exc) {` with `catch (const Iex::BaseExc &exc) {` in the `openexr_api.cpp` solves this problem. Verified that the `BaseExc` can be casted to `std::exception` by doing the following: ``` catch (const Iex::BaseExc &exc) { const std::exception &ex = exc; printf("OpenEXR-save: ERROR: %s\n", ex.what()); ... ``` The snippet compiles and is working properly. Happens on both Intel and Apple Silicon devices, but not on Linux or windows.
Sergey Sharybin added
Type
Bug
Module
Core
and removed
Type
Report
Module
VFX & Video
Interest
Render Pipeline
labels 2023-04-20 14:15:46 +02:00

It may be related to visibility, as explained under "Problems with C++ exceptions" here:
https://gcc.gnu.org/wiki/Visibility

The discussion here might be relevant:
https://github.com/AcademySoftwareFoundation/openexr/pull/868#issuecomment-779658097

It may be related to visibility, as explained under "Problems with C++ exceptions" here: https://gcc.gnu.org/wiki/Visibility The discussion here might be relevant: https://github.com/AcademySoftwareFoundation/openexr/pull/868#issuecomment-779658097

It indeed could be, but it is not immediately clear to me how.

As a quicker solution which is also suitable for 3.5.1 is to follow what the OIIO does:

try {
} catch (const std::exception& e) {
} catch (...) {  // catch-all for edge cases or compiler bugs
}
It indeed could be, but it is not immediately clear to me how. As a quicker solution which is also suitable for 3.5.1 is to follow what the OIIO does: ``` try { } catch (const std::exception& e) { } catch (...) { // catch-all for edge cases or compiler bugs } ```
Sergey Sharybin self-assigned this 2023-04-20 17:15:50 +02:00
Member

FYI https://archive.blender.org/developer/D13019

Similar bug was seen before: exception inheritance and catching issues

FYI https://archive.blender.org/developer/D13019 Similar bug was seen before: exception inheritance and catching issues

As far as I can tell the same issue should not happen for other libraries:

  • For Alembic, OpenColorIO, and OpenVDB we catch exception types provided by the library.
  • Alembic export has one catch (const std::exception &ex), but also a catch (...) fallback in case that fails.
As far as I can tell the same issue should not happen for other libraries: * For Alembic, OpenColorIO, and OpenVDB we catch exception types provided by the library. * Alembic export has one `catch (const std::exception &ex)`, but also a `catch (...)` fallback in case that fails.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-04-20 18:40:23 +02:00

@brecht Thanks for checking!

@brecht Thanks for checking!
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
No Assignees
6 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#106977
No description provided.