Debugging sessions
This page explains how to read session events, logs and verdicts, how to identify the first failing component from common startup failures, and how to safely recover resources left by an abnormal exit.
Session Events and Logs
runprintssession: <run-dir>when it starts, then printsstarted,ready,exitedandstoppedevent lines.Each process writes combined standard output and standard error to
output.login its work directory; gem5 also writes itsm5out/directory there.vHost serial output goes to
<machine>/vhost/serial.logand is also available through the serial socket.verdict.jsonrecords the final result; the same content is printed on the[COSIM_VERDICT]line.
# The run directory is printed on the session line; it defaults under .cosim/
ls .cosim/<name>
# Tail the process logs
tail -n 50 .cosim/<name>/m0/mi300x-0/output.log
tail -n 50 .cosim/<name>/m0/vhost/output.log
tail -n 50 .cosim/<name>/m0/vhost/serial.log
cat .cosim/<name>/verdict.json
Reading the Verdict
Field |
Meaning |
|---|---|
|
|
|
The first failure, or |
|
Failures while releasing session resources. |
|
Whether every owned process is known to have exited; when |
{
"status": "FAIL",
"reason": "host m0 exited with status 1",
"cleanup_errors": [],
"users_stopped": true
}
Common Startup Failures
Symptom |
First check |
Action |
|---|---|---|
Unknown field or unknown template while loading |
YAML field names, template names and |
Fix the document against |
An import is missing |
Whether the path is relative to the importing file or to |
Fix the relative path or pass the correct |
A program cannot be found |
|
Use a workspace-relative path or build the binary first. |
A device readiness probe times out |
The readiness marker and socket in the device |
Check that the binary runs, that |
The vHost readiness probe times out |
The |
Check the guest command line and the serial configuration. |
Pool capacity is exhausted |
Free space on the pool filesystem and concurrent sessions |
Free space or clean other sessions and retry. |
Remote placement is rejected |
|
|
|
Whether the launcher or a child is still alive and holds |
Stop the related processes, then run |
Cleanup and Leftover Resources
On a normal exit the launcher has removed sockets, overlays, pools and the pool directory, keeping only logs and metadata.
After the launcher was killed or exited abnormally, use
cosim clean <run-dir>to remove the resources listed inmanifest.json.cleanremoves pool contents only from a pool directory whose ownership marker names this session, so it does not touch other sessions.If
cleancannot run, first check whethersession.lockis still held by a process, then inspect the resource paths inmanifest.json.
Sources
Events and the verdict:
crates/cosim-runtime/src/session.rs.Readiness probes:
crates/cosim-runtime/src/probe.rs.Cleanup:
crates/cosim-runtime/src/manifest.rs.Session file names:
crates/cosim-runtime/src/layout.rs.