**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: `rB0f45cab862b8`
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.
{F9587664}
{F9587663}
{F9587690}
**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.
{F9589484}
**Potential cause of the problem identified**
I can say with certainty that this happens only if any template_list() interface is present regarding ob.data.materials.
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.
**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.
{F9587680}