Blender Crash when creating PBR material via script #84866

Closed
opened 2021-01-19 18:11:39 +01:00 by Andrea · 32 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89

Blender Version
Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: 0f45cab862
Worked: (newest version of Blender that worked as expected)

Short description of error
Blender crashes when trying to add material created with a script. It seems to only happen with the advent of 2.91, but I'm not sure that's why. This happens especially with activated denoising.

blender_system_info.txt

blender_debug_output.txt

crash test.crash.txt

Exact steps for others to reproduce the error
I have attached a project containing 4 textures and a script Made on purpose to simplify and test this error, that can be activated directly from the text editor, To simplify the reproduction of this crash.

Then Select the cube and press many time "Create 4k material" button.

blender_PGTS6KaHMM.png
Potential cause of the problem identified

I can say with certainty that this happens only if any template_list() interface is present regarding ob.material_slots.
Even the Blender UIList "MATERIAL_UL_matslots" if present in the user interface will crash Blender.
The crash will never occur if UIList is not present / visible
I can confirm with certainty that template_list() appears to be the cause of this crash.

When it happens, and when it doesn't:

  • Happens: Always when the preview icons are shown somewhere in the Blender panel in general.

  • Happens: Only when the Bump or Normal maps will be linked to the Principled BSDF node

  • It does not happen: Never when no node is connected to the "Normal" input of the Princlipled BSDF

  • It does not happen: Never in "ViewPorting Shading Rendered" mode with Cycles render engine

  • Happens: Always when "ViewPorting Shading Material Preview" mode with Cycles render engine

  • It does not happen: Never in "ViewPorting Solid" mode Never with Cycles or Eevee.

  • It does not happen: Never With Render Engine Eevee in (Solid/ Material Preview/ Rendered) Modes

Hardware configuration on another computer presents the same problem

I also tested this on an MSI laptop with intel i7 16GB Ram and Nvidia GTX960M but the same issue.
It seems random, but denoising seems to rage a lot, if activated it crashes almost immediately
I also noticed that it also seems to depend a lot on the size of the textures, I don't know if this is useful.

crash test.blend

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: GeForce GTX 1080 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.89 **Blender Version** Broken: version: 2.91.0, branch: master, commit date: 2020-11-25 08:34, hash: `0f45cab862` Worked: (newest version of Blender that worked as expected) **Short description of error** Blender crashes when trying to add material created with a script. It seems to only happen with the advent of 2.91, but I'm not sure that's why. This happens especially with activated denoising. [blender_system_info.txt](https://archive.blender.org/developer/F9587664/blender_system_info.txt) [blender_debug_output.txt](https://archive.blender.org/developer/F9587663/blender_debug_output.txt) [crash test.crash.txt](https://archive.blender.org/developer/F9587690/crash_test.crash.txt) **Exact steps for others to reproduce the error** I have attached a project containing 4 textures and a script Made on purpose to simplify and test this error, that can be activated directly from the text editor, To simplify the reproduction of this crash. Then Select the cube and press many time "Create 4k material" button. ![blender_PGTS6KaHMM.png](https://archive.blender.org/developer/F9589484/blender_PGTS6KaHMM.png) **Potential cause of the problem identified** I can say with certainty that this happens only if any template_list() interface is present regarding ob.material_slots. Even the Blender UIList "MATERIAL_UL_matslots" if present in the user interface will crash Blender. The crash will never occur if UIList is not present / visible I can confirm with certainty that template_list() appears to be the cause of this crash. **When it happens, and when it doesn't:** - *Happens*: Always when the preview icons are shown somewhere in the Blender panel in general. - *Happens*: Only when the Bump or Normal maps will be linked to the Principled BSDF node - *It does not happen*: Never when no node is connected to the "Normal" input of the Princlipled BSDF - *It does not happen*: Never in "ViewPorting Shading Rendered" mode with Cycles render engine - *Happens*: Always when "ViewPorting Shading Material Preview" mode with Cycles render engine - *It does not happen*: Never in "ViewPorting Solid" mode Never with Cycles or Eevee. - *It does not happen*: Never With Render Engine Eevee in (Solid/ Material Preview/ Rendered) Modes **Hardware configuration on another computer presents the same problem** I also tested this on an MSI laptop with intel i7 16GB Ram and Nvidia GTX960M but the same issue. It seems random, but denoising seems to rage a lot, if activated it crashes almost immediately I also noticed that it also seems to depend a lot on the size of the textures, I don't know if this is useful. [crash test.blend](https://archive.blender.org/developer/F9587680/crash_test.blend)
Author

Added subscriber: @Andrew_D-1

Added subscriber: @Andrew_D-1
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

I cannot reproduce. I tried 2.91.0 and 2.93 alpha. This might be related to #84324, #81183, & #84438, which also involve NVIDIA Pascal GPUs and calls to image_get_gpu_texture, so it might be an issue only on that generation of hardware.

Please try using the latest daily builds at https://builder.blender.org/download/ to see if that fixes the issue.

I cannot reproduce. I tried 2.91.0 and 2.93 alpha. This might be related to #84324, #81183, & #84438, which also involve NVIDIA Pascal GPUs and calls to `image_get_gpu_texture,` so it might be an issue only on that generation of hardware. Please try using the latest daily builds at https://builder.blender.org/download/ to see if that fixes the issue.
Author

Unfortunately this also seems to happen on a RTX 3080 With properly updated drivers, and really, it's a completely random event (apparently). Unfortunately I have no way of reporting this stack at the moment, it was reported to me by a user, also on Windows 10 with Geforce RTX 3080/ AMD Ryzen 9/ 64GB RAM

I have received various reports from other users with this problem but only recently.

In any case, I also tried on yesterday's build of 2.92, and the same happens. I have updated the drivers several times, but this does not solve the problem.

In addition, if I can be of further help,to test the crash, I suggest pressing the "Create Material 4k" button several times repeatedly. Very often the crash occurs even without pressing repeatedly, but to do an immediate test, you need to press really fast, otherwise you risk not being able to reproduce the error immediately.

Unfortunately this also seems to happen on a RTX 3080 With properly updated drivers, and really, it's a completely random event (apparently). Unfortunately I have no way of reporting this stack at the moment, it was reported to me by a user, also on Windows 10 with Geforce RTX 3080/ AMD Ryzen 9/ 64GB RAM I have received various reports from other users with this problem but only recently. In any case, I also tried on yesterday's build of 2.92, and the same happens. I have updated the drivers several times, but this does not solve the problem. In addition, if I can be of further help,to test the crash, I suggest pressing the "Create Material 4k" button several times repeatedly. Very often the crash occurs even without pressing repeatedly, but to do an immediate test, you need to press really fast, otherwise you risk not being able to reproduce the error immediately.

Added subscriber: @eklein

Added subscriber: @eklein

Added subscriber: @steffenthomas

Added subscriber: @steffenthomas

I cannot reproduce. I tried 2.91.0 (E-Cycles RTX version). I tried on a RTX 2080 Ti.

I cannot reproduce. I tried 2.91.0 (E-Cycles RTX version). I tried on a RTX 2080 Ti.
Author

Hello Thomas , thanks for your interest. Have you tried to rush a few dozen repeated clicks on the button? Sometimes I also struggle to reproduce this error. If I may suggest changing the Workspace, it seems that sometimes this also interferes. But I'm not sure about anything, I've done hundreds of tests. Sometimes it crashes immediately, I reopen the blender and it crashes again. Also 3 Times in a row yesterday. Then it magically works again for a few moments. This is accentuated on 4k textures, with 1K or 2K textures It doesn't seem to happen often.

Hello Thomas , thanks for your interest. Have you tried to rush a few dozen repeated clicks on the button? Sometimes I also struggle to reproduce this error. If I may suggest changing the Workspace, it seems that sometimes this also interferes. But I'm not sure about anything, I've done hundreds of tests. Sometimes it crashes immediately, I reopen the blender and it crashes again. Also 3 Times in a row yesterday. Then it magically works again for a few moments. This is accentuated on 4k textures, with 1K or 2K textures It doesn't seem to happen often.

Ok, i tried it again several times. Now i could reproduce the issue one time. I clicked about 60 times on the button as fast as i could and blender crashed.
Maybe i runs out of (video) memory?

Ok, i tried it again several times. Now i could reproduce the issue one time. I clicked about 60 times on the button as fast as i could and blender crashed. Maybe i runs out of (video) memory?

It was not easy either to reproduce with rtx3090. If added really fast like 20 times and remove and did it a few times a got Blender to crash and exit consistently. I don't think is the memory since my GPU has 24gb and CPU 64gb.

It was not easy either to reproduce with rtx3090. If added really fast like 20 times and remove and did it a few times a got Blender to crash and exit consistently. I don't think is the memory since my GPU has 24gb and CPU 64gb.
Author

Now for example, the crash occurs on my second attempt to add material.
This seems to happen when the icon preview of the material is rendered. This doesn't seem to happen in 'SOLID' mode

si3xCSNvGw.mp4

Now for example, the crash occurs on my second attempt to add material. This seems to happen when the icon preview of the material is rendered. This doesn't seem to happen in 'SOLID' mode [si3xCSNvGw.mp4](https://archive.blender.org/developer/F9591339/si3xCSNvGw.mp4)

Added subscriber: @Pixelink

Added subscriber: @Pixelink

I Tested this on 2.91.

And it did crash after my 3rd click (fairly quickly)

RTX 2060 (4 GB)
16 GB RAM

I Tested this on 2.91. And it did crash after my 3rd click (fairly quickly) RTX 2060 (4 GB) 16 GB RAM
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'

Added subscriber: @rjg

Added subscriber: @rjg

I was unable to reproduce the crash so far. Does it still happen when in the daily builds of Blender 2.92 and 2.93 ?

I was unable to reproduce the crash so far. Does it still happen when in the [daily builds of Blender 2.92 and 2.93 ](https://builder.blender.org/download/)?
Author

Hello Robert, I've been testing right now both the latest 2.92 Beta Build, and the 2.93 Alpha as well. The same happens.
But I wanted to make sure, if you are also using a GTX 1080Ti (As I understand from your profile)
Anyway, if I can be of any help, This Crash also seems to depend on the viewing angle on the cube. Today I tried and I couldn't reproduce the crash, so I went through several Workspaces, then I moved the viewport (In random) and finally I was able to create the crash again. This without having to click repeatedly in bursts "Create Material 4k"
So if I can, I suggest you try the same, move the camera a bit, go through some workspace, for example Scripting-To-Layout, zoom in, rotate, zoom out the viewport, during these actions try to add the material.
I am aware that it looks like a fool, but I really don't know why, it seems to facilitate the crash.

Hello Robert, I've been testing right now both the latest 2.92 Beta Build, and the 2.93 Alpha as well. The same happens. But I wanted to make sure, if you are also using a GTX 1080Ti (As I understand from your profile) Anyway, if I can be of any help, This Crash also seems to depend on the viewing angle on the cube. Today I tried and I couldn't reproduce the crash, so I went through several Workspaces, then I moved the viewport (In random) and finally I was able to create the crash again. This without having to click repeatedly in bursts "Create Material 4k" So if I can, I suggest you try the same, move the camera a bit, go through some workspace, for example Scripting-To-Layout, zoom in, rotate, zoom out the viewport, during these actions try to add the material. I am aware that it looks like a fool, but I really don't know why, it seems to facilitate the crash.

Added subscriber: @mrusso81

Added subscriber: @mrusso81

@Andrew_D-1 I'm getting a lot of crashes using regularly Extreme PBR. I downloaded the .blend but could not find any script. Where is it located? Thanks

@Andrew_D-1 I'm getting a lot of crashes using regularly Extreme PBR. I downloaded the .blend but could not find any script. Where is it located? Thanks

Added subscriber: @Punker3D

Added subscriber: @Punker3D

This comment was removed by @Punker3D

*This comment was removed by @Punker3D*

Using the provided blend file I get the crash after 2 clicks, repeatable.

macOS Mojave 10.14.6
Mac Pro (Mid 2012)
Processor 3.33 GHz 6-Core Intel Xeon
Memory 64 GB 1333 MHz DDR3
Hard Drive SSD
Graphics Radeon RX 580 8 GB
Monitor 34" Samsung 3440 x 1440

Using the provided blend file I get the crash after 2 clicks, repeatable. macOS Mojave 10.14.6 Mac Pro (Mid 2012) Processor 3.33 GHz 6-Core Intel Xeon Memory 64 GB 1333 MHz DDR3 Hard Drive SSD Graphics Radeon RX 580 8 GB Monitor 34" Samsung 3440 x 1440
Author

This comment was removed by @Andrew_D-1

*This comment was removed by @Andrew_D-1*
Author

This comment was removed by @Andrew_D-1

*This comment was removed by @Andrew_D-1*
Andrea changed title from Blender Crash when creating PBR material via script to Blender Crash when creating PBR material via script (Only when there is a UIList of materials in the interface) 2021-02-19 08:27:06 +01:00
Author

In #84866#1101053, @rjg wrote:
I was unable to reproduce the crash so far. Does it still happen when in the daily builds of Blender 2.92 and 2.93 ?

I have narrowed the field, updated the description (Take a look if you want), understood when exactly this happens, these exact conditions are needed:
Having Render engine Cycles in ViewPort Material Preview Mode, the preview icons Only if you show up somewhere will cause crash only if the Principled BSDF node has the Normal input connected.
So these conditions, only with these conditions the crash will happen.
I don't understand why not everyone crashes, but In any case Applying 10 times the material erases all 10 materials quickly, and reapplying 1 material 9/10 times on the fly causes crashes only under these conditions.

It still happens on version 2.92 from yesterday

> In #84866#1101053, @rjg wrote: > I was unable to reproduce the crash so far. Does it still happen when in the [daily builds of Blender 2.92 and 2.93 ](https://builder.blender.org/download/)? I have narrowed the field, updated the description (Take a look if you want), understood when exactly this happens, these exact conditions are needed: Having Render engine Cycles in ViewPort Material Preview Mode, the preview icons Only if you show up somewhere will cause crash only if the Principled BSDF node has the Normal input connected. So these conditions, only with these conditions the crash will happen. I don't understand why not everyone crashes, but In any case Applying 10 times the material erases all 10 materials quickly, and reapplying 1 material 9/10 times on the fly causes crashes only under these conditions. It still happens on version 2.92 from yesterday
Andrea changed title from Blender Crash when creating PBR material via script (Only when there is a UIList of materials in the interface) to Blender Crash when creating PBR material via script 2021-02-19 13:03:25 +01:00
Author

There is no news about it but it seems the problem has remained 😅

There is no news about it but it seems the problem has remained 😅
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

Since we really have troubles reproducing, me included, (and this report seems somewhat "stuck"), I would like to ask if (by any chance) the situation has improved in 3.0/3.1?
Could you check if this is still crashing for you in latest builds from https://builder.blender.org/download/daily/?

Since we really have troubles reproducing, me included, (and this report seems somewhat "stuck"), I would like to ask if (by any chance) the situation has improved in 3.0/3.1? Could you check if this is still crashing for you in latest builds from https://builder.blender.org/download/daily/?
Member

Changed status from 'Needs User Info' to: 'Archived'

Changed status from 'Needs User Info' to: 'Archived'
Member

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed.

Thanks again for the report. If the problem persists please open a new report with the required information.

No activity for more than a week. As per the tracker policy we assume the issue is gone and can be closed. Thanks again for the report. If the problem persists please open a new report with the required information.
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
9 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#84866
No description provided.