I plugged the example code you gave into TyphoonLabs ShaderDesigner (
Link), and discovered that this occurs for me, too (HW : GeForceFX 5700). Including the "lpos=gl_LightSource[0].position;" line creates the effect you described, commenting it out made the colour a solid red.
For the sake of interest, I started messing around with the code, trying to understand why the problem occurs. I discovered that if I declared the lpos variable outside the main loop, the problem disappears...
varying vec4 col;varying vec4 lpos;void main(){lpos=gl_LightSource[0].position;gl_Position=ftransform();col=vec4(1,0,0,1);}
Even if this variable is not declared in the fragment shader, simply declaring it in the vertex shader makes the problem go away. Most odd..
If you're after a reason WHY this happens, I can't help you at all... but if you just need something to work, this information may help you.
I'd be interested to know the reason, myself...
Good luck!
Hew T.