On a rare occasion of the TeamCity server or agent process terminating unexpectedly with no apparent reason, it can happen that this is caused by a Java runtime crash.
If this happens, the Oracle JVM regularly creates a file named
hs_err_pid*.log in the working directory of the process. The working directory is usually
<TeamCity server or agent home>/bin Under WIndows when running as a service it can be other like
C:\Windows\SysWOW64. You can also search the disk for the recent files with "hs_err_pid" in the name.
See also Oracle documentation, related the Fatal Error Log section in the document.