OSL: Cycles Script Node with trace call crashes Blender on render #54887

Closed
opened 2018-04-29 19:17:37 +02:00 by Tim · 13 comments

System Information
Windows 10 64 bit, GTX 980 Ti, rendering on i9-7900X

Blender Version
Broken:
2.75a c27589e
2.78c e92f235283
2.79b f4dc9f9d68
2.79 5740505 (latest build)
2.79 60f4cb2 (latest build, win32)
2.80 cfa1700 (latest build)

Worked:
2.70 19e627c

Short description of error
A trivial OSL Script Node in Cycles where trace(a, b) and then getmessage("trace", hitdist", dist) is called and result is passed to mix node crashes Blender with EXCEPTION_ACCESS_VIOLATION on render. I experienced similar crashes even when trace/getmessage weren't being called, but this particular example was easiest to reproduce consistently.

Exact steps for others to reproduce the error
osl-bug.blend
Open attached .blend file, switch to rendered viewport shading or hit render to instantly crash Blender.

**System Information** Windows 10 64 bit, GTX 980 Ti, rendering on i9-7900X **Blender Version** Broken: 2.75a c27589e 2.78c e92f235283 2.79b f4dc9f9d68b 2.79 5740505 (latest build) 2.79 60f4cb2 (latest build, win32) 2.80 cfa1700 (latest build) Worked: 2.70 19e627c **Short description of error** A trivial OSL Script Node in Cycles where `trace(a, b)` and then `getmessage("trace", hitdist", dist)` is called and result is passed to mix node crashes Blender with `EXCEPTION_ACCESS_VIOLATION` on render. I experienced similar crashes even when trace/getmessage weren't being called, but this particular example was easiest to reproduce consistently. **Exact steps for others to reproduce the error** [osl-bug.blend](https://archive.blender.org/developer/F3123248/osl-bug.blend) Open attached .blend file, switch to rendered viewport shading or hit render to instantly crash Blender.
Author

Added subscriber: @ptim

Added subscriber: @ptim
Member

Added subscriber: @lichtwerk

Added subscriber: @lichtwerk
Member

Cannot reproduce here (checked official releases 2.79, 2.79a, 2.79b, 2.78c), but I'm on linux...
Someone on Windows being able to reproduce?

Cannot reproduce here (checked official releases 2.79, 2.79a, 2.79b, 2.78c), but I'm on linux... Someone on Windows being able to reproduce?

Added subscriber: @ChristopherAnderssarian

Added subscriber: @ChristopherAnderssarian

Cannot reproduce on 5960x CPU with 2.79a/b on Windows 7.

Through author probably used their GTX 980 Ti.

Cannot reproduce on 5960x CPU with 2.79a/b on Windows 7. Through author probably used their GTX 980 Ti.
Member

@ChristopherAnderssarian : thx for testing.
OSL is CPU only afaik.

@ChristopherAnderssarian : thx for testing. OSL is CPU only afaik.

dufff.....
Shows I don't have experience with GPU Rendering....

dufff..... Shows I don't have experience with GPU Rendering....
Author

The full error message is:

LLVM ERROR: Cannot select: 0x18cf82f1080: f32 = X86ISD::FSETCCss 0x18cf82f79e0, 0x18cf82f1880, 0x18cf82f1280 [ORD=89] [ID=38]
  0x18cf82f79e0: f32 = X86ISD::FMIN 0x18cf82f81f0, 0x18cf82f1780 [ORD=87] [ID=37]
    0x18cf82f81f0: f32,ch = load 0x18cf348cc88, 0x18cf82f7ff0, 0x18cf34244f0<LD4[ConstantPool]> [ID=31]
      0x18cf82f7ff0: i64 = X86ISD::Wrapper 0x18cf34245f0 [ID=19]
        0x18cf34245f0: i64 = TargetConstantPool<float 1.000000e+00> 0 [ID=13]
      0x18cf34244f0: i64 = undef [ID=3]
    0x18cf82f1780: f32,ch = load 0x18cf348cc88, 0x18cf3422fd0, 0x18cf34244f0<LD4[%sunkaddr8]> [ORD=85] [ID=36]
      0x18cf3422fd0: i64 = add 0x18cf34231d0, 0x18cf3424af0 [ORD=83] [ID=30]
        0x18cf34231d0: i64,ch = CopyFromReg 0x18cf348cc88, 0x18cf82f70e0 [ORD=82] [ID=18]
          0x18cf82f70e0: i64 = Register %vreg3 [ID=1]
        0x18cf3424af0: i64 = Constant<8> [ID=2]
      0x18cf34244f0: i64 = undef [ID=3]
  0x18cf82f1880: f32 = ConstantFP<0.000000e+00> [ID=4]
  0x18cf82f1280: i8 = Constant<6> [ID=12]
In function: node_mix_0000018CBF9EAF70_10
Error: EXCEPTION_ACCESS_VIOLATION

Whether the script works or crashes seems to depend on what its output is connected to. I tested a few different cases, I can reproduce these results 100% of the time:

Crashes:
Output of the Script node connected to Fac of MixRGB node, when Color1 != Color2. (see: the attached .blend file in original post)
Output of the Script node connected to Fac of Mix Shader node.
Output of the Script node connected to Saturation of Hue/Saturation Node.

Works:
Output of the Script node connected to Fac of MixRGB node, when Color1 == Color2. (I guess the entire node is optimized away in this case?)
Output of the Script node connected to Strength of Emission node.
Output of the Script node connected to Hue of Hue/Saturation Node.

The full error message is: ``` LLVM ERROR: Cannot select: 0x18cf82f1080: f32 = X86ISD::FSETCCss 0x18cf82f79e0, 0x18cf82f1880, 0x18cf82f1280 [ORD=89] [ID=38] 0x18cf82f79e0: f32 = X86ISD::FMIN 0x18cf82f81f0, 0x18cf82f1780 [ORD=87] [ID=37] 0x18cf82f81f0: f32,ch = load 0x18cf348cc88, 0x18cf82f7ff0, 0x18cf34244f0<LD4[ConstantPool]> [ID=31] 0x18cf82f7ff0: i64 = X86ISD::Wrapper 0x18cf34245f0 [ID=19] 0x18cf34245f0: i64 = TargetConstantPool<float 1.000000e+00> 0 [ID=13] 0x18cf34244f0: i64 = undef [ID=3] 0x18cf82f1780: f32,ch = load 0x18cf348cc88, 0x18cf3422fd0, 0x18cf34244f0<LD4[%sunkaddr8]> [ORD=85] [ID=36] 0x18cf3422fd0: i64 = add 0x18cf34231d0, 0x18cf3424af0 [ORD=83] [ID=30] 0x18cf34231d0: i64,ch = CopyFromReg 0x18cf348cc88, 0x18cf82f70e0 [ORD=82] [ID=18] 0x18cf82f70e0: i64 = Register %vreg3 [ID=1] 0x18cf3424af0: i64 = Constant<8> [ID=2] 0x18cf34244f0: i64 = undef [ID=3] 0x18cf82f1880: f32 = ConstantFP<0.000000e+00> [ID=4] 0x18cf82f1280: i8 = Constant<6> [ID=12] In function: node_mix_0000018CBF9EAF70_10 Error: EXCEPTION_ACCESS_VIOLATION ``` Whether the script works or crashes seems to depend on what its output is connected to. I tested a few different cases, I can reproduce these results 100% of the time: Crashes: Output of the Script node connected to Fac of MixRGB node, when Color1 != Color2. (see: the attached .blend file in original post) Output of the Script node connected to Fac of Mix Shader node. Output of the Script node connected to Saturation of Hue/Saturation Node. Works: Output of the Script node connected to Fac of MixRGB node, when Color1 == Color2. (I guess the entire node is optimized away in this case?) Output of the Script node connected to Strength of Emission node. Output of the Script node connected to Hue of Hue/Saturation Node.
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Member

we have recently updated osl/llvm, is this still an issue? @ptim can you check with a nightly build?

we have recently updated osl/llvm, is this still an issue? @ptim can you check with a nightly build?
Author

Thank you, this issue seems to be resolved as of 76f640c27d.

Thank you, this issue seems to be resolved as of 76f640c27d8.
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Ray molenkamp self-assigned this 2018-10-10 17:20:00 +02:00
Member

Score! thanks for the quick test!

Score! thanks for the quick test!
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
4 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#54887
No description provided.