Do one thing:

Use dbms_output.put_line() or or some other fuctions suitable for SQL server to display the values of x each time to determine if it is infinite or dead process.

Take care