Blender crashes on render when OSL script uses more than two textures #40884

Closed
opened 2014-06-30 06:02:29 +02:00 by Tom Benedett · 11 comments

System Information
Windows 8.1 64-bit and GeForce GT 735 M (Sony VAIO SVF 15A)

Blender Version
Broken: 2.71 9337574, (official 2) and 2.71 5588e45 (latest Windows x64 buildbot version)
Worked: (I don't know of any)

Problem Description
When attempting to use an Open Shading Language script that loads more than two textures, blender crashes immediately upon beginning a render (viewport or not). The OSL shader will successfully compile, but attempting to use it causes a crash.

Crashes only occur if more than two textures contribute to the output of the script; if a texture is included in the code but not used, the script can be used without crashing.

The problem does not appear to be the combined size of the textures; a single 868 kb texture loads perfectly while three 3.63 kb textures cause a crash.

The problem does not appear to be a limited number of textures accessible by all OSL scripts in a .blend file that are contributing to a material; using multiple scripts and choosing different textures to output does not cause a crash, so long as no more than two textures are used by any individual script.

Exact steps for others to reproduce the error
A .blend file containing an example of such a problematic script is included; the .zip file contains the Textures folder that is referred to in the script. To get the OSL script in the .blend file to run without modification, extract the .zip file so that 0.png, 1.png, and 2.png are located in C:\Textures. But the script node has a field for entering the data path, which can be changed to point to any directory you'd like, so you don't need to put them where I did in my example.

An example OSL script should be open in a text window when the .blend file is opened: the script is included below, with an additional comment describing what to change to cause the crash:

include "stdosl.h"

shader Multitexture(

  string Folder = "C:/Textures/",
  output color Stamp = 0)

{

  float x1 = P[0];
  float y1 = -P[1];
  color Number = texture(concat(Folder,"0.png"),x1,y1);
  color Number1 = texture(concat(Folder,"1.png"),x1-1.0,y1);
  color Number2 = texture(concat(Folder,"2.png"),x1-2.0,y1);
  color total = Number+Number1+0*Number2;

// Change the above line to "color total = Number+Number1+Number2;" (remove the 0*) and click "script node update" and then try a viewport render in the 3D view window to the right of the text window. For me, Blender crashes.

  Stamp = total;

}

Multitexture_Test.blend
Textures.zip

**System Information** Windows 8.1 64-bit and GeForce GT 735 M (Sony VAIO SVF 15A) **Blender Version** Broken: 2.71 9337574, (official 2) and 2.71 5588e45 (latest Windows x64 buildbot version) Worked: (I don't know of any) **Problem Description** When attempting to use an Open Shading Language script that loads more than two textures, blender crashes immediately upon beginning a render (viewport or not). The OSL shader will successfully compile, but attempting to use it causes a crash. Crashes only occur if more than two textures contribute to the output of the script; if a texture is included in the code but not used, the script can be used without crashing. The problem does not appear to be the combined size of the textures; a single 868 kb texture loads perfectly while three 3.63 kb textures cause a crash. The problem does not appear to be a limited number of textures accessible by all OSL scripts in a .blend file that are contributing to a material; using multiple scripts and choosing different textures to output does not cause a crash, so long as no more than two textures are used by any individual script. **Exact steps for others to reproduce the error** A .blend file containing an example of such a problematic script is included; the .zip file contains the Textures folder that is referred to in the script. To get the OSL script in the .blend file to run without modification, extract the .zip file so that 0.png, 1.png, and 2.png are located in C:\Textures\. But the script node has a field for entering the data path, which can be changed to point to any directory you'd like, so you don't need to put them where I did in my example. An example OSL script should be open in a text window when the .blend file is opened: the script is included below, with an additional comment describing what to change to cause the crash: # include "stdosl.h" shader Multitexture( ``` string Folder = "C:/Textures/", output color Stamp = 0) ``` { ``` float x1 = P[0]; float y1 = -P[1]; color Number = texture(concat(Folder,"0.png"),x1,y1); color Number1 = texture(concat(Folder,"1.png"),x1-1.0,y1); color Number2 = texture(concat(Folder,"2.png"),x1-2.0,y1); color total = Number+Number1+0*Number2; ``` // Change the above line to "color total = Number+Number1+Number2;" (remove the 0*) and click "script node update" and then try a viewport render in the 3D view window to the right of the text window. For me, Blender crashes. ``` Stamp = total; ``` } [Multitexture_Test.blend](https://archive.blender.org/developer/F96069/Multitexture_Test.blend) [Textures.zip](https://archive.blender.org/developer/F96070/Textures.zip)
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @moak

Added subscriber: @moak
Author

I thought I didn't have any older versions to compare to, but it turns out that I did:

Blender 2.69 - revision e5aaa9d, from 2013/12/25, is able to load at least four different textures without crashing (I did not find an upper limit). So this did work in the past.

I thought I didn't have any older versions to compare to, but it turns out that I did: Blender 2.69 - revision e5aaa9d, from 2013/12/25, is able to load at least four different textures without crashing (I did not find an upper limit). So this did work in the past.
Author

Blender 2.70a official (f93bc76, 2014/4/10) also works.

Blender 2.70a official (f93bc76, 2014/4/10) also works.
Sergey Sharybin self-assigned this 2014-06-30 09:52:37 +02:00

Added subscriber: @ThomasDinges

Added subscriber: @ThomasDinges

I can't really reroduce the crash nether on windows nor on linux. Did you try loading factory settings before tests?

I can't really reroduce the crash nether on windows nor on linux. Did you try loading factory settings before tests?

I cannot get it to crash either, all 3 textures are rendered. (Windows 7 x64, 0b5fda5)

I cannot get it to crash either, all 3 textures are rendered. (Windows 7 x64, 0b5fda5)
Author

I didn't think that any relevant settings were changed from factory settings, but after trying that, it still crashes.

I will try it again on another computer when I have access to it later this week.

I didn't think that any relevant settings were changed from factory settings, but after trying that, it still crashes. I will try it again on another computer when I have access to it later this week.
Author

Okay, the latest Windows 64-bit Buildbot version (fedbb88) still crashes (even with factory settings loaded) on the computer on which I first observed this behavior, but on my main Blender station, a Windows 7 64-bit desktop with a GTX 580 GPU, the same Blender version under the same conditions does not crash.

I don't think this is a problem that will bother me again, so do what you will with this bug report.

Okay, the latest Windows 64-bit Buildbot version (fedbb88) still crashes (even with factory settings loaded) on the computer on which I first observed this behavior, but on my main Blender station, a Windows 7 64-bit desktop with a GTX 580 GPU, the same Blender version under the same conditions does not crash. I don't think this is a problem that will bother me again, so do what you will with this bug report.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

Well, the thing is -- in order to be able to fix an issue we need to be able to reproduce it first. Since you can not reproduce it on another computer it's likely something up to the local settings on the machine with an issue.

If you manage to find steps how to reproduce the crash on your another computer then please let us know, likely them we'll be able to reproduce as well.

For until then i'm archiving the report. Please share info here if you have news!

Well, the thing is -- in order to be able to fix an issue we need to be able to reproduce it first. Since you can not reproduce it on another computer it's likely something up to the local settings on the machine with an issue. If you manage to find steps how to reproduce the crash on your another computer then please let us know, likely them we'll be able to reproduce as well. For until then i'm archiving the report. Please share info here if you have news!
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
3 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#40884
No description provided.