qdtk / openshadinglanguage

Automatically exported from code.google.com/p/openshadinglanguage
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

crash when reading in an invalid oso file #33

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Solomon and I ran into a puzzling crash yesterday which turned out to be due to 
an invalid oso 
file. The contents of the file were:

OpenShadingLanguage 0.0
# Compiled by oslc FIXME-VERSION
shader utl_spi_color_v1
param   color   Color_Value 1 1 1        %read{0,0} %write{2147483647,-1}
oparam  color   Out_Color   0 0 0        %read{2147483647,-1} %write{0,0}
code Out_Color
    assign      Out_Color Color_Value   %filename{"nodes/utl/color/utl_spi_color_v1.osl"} 
%line{27} %argrw{"wr"}
    end
(note the missing __main__)

The interpreter happily tried to execute off the end of the shader and 
segfaulted the renderer. It 
seems we could be a little more graceful with error handling.

I have no idea what sequence of events lead to this corrupt file, this was from 
Derek's dump of 
the <edit> scene.

Original issue reported on code.google.com by rene.lim...@gmail.com on 11 Jan 2010 at 7:07

GoogleCodeExporter commented 9 years ago
12/15/09 13:23:21 changed by lg 

Generally speaking, the osl-reading code is littered with assertions that all 
need to be replaced with sane error 
handling (which may be to reject the shader upon first error, but which should 
not include crashing or aborting).

Original comment by rene.lim...@gmail.com on 11 Jan 2010 at 7:08

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by rene.lim...@gmail.com on 13 Jan 2010 at 1:03