Crash with simple (malformed?) shader
Brought to you by:
ltatkinson,
pgregory
The following shader compiles properly, but crashes Aqsis when rendering the RIB file below:
surface test ( normal Nf = faceforward( N, I ) )
{
Ci = 1;
Oi = 1;
}
Format 256 256 1
FrameBegin 1
Display "outputimage" "framebuffer" "rgb"
Projection "perspective" "fov" 40
WorldBegin
Surface "test"
Color [ 1 1 1 ]
Translate 0 .1 3
Rotate 50 1 0 0
Torus .65 .3 0 360 360
WorldEnd
FrameEnd
Anonymous
Logged In: YES
user_id=1086736
Originator: NO
This crash was being caused by the fact that faceforward() needs the geometric normal, Ng, to operate internally, but that fact wasn't specified by the corresponding CqFuncDef. I fixed this small problem in svn revision 1896.
However, the shader is probably malformed, and won't do what the user expects anyway. I think we need to make this a compiler error somehow, possibly by restricting access to the standard variable symbol table in the instance variable declarations section?
Logged In: YES
user_id=1086736
Originator: NO
I'm downgrading the priority of this bug as the crash has now been fixed.
Logged In: YES
user_id=117924
Originator: NO
This has been further lowered, it no longer crashes, and PRman raises a runtime error with this shader, so it's invalid anyway. We'll need to catch it somehow either at compile or runtime, but that's for the future, after 1.4.