This question already has an answer here:
A few years ago I read a book and I am trying to find it again any help would be appreciated.
As I remember it was an older book where the protagonist gains consciousness on a space ship thats gained sentience (this may be where I'm wrong as I cannot remember if its sentient or just gone rogue), the crew has been cloned over many generations and have been perverted into almost monsters. The protagonist tries to fix the problem.
The book ends with the actual crew waking up and exiting the space craft which isn't in deep space but in a sea and they find evidence of what had happened.