unexpected-edgedisplay talks to gps, which the contract does not allow
52 messages from display to gps on chid 1. Allowed servers for display: camera, logger, nav.
Evidence: trace events 53787
Show the 40 trace events behind this
| Event | Time | What happened |
|---|---|---|
| 53787 | 2283.222 ms | display[tid 1] MsgSend to gps (coid 0x3, chid 1) message '' (_IO_CONNECT, resource manager protocol) |
| 53797 | 2283.263 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 53818 | 2283.520 ms | gps[tid 1] MsgReply to display[tid 1] reply '' |
| 81266 | 4494.289 ms | display[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol) |
| 79582 | 4494.607 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 79592 | 4494.758 ms | gps[tid 1] MsgReply to display[tid 1] reply 'pos 50.529' |
| 79968 | 4548.035 ms | display[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol) |
| 79978 | 4548.097 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 79988 | 4548.197 ms | gps[tid 1] MsgReply to display[tid 1] reply 'pos 50.531' |
| 80284 | 4603.056 ms | display[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol) |
| 80294 | 4603.109 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 80308 | 4603.190 ms | gps[tid 1] MsgReply to display[tid 1] reply 'pos 50.533' |
| 80630 | 4656.762 ms | display[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol) |
| 80640 | 4656.807 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 80650 | 4656.868 ms | gps[tid 1] MsgReply to display[tid 1] reply 'pos 50.535' |
| 82065 | 4710.601 ms | display[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol) |
| 82075 | 4710.647 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 82085 | 4710.712 ms | gps[tid 1] MsgReply to display[tid 1] reply 'pos 50.537' |
| 82439 | 4765.531 ms | display[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol) |
| 82449 | 4765.633 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 82470 | 4766.041 ms | gps[tid 1] MsgReply to display[tid 1] reply 'pos 50.539' |
| 82768 | 4820.750 ms | display[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol) |
| 82778 | 4820.798 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 82788 | 4820.885 ms | gps[tid 1] MsgReply to display[tid 1] reply 'pos 50.541' |
| 83151 | 4877.086 ms | display[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol) |
| 83161 | 4877.155 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 83171 | 4877.243 ms | gps[tid 1] MsgReply to display[tid 1] reply 'pos 50.543' |
| 83518 | 4930.760 ms | display[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol) |
| 83528 | 4930.802 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 83538 | 4930.850 ms | gps[tid 1] MsgReply to display[tid 1] reply 'pos 50.545' |
| 87921 | 4985.980 ms | display[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol) |
| 87931 | 4986.086 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 87945 | 4986.218 ms | gps[tid 1] MsgReply to display[tid 1] reply 'pos 50.547' |
| 88357 | 5040.528 ms | display[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol) |
| 88367 | 5040.577 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 88377 | 5040.637 ms | gps[tid 1] MsgReply to display[tid 1] reply 'pos 50.549' |
| 88971 | 5125.091 ms | display[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x16\x01' (_IO_CLOSE, resource manager protocol) |
| 88981 | 5125.232 ms | gps[tid 1] MsgReceive got the message from display[tid 1] |
| 89002 | 5128.386 ms | gps[tid 1] MsgReply to display[tid 1] reply '' |
| 89461 | 5131.190 ms | process display (pid 823326) destroyed |
The 'backdoor' build makes display call gps_open() and read /dev/cockpit/gps directly every tick, bypassing nav. Under COCKPIT_GPS=resmgr that read() is an _IO_CONNECT, then _IO_READ MsgSends, then _IO_CLOSE to gps on chid 1. gps answers each one promptly, so nothing hangs. The violation is architectural: the contract only allows nav -> gps, and display already gets the position inside nav's route reply.
At fault: MsgSend in display (open()/read()/close() on /dev/cockpit/gps, i.e. _IO_CONNECT/_IO_READ/_IO_CLOSE to gps)
Fix: Remove the direct gps connection from display and take the position from nav's route reply, which already contains it. If display really needs raw positions, change the contract instead by adding 'display -> gps' to allow:. 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 arrives via nav: route.text = "route via pos ..." */
Cites events 53787, 53797, 53818, 81266, 79582, 79592, 79968, 88357, 88377, 88971, 89002 · Docs: MsgSend Synchronous message passing name_open