unexpected-edgedisplay talks to gps, which the contract does not allow
50 messages from display to gps on chid 1. Allowed servers for display: camera, logger, nav.
Evidence: trace events 57138
Show the 40 trace events behind this
| Event | Time | What happened |
|---|---|---|
| 57138 | 2229.008 ms | display[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10' |
| 57148 | 2229.033 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 57158 | 2229.070 ms | gps[tid 1] MsgReply to display[tid 1] reply '\x01\x10' |
| 83889 | 4370.417 ms | display[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10' |
| 83899 | 4370.456 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 83920 | 4370.644 ms | gps[tid 1] MsgReply to display[tid 1] reply '\x01\x10' |
| 84240 | 4424.295 ms | display[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10' |
| 84250 | 4424.353 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 84264 | 4424.453 ms | gps[tid 1] MsgReply to display[tid 1] reply '\x01\x10' |
| 84590 | 4479.245 ms | display[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10' |
| 84600 | 4479.287 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 84610 | 4479.337 ms | gps[tid 1] MsgReply to display[tid 1] reply '\x01\x10' |
| 89039 | 4540.533 ms | display[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10' |
| 89049 | 4540.617 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 89059 | 4540.735 ms | gps[tid 1] MsgReply to display[tid 1] reply '\x01\x10' |
| 85639 | 4595.772 ms | display[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10' |
| 85649 | 4595.878 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 85659 | 4595.971 ms | gps[tid 1] MsgReply to display[tid 1] reply '\x01\x10' |
| 86014 | 4657.404 ms | display[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10' |
| 86024 | 4657.478 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 86034 | 4657.555 ms | gps[tid 1] MsgReply to display[tid 1] reply '\x01\x10' |
| 90413 | 4712.515 ms | display[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10' |
| 90423 | 4712.557 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 90448 | 4712.888 ms | gps[tid 1] MsgReply to display[tid 1] reply '\x01\x10' |
| 90788 | 4768.660 ms | display[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10' |
| 90798 | 4768.705 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 90808 | 4768.755 ms | gps[tid 1] MsgReply to display[tid 1] reply '\x01\x10' |
| 92256 | 4825.936 ms | display[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10' |
| 92266 | 4826.087 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 92276 | 4826.152 ms | gps[tid 1] MsgReply to display[tid 1] reply '\x01\x10' |
| 92585 | 4880.316 ms | display[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10' |
| 92595 | 4887.432 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 92641 | 4890.100 ms | gps[tid 1] MsgReply to display[tid 1] reply '\x01\x10' |
| 91609 | 4946.624 ms | display[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10' |
| 91619 | 4946.743 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 91629 | 4946.823 ms | gps[tid 1] MsgReply to display[tid 1] reply '\x01\x10' |
| 93046 | 5001.261 ms | display[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10' |
| 93056 | 5001.300 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 93066 | 5001.336 ms | gps[tid 1] MsgReply to display[tid 1] reply '\x01\x10' |
| 99132 | 5067.934 ms | process display (pid 933913) destroyed |
The display was built with COCKPIT_FAULT=backdoor, so run_display() opens a connection to cockpit-gps through gps_open() and, every tick, calls gps_position(), which does MsgSend(MSG_POSITION) straight to gps on chid 1. This bypasses nav, the only process the contract allows to talk to gps. The calls themselves succeed (gps receives and replies within about 0.1 ms each); the violation is the forbidden display -> gps edge, not a hang.
At fault: MsgSend in display (gps_position -> ask on the gps coid opened by gps_open/name_open("cockpit-gps"))
Fix: Remove the direct gps connection from display. Display already gets the position embedded in nav's route reply ("route via pos ..."), so it should use that. If display really needs raw positions, add a nav message that returns them, or add 'display -> gps' to blueprint.yaml as a deliberate contract change. Do not leave the backdoor in the code.
Proposed patch
--- a/cockpit.c
+++ b/cockpit.c
@@ static int run_display(int ticks) {
int nav = connect_to("cockpit-nav");
int camera = connect_to("cockpit-camera");
int logger = connect_to("cockpit-logger");
- int gps = has_fault("backdoor") ? gps_open() : -1;
@@
for (int seq = 0; seq < ticks; seq++) {
- cockpit_msg_t route, frame, pos;
+ cockpit_msg_t route, frame;
ask(nav, MSG_ROUTE, seq, "route?", &route);
- if (gps != -1) {
- gps_position(gps, seq, "where? (direct)", &pos);
- }
+ /* position comes from nav's route reply; display never talks to gps */
Cites events 57138, 57148, 57158, 83889, 84240, 93046, 93056, 93066 · Docs: MsgSend name_open Synchronous message passing