Regression: My blend file crashes when rendering in Blender 3.4 upwards, because of an unchecked NULL in the code. (stack trace provided) #103031

Closed
opened 2022-12-08 16:32:59 +01:00 by Chris Monachan · 23 comments

System Information
Operating system: Windows-10-10.0.22000-SP0 64 Bits
Graphics card: Intel(R) HD Graphics 620 Intel 4.5.0 - Build 31.0.101.2111

Blender Version
Broken: version: 3.4.0, branch: blender-v3.4-release, commit date: 2022-12-06 18:46, hash: a95bf1ac01
Worked: Any version prior to this

Short description of error
When rendering a large blend file in any build from 3.4 upwards I get a crash before the render starts. I have reproduced this in a debug build and can show where the issue is. I don't know the code so I am not sure why my blend file causes blender to get in this state and unfortunately it is commercially sensitive so can't share it.

Exact steps for others to reproduce the error
I load up my blend file and hit render. It fairly quickly hits an access violation.

The call-stack is as follows:

>	blender.exe!rna_Object_indirect_only_get(Object * ob, bContext * C, PointerRNA * view_layer_ptr) Line 208	C

 	blender.exe!Object_indirect_only_get_func(Object * _self, bContext * C, PointerRNA * view_layer) Line 3365	C
 	blender.exe!BL::Object::indirect_only_get(BL::Context C, BL::ViewLayer & view_layer) Line 65142	C++
 	blender.exe!ccl::BlenderSync::sync_object(BL::Depsgraph & b_depsgraph, BL::ViewLayer & b_view_layer, BL::DepsgraphObjectInstance & b_instance, float motion_time, bool use_particle_hair, bool show_lights, ccl::BlenderObjectCulling & culling, bool * use_portal, ccl::TaskPool * geom_task_pool) Line 227	C++
 	blender.exe!ccl::BlenderSync::sync_objects(BL::Depsgraph & b_depsgraph, BL::SpaceView3D & b_v3d, float motion_time) Line 613	C++
 	blender.exe!ccl::BlenderSync::sync_data(BL::RenderSettings & b_render, BL::Depsgraph & b_depsgraph, BL::SpaceView3D & b_v3d, BL::Object & b_override, int width, int height, void * * python_thread_state) Line 285	C++
 	blender.exe!ccl::BlenderSession::render(BL::Depsgraph & b_depsgraph_) Line 401	C++
 	blender.exe!ccl::render_func(_object * __formal, _object * args) Line 243	C++

The function where we access a null pointer is:

static bool rna_Object_indirect_only_get(Object *ob, bContext *C, PointerRNA *view_layer_ptr)
{
  Base *base = find_view_layer_base_with_synced_ensure(ob, C, view_layer_ptr, NULL, NULL);
  return ((base->flag & BASE_INDIRECT_ONLY) != 0);
}

Looking through the code a little, it can be expected that the fine function may return NULL, this isn't checked before looking at the flag. I have no idea the conditions in my file which would cause it to return NULL though as I don't know the code, but there is a code-path through it where it would return NULL if you look up the stack a little.

Hope this helps in resolving the issue, it still works fine in version of Blender Prior to 3.4

**System Information** Operating system: Windows-10-10.0.22000-SP0 64 Bits Graphics card: Intel(R) HD Graphics 620 Intel 4.5.0 - Build 31.0.101.2111 **Blender Version** Broken: version: 3.4.0, branch: blender-v3.4-release, commit date: 2022-12-06 18:46, hash: `a95bf1ac01` Worked: Any version prior to this **Short description of error** When rendering a large blend file in any build from 3.4 upwards I get a crash before the render starts. I have reproduced this in a debug build and can show where the issue is. I don't know the code so I am not sure why my blend file causes blender to get in this state and unfortunately it is commercially sensitive so can't share it. **Exact steps for others to reproduce the error** I load up my blend file and hit render. It fairly quickly hits an access violation. The call-stack is as follows: ``` > blender.exe!rna_Object_indirect_only_get(Object * ob, bContext * C, PointerRNA * view_layer_ptr) Line 208 C blender.exe!Object_indirect_only_get_func(Object * _self, bContext * C, PointerRNA * view_layer) Line 3365 C blender.exe!BL::Object::indirect_only_get(BL::Context C, BL::ViewLayer & view_layer) Line 65142 C++ blender.exe!ccl::BlenderSync::sync_object(BL::Depsgraph & b_depsgraph, BL::ViewLayer & b_view_layer, BL::DepsgraphObjectInstance & b_instance, float motion_time, bool use_particle_hair, bool show_lights, ccl::BlenderObjectCulling & culling, bool * use_portal, ccl::TaskPool * geom_task_pool) Line 227 C++ blender.exe!ccl::BlenderSync::sync_objects(BL::Depsgraph & b_depsgraph, BL::SpaceView3D & b_v3d, float motion_time) Line 613 C++ blender.exe!ccl::BlenderSync::sync_data(BL::RenderSettings & b_render, BL::Depsgraph & b_depsgraph, BL::SpaceView3D & b_v3d, BL::Object & b_override, int width, int height, void * * python_thread_state) Line 285 C++ blender.exe!ccl::BlenderSession::render(BL::Depsgraph & b_depsgraph_) Line 401 C++ blender.exe!ccl::render_func(_object * __formal, _object * args) Line 243 C++ ``` The function where we access a null pointer is: ``` static bool rna_Object_indirect_only_get(Object *ob, bContext *C, PointerRNA *view_layer_ptr) { Base *base = find_view_layer_base_with_synced_ensure(ob, C, view_layer_ptr, NULL, NULL); return ((base->flag & BASE_INDIRECT_ONLY) != 0); } ``` Looking through the code a little, it can be expected that the fine function may return NULL, this isn't checked before looking at the flag. I have no idea the conditions in my file which would cause it to return NULL though as I don't know the code, but there is a code-path through it where it would return NULL if you look up the stack a little. Hope this helps in resolving the issue, it still works fine in version of Blender Prior to 3.4
Author

Added subscriber: @Chris-Monachan

Added subscriber: @Chris-Monachan

#103087 was marked as duplicate of this issue

#103087 was marked as duplicate of this issue

#103010 was marked as duplicate of this issue

#103010 was marked as duplicate of this issue

Added subscriber: @mod_moder

Added subscriber: @mod_moder

Is it in September builds? in 3.3, 3.4, 3.5?

Is it in September builds? in 3.3, 3.4, 3.5?
Author

It does not crash in 3.3.2 (2022-12-06 18:19), it does crash in the 3.4 Stable released this week, and in 3.5 (latest code from the repository which I used to build my debug build). Hope this helps.

It does not crash in 3.3.2 (2022-12-06 18:19), it does crash in the 3.4 Stable released this week, and in 3.5 (latest code from the repository which I used to build my debug build). Hope this helps.

It's just a test. I don't know this module, but I see recent commits. Usually bisect is made by people from the checker module, but since there is no project ...
In general here:
https://builder.blender.org/download/daily/
Open the archive (text below this week's links)
And try to find 2 versions between which it appeared.
The fastest way to jump far (for example)
https://builder.blender.org/download/daily/archive/blender-3.4.0-alpha+master.caf6225a3d01-windows.amd64-release.zip
If there are no problems, jump up, if not, a little below.
In general, I think it will take the longest to download all this, the search usually takes me no more than 10 minutes (when there are 150 downloaded versions)

It's just a test. I don't know this module, but I see recent commits. Usually bisect is made by people from the checker module, but since there is no project ... In general here: https://builder.blender.org/download/daily/ Open the archive (text below this week's links) And try to find 2 versions between which it appeared. The fastest way to jump far (for example) https://builder.blender.org/download/daily/archive/blender-3.4.0-alpha+master.caf6225a3d01-windows.amd64-release.zip If there are no problems, jump up, if not, a little below. In general, I think it will take the longest to download all this, the search usually takes me no more than 10 minutes (when there are 150 downloaded versions)

Potential caused by: D16004: ViewLayer: fix missing sync in object APIs (fixes #101128)
Missing check on NULL

Potential caused by: [D16004: ViewLayer: fix missing sync in object APIs (fixes #101128)](https://archive.blender.org/developer/D16004) Missing check on NULL

I think you should not look for a version, let's wait for the author's opinion, most likely he will be able to explain this without your project

I think you should not look for a version, let's wait for the author's opinion, most likely he will be able to explain this without your project
Iliya Katushenock changed title from My blend file crashes when rendering in Blender 3.4 upwards, because of an unchecked NULL in the code. (stack trace provided) to Regression: My blend file crashes when rendering in Blender 3.4 upwards, because of an unchecked NULL in the code. (stack trace provided) 2022-12-08 17:12:22 +01:00
Member

Added subscribers: @aras_p, @PratikPB2123

Added subscribers: @aras_p, @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

@aras_p hi, can you take a look?
In e00f76c6a8 you'd removed the null check for *base in rna_Object_indirect_only_get

@aras_p hi, can you take a look? In e00f76c6a8 you'd removed the null check for `*base` in `rna_Object_indirect_only_get`
Aras Pranckevicius self-assigned this 2022-12-09 14:07:39 +01:00

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

Changed status from 'Needs Developer To Reproduce' to: 'Confirmed'

@Chris-Monachan yeah indeed the function seems to miss a

  if (!base) {
    return false;
  }

which was accidentally lost in e00f76c6a8 (sorry, my bad!). If you can confirm that this fixes the regression, I can commit that into the codebase properly.

@Chris-Monachan yeah indeed the function seems to miss a ``` if (!base) { return false; } ``` which was accidentally lost in e00f76c6a8 (sorry, my bad!). If you can confirm that this fixes the regression, I can commit that into the codebase properly.

Just in case it doesn't have a chance to test the build with this
And while doing this, you need to be sure that this is a working fix.
Can run a build bot?

Just in case it doesn't have a chance to test the build with this And while doing this, you need to be sure that this is a working fix. Can run a build bot?
Author

@aras_p , yeah that does get me past that crash when I added that check to the function. Nicely done, thanks! It would be great if this fix could be merged back to the 3.4 branch as I use that for production work.

@aras_p , yeah that does get me past that crash when I added that check to the function. Nicely done, thanks! It would be great if this fix could be merged back to the 3.4 branch as I use that for production work.

Added subscribers: @icedryst, @Siteth, @OmarEmaraDev

Added subscribers: @icedryst, @Siteth, @OmarEmaraDev

Added subscriber: @brecht

Added subscriber: @brecht

Restoring the NULL is the right solution, that can be committed.

Restoring the NULL is the right solution, that can be committed.

This issue was referenced by a47d1ad9d5

This issue was referenced by a47d1ad9d58b5596f942b28c03f07b4bded25ea6

This issue was referenced by 874319a344

This issue was referenced by 874319a3443f7150f78b34f5737b1bc159e5262e

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Member

Added subscribers: @RainerTrummer, @EAW

Added subscribers: @RainerTrummer, @EAW
Bastien Montagne added this to the Core project 2023-02-09 15:43:10 +01:00
Bastien Montagne removed this from the Core project 2023-02-09 18:19:07 +01:00
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
7 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#103031
No description provided.