I have writtemn a program that is totally bug free but when its run it locks.
You got any explanation why it doesnt work? can it be a bug in the uvision?
"can it be a bug in the uvision?"
There is a small chance of that - but far more likely that there is a bug in your code.
The reason that uVision provides a debugger is to help you to find your bug...