Crash [or faulty eevee render] when opening UDIM_monster #93797

Closed
opened 2021-12-07 10:05:37 +01:00 by Jeroen Bakker · 16 comments
Member

System Information
Operating system: Linux-5.13.0-7620-generic-x86_64-with-glibc2.33 64 Bits
Graphics card: Radeon RX Vega (VEGA10, DRM 3.41.0, 5.13.0-7620-generic, LLVM 12.0.0) AMD 4.6 (Core Profile) Mesa 21.2.2

Blender Version
Broken: version: 3.1.0 Alpha, branch: master, commit date: 2021-12-07 07:55, hash: 1de3636624
Worked: before d5efda72f5

The crash is that during preview rendering NTscales where the second node refers to uninitialized memory. (0xffffffffff). node_shader_tree.cc#localize

# Blender 3.1.0, Commit date: 2021-12-07 07:55, Hash 1de363662427

# backtrace
/home/jeroen/blender-git/build_linux/bin/blender(BLI_system_backtrace+0x39) [0x108dfc07]
/home/jeroen/blender-git/build_linux/bin/blender() [0x3a6cfa3]
/home/jeroen/blender-git/build_linux/bin/blender() [0x3a6d1cb]
/lib/x86_64-linux-gnu/libc.so.6(+0x41040) [0x7ffff7a8c040]
/home/jeroen/blender-git/build_linux/bin/blender() [0x6959dc7]
/home/jeroen/blender-git/build_linux/bin/blender(ntreeLocalize+0x151) [0x3b5efcf]
/home/jeroen/blender-git/build_linux/bin/blender(ntreeLocalize+0xa8) [0x3b5ef26]
/home/jeroen/blender-git/build_linux/bin/blender() [0x3b0b789]
/home/jeroen/blender-git/build_linux/bin/blender(BKE_id_copy_ex+0x112) [0x3ae894c]
/home/jeroen/blender-git/build_linux/bin/blender() [0x6a083c1]
/home/jeroen/blender-git/build_linux/bin/blender(ED_preview_icon_job+0x13e) [0x6a0c46e]
/home/jeroen/blender-git/build_linux/bin/blender() [0x55272f3]
/home/jeroen/blender-git/build_linux/bin/blender() [0x5528c76]
/home/jeroen/blender-git/build_linux/bin/blender(UI_icon_render_id+0xb0) [0x5528d52]
/home/jeroen/blender-git/build_linux/bin/blender(ui_id_icon_get+0xf0) [0x55292eb]
/home/jeroen/blender-git/build_linux/bin/blender(UI_icon_from_rnaptr+0x228) [0x55295e5]
/home/jeroen/blender-git/build_linux/bin/blender() [0x555e069]
/home/jeroen/blender-git/build_linux/bin/blender(uiTemplateList_ex+0x335) [0x555f7e6]
/home/jeroen/blender-git/build_linux/bin/blender(uiTemplateList+0x67) [0x555f881]
/home/jeroen/blender-git/build_linux/bin/blender(rna_uiTemplateList+0x88) [0x4b75373]
/home/jeroen/blender-git/build_linux/bin/blender(UILayout_template_list_call+0x13a) [0x4b7bcca]
/home/jeroen/blender-git/build_linux/bin/blender(RNA_function_call+0x4b) [0x49566f4]
/home/jeroen/blender-git/build_linux/bin/blender() [0x4c18ecf]
/home/jeroen/blender-git/build_linux/bin/blender(_PyObject_MakeTpCall+0x90) [0xf2fce20]
/home/jeroen/blender-git/build_linux/bin/blender(_PyEval_EvalFrameDefault+0x625c) [0x3a64ebc]
/home/jeroen/blender-git/build_linux/bin/blender() [0x3a5dcfb]
/home/jeroen/blender-git/build_linux/bin/blender(PyVectorcall_Call+0x5f) [0xf2fc87f]
/home/jeroen/blender-git/build_linux/bin/blender() [0x4c1c07b]
/home/jeroen/blender-git/build_linux/bin/blender() [0x4b711d7]
/home/jeroen/blender-git/build_linux/bin/blender() [0x4c4d182]
/home/jeroen/blender-git/build_linux/bin/blender(ED_region_panels_layout_ex+0x4d1) [0x4c4db51]
/home/jeroen/blender-git/build_linux/bin/blender() [0xe44bf51]
/home/jeroen/blender-git/build_linux/bin/blender() [0xe44caef]
/home/jeroen/blender-git/build_linux/bin/blender(ED_region_do_layout+0xcb) [0x4c462f7]
/home/jeroen/blender-git/build_linux/bin/blender() [0x41900ad]
/home/jeroen/blender-git/build_linux/bin/blender() [0x41908d0]
/home/jeroen/blender-git/build_linux/bin/blender(wm_draw_update+0xc9) [0x4190f1c]
/home/jeroen/blender-git/build_linux/bin/blender(WM_main+0x4c) [0x418c615]
/home/jeroen/blender-git/build_linux/bin/blender() [0x3a685d0]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xd5) [0x7ffff7a73565]
/home/jeroen/blender-git/build_linux/bin/blender(_start+0x2e) [0x3a67fbe]

# Python backtrace
  File "/home/jeroen/blender-git/build_linux/bin/3.1/scripts/startup/bl_ui/properties_material.py", line 117 in draw

Short description of error
When opening UDIM_monster from the command line blender crashes.

Exact steps for others to reproduce the error

  • Download and extract UDIM_monster.zip from the demo files
  • Open the file in blender and see it works.
  • Quit blender
  • Start Blender with --open-last option and it crashes.

Additional: seems to crash now always.... even release builds.

system-info.txt

**System Information** Operating system: Linux-5.13.0-7620-generic-x86_64-with-glibc2.33 64 Bits Graphics card: Radeon RX Vega (VEGA10, DRM 3.41.0, 5.13.0-7620-generic, LLVM 12.0.0) AMD 4.6 (Core Profile) Mesa 21.2.2 **Blender Version** Broken: version: 3.1.0 Alpha, branch: master, commit date: 2021-12-07 07:55, hash: `1de3636624` Worked: before d5efda72f5 The crash is that during preview rendering NTscales where the second node refers to uninitialized memory. (0xffffffffff). `node_shader_tree.cc#localize` ``` # Blender 3.1.0, Commit date: 2021-12-07 07:55, Hash 1de363662427 # backtrace /home/jeroen/blender-git/build_linux/bin/blender(BLI_system_backtrace+0x39) [0x108dfc07] /home/jeroen/blender-git/build_linux/bin/blender() [0x3a6cfa3] /home/jeroen/blender-git/build_linux/bin/blender() [0x3a6d1cb] /lib/x86_64-linux-gnu/libc.so.6(+0x41040) [0x7ffff7a8c040] /home/jeroen/blender-git/build_linux/bin/blender() [0x6959dc7] /home/jeroen/blender-git/build_linux/bin/blender(ntreeLocalize+0x151) [0x3b5efcf] /home/jeroen/blender-git/build_linux/bin/blender(ntreeLocalize+0xa8) [0x3b5ef26] /home/jeroen/blender-git/build_linux/bin/blender() [0x3b0b789] /home/jeroen/blender-git/build_linux/bin/blender(BKE_id_copy_ex+0x112) [0x3ae894c] /home/jeroen/blender-git/build_linux/bin/blender() [0x6a083c1] /home/jeroen/blender-git/build_linux/bin/blender(ED_preview_icon_job+0x13e) [0x6a0c46e] /home/jeroen/blender-git/build_linux/bin/blender() [0x55272f3] /home/jeroen/blender-git/build_linux/bin/blender() [0x5528c76] /home/jeroen/blender-git/build_linux/bin/blender(UI_icon_render_id+0xb0) [0x5528d52] /home/jeroen/blender-git/build_linux/bin/blender(ui_id_icon_get+0xf0) [0x55292eb] /home/jeroen/blender-git/build_linux/bin/blender(UI_icon_from_rnaptr+0x228) [0x55295e5] /home/jeroen/blender-git/build_linux/bin/blender() [0x555e069] /home/jeroen/blender-git/build_linux/bin/blender(uiTemplateList_ex+0x335) [0x555f7e6] /home/jeroen/blender-git/build_linux/bin/blender(uiTemplateList+0x67) [0x555f881] /home/jeroen/blender-git/build_linux/bin/blender(rna_uiTemplateList+0x88) [0x4b75373] /home/jeroen/blender-git/build_linux/bin/blender(UILayout_template_list_call+0x13a) [0x4b7bcca] /home/jeroen/blender-git/build_linux/bin/blender(RNA_function_call+0x4b) [0x49566f4] /home/jeroen/blender-git/build_linux/bin/blender() [0x4c18ecf] /home/jeroen/blender-git/build_linux/bin/blender(_PyObject_MakeTpCall+0x90) [0xf2fce20] /home/jeroen/blender-git/build_linux/bin/blender(_PyEval_EvalFrameDefault+0x625c) [0x3a64ebc] /home/jeroen/blender-git/build_linux/bin/blender() [0x3a5dcfb] /home/jeroen/blender-git/build_linux/bin/blender(PyVectorcall_Call+0x5f) [0xf2fc87f] /home/jeroen/blender-git/build_linux/bin/blender() [0x4c1c07b] /home/jeroen/blender-git/build_linux/bin/blender() [0x4b711d7] /home/jeroen/blender-git/build_linux/bin/blender() [0x4c4d182] /home/jeroen/blender-git/build_linux/bin/blender(ED_region_panels_layout_ex+0x4d1) [0x4c4db51] /home/jeroen/blender-git/build_linux/bin/blender() [0xe44bf51] /home/jeroen/blender-git/build_linux/bin/blender() [0xe44caef] /home/jeroen/blender-git/build_linux/bin/blender(ED_region_do_layout+0xcb) [0x4c462f7] /home/jeroen/blender-git/build_linux/bin/blender() [0x41900ad] /home/jeroen/blender-git/build_linux/bin/blender() [0x41908d0] /home/jeroen/blender-git/build_linux/bin/blender(wm_draw_update+0xc9) [0x4190f1c] /home/jeroen/blender-git/build_linux/bin/blender(WM_main+0x4c) [0x418c615] /home/jeroen/blender-git/build_linux/bin/blender() [0x3a685d0] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xd5) [0x7ffff7a73565] /home/jeroen/blender-git/build_linux/bin/blender(_start+0x2e) [0x3a67fbe] # Python backtrace File "/home/jeroen/blender-git/build_linux/bin/3.1/scripts/startup/bl_ui/properties_material.py", line 117 in draw ``` **Short description of error** When opening UDIM_monster from the command line blender crashes. **Exact steps for others to reproduce the error** * Download and extract UDIM_monster.zip from the demo files * Open the file in blender and see it works. * Quit blender * Start Blender with `--open-last` option and it crashes. Additional: seems to crash now always.... even release builds. [system-info.txt](https://archive.blender.org/developer/F12703582/system-info.txt)
Author
Member

Added subscriber: @Jeroen-Bakker

Added subscriber: @Jeroen-Bakker
Jeroen Bakker changed title from Crash when opening file from command line. to Crash when opening UDIM_monster 2021-12-07 10:25:15 +01:00
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Hm, seems like I cannot repro here

**System Information**
Operating system: Linux-5.13.0-0.rc6.45.fc35.x86_64-x86_64-with-glibc2.34.9000 64 Bits
Graphics card: NVIDIA GeForce GTX 970M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 495.44
version: 3.1.0 Alpha, branch: master, commit date: 2021-12-07 06:38, hash: `rBffc4c126f541`
Hm, seems like I cannot repro here ``` **System Information** Operating system: Linux-5.13.0-0.rc6.45.fc35.x86_64-x86_64-with-glibc2.34.9000 64 Bits Graphics card: NVIDIA GeForce GTX 970M/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 495.44 version: 3.1.0 Alpha, branch: master, commit date: 2021-12-07 06:38, hash: `rBffc4c126f541` ```

Added subscriber: @deadpin

Added subscriber: @deadpin

Here's the ASAN report and it more or less matches the initial stack above:

udim-crash.txt

Here's the ASAN report and it more or less matches the initial stack above: [udim-crash.txt](https://archive.blender.org/developer/F12703743/udim-crash.txt)
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

What I do see though that the monster renders differently in Eevee (and for that, that file can be opened "normally", meaning you dont have to do the dance with --open-last), Cycles is fine though:
before d5efda72f5
image.png
after d5efda72f5
image.png

CC @Blendify

What I do see though that the monster renders differently in Eevee (and for that, that file can be opened "normally", meaning you dont have to do the dance with `--open-last`), Cycles is fine though: before d5efda72f5 ![image.png](https://archive.blender.org/developer/F12703747/image.png) after d5efda72f5 ![image.png](https://archive.blender.org/developer/F12703790/image.png) CC @Blendify
Philipp Oeser changed title from Crash when opening UDIM_monster to Crash [or fauly eevee render] when opening UDIM_monster 2021-12-07 11:02:05 +01:00
Philipp Oeser changed title from Crash [or fauly eevee render] when opening UDIM_monster to Crash [or faulty eevee render] when opening UDIM_monster 2021-12-07 11:02:13 +01:00

The code in localize was changed. Fixing that will fix the crash, but the result is still broken and looks like Philipp's above. Haven't been able to find out the reason though.

Before

  bNode *node, *node_next;

  /* replace muted nodes and reroute nodes by internal links */
  for (node = localtree->nodes.first; node; node = node_next) {
    node_next = node->next;

    if (node->flag & NODE_MUTED || node->type == NODE_REROUTE) {
      nodeInternalRelink(localtree, node);
      ntreeFreeLocalNode(localtree, node);
    }
  }```

After -- missed saving the `node_next` manually since node get destroyed inside the conditional there
/* replace muted nodes and reroute nodes by internal links */
LISTBASE_FOREACH (bNode *, node, &localtree->nodes) {
  if (node->flag & NODE_MUTED || node->type == NODE_REROUTE) {
    nodeInternalRelink(localtree, node);
    ntreeFreeLocalNode(localtree, node);
  }
}
The code in localize was changed. Fixing that will fix the crash, but the result is still broken and looks like Philipp's above. Haven't been able to find out the reason though. Before ``` bNode *node, *node_next; /* replace muted nodes and reroute nodes by internal links */ for (node = localtree->nodes.first; node; node = node_next) { node_next = node->next; if (node->flag & NODE_MUTED || node->type == NODE_REROUTE) { nodeInternalRelink(localtree, node); ntreeFreeLocalNode(localtree, node); } }``` After -- missed saving the `node_next` manually since node get destroyed inside the conditional there ``` ``` /* replace muted nodes and reroute nodes by internal links */ LISTBASE_FOREACH (bNode *, node, &localtree->nodes) { if (node->flag & NODE_MUTED || node->type == NODE_REROUTE) { nodeInternalRelink(localtree, node); ntreeFreeLocalNode(localtree, node); } } ```

This issue was referenced by ae5a89e80a

This issue was referenced by ae5a89e80af78b85877a049d392a84553f2791aa
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Julian Eisel self-assigned this 2021-12-07 12:03:38 +01:00
Member

Thanks guys for the analysis, with that it was trivial to fix the crash/undefined-behavior. There are still the differences in rendering, but this is better handled as a separate issue.

Thanks guys for the analysis, with that it was trivial to fix the crash/undefined-behavior. There are still the differences in rendering, but this is better handled as a separate issue.
Member

For the record, the Cube Diorama demo file is also broken now. This is how it looks currently: image.png This is how it should look (older 3.0 build, so ignore other differences): image.png

Are we sure that this issue also comes from the same commit?

For the record, the Cube Diorama demo file is also broken now. This is how it looks currently: ![image.png](https://archive.blender.org/developer/F12704038/image.png) This is how it should look (older 3.0 build, so ignore other differences): ![image.png](https://archive.blender.org/developer/F12704057/image.png) Are we sure that this issue also comes from the same commit?

There's at least one more "mutable" iterator that needs fixup from that same commit, so I'd say so :)
Line ~465 of node_shader_tree.cc

Fixing that one gets this bug, #93798, and the diorama fixed up.

There's at least one more "mutable" iterator that needs fixup from that same commit, so I'd say so :) Line ~465 of node_shader_tree.cc Fixing that one gets this bug, #93798, and the diorama fixed up.
Member

Are we sure that this issue also comes from the same commit?

yes

There are still the differences in rendering, but this is better handled as a separate issue.

If we close something like this, can we please make sure to have another report open for the remaining issue(s)?

In the end, this might boild down to #93798 (Eevee: Group node shaders do not get compiled when using Mix Shader node), just saying we risk something slipping through this way...

@deadpin : great, could you post a diff or something in #93798 then?

> Are we sure that this issue also comes from the same commit? yes > There are still the differences in rendering, but this is better handled as a separate issue. If we close something like this, can we please make sure to have another report open for the remaining issue(s)? In the end, this might boild down to #93798 (Eevee: Group node shaders do not get compiled when using Mix Shader node), just saying we risk something slipping through this way... @deadpin : great, could you post a diff or something in #93798 then?
Member

If we close something like this, can we please make sure to have another report open for the remaining issue(s)?

Yes we were actively looking at it and discussing the situation (in person in the Studio & in #blender-coders). Decision is to revert the commit and let it go through a proper review first (to catch these errors and address other C++ code style problems).

> If we close something like this, can we please make sure to have another report open for the remaining issue(s)? Yes we were actively looking at it and discussing the situation (in person in the Studio & in #blender-coders). Decision is to revert the commit and let it go through a proper review first (to catch these errors and address other C++ code style problems).
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
5 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#93797
No description provided.