First I think it was a hardware problem with the accelerometer, because my iphone 3g reacts as if where turning in landscape mode when in portrait. And all apps that acept landscape mode simply rotate in that state.
But yesterday I update cydia and the problem was fixed. When I wake up this morning the problem is back again.
I can lock the rotation but is not the solution I want.