Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Then the process Z may have exited because it could no longer communicate with the process K you killed. But the parent of Z did not expect to collect an exit status this early with wait() and thus Z became a zombie.
wait()
and thus Z became a zombie.