FAIL

cockpit architecture check

1 error, 0 warnings. Trace demo/cockpit/traces/resmgr-backdoor.kev: QNX 8.0.0 on x86pc, 2 CPUs, 6.01 s, 38,677 events.

Architecture

display to camera: 50 messagesdisplay to gps: 52 messagesdisplay to logger: 50 messagesdisplay to nav: 50 messagesnav to gps: 51 messagesnav to logger: 50 messagesgpsnavcameraloggerdisplay
  • allowed, used
  • allowed, not seen
  • not in contract
  • deadlock loop
  • path in a finding

Findings

errorunexpected-edge

display 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
EventTimeWhat happened
537872283.222 msdisplay[tid 1] MsgSend to gps (coid 0x3, chid 1) message '' (_IO_CONNECT, resource manager protocol)
537972283.263 msgps[tid 1] MsgReceive got the message from display[tid 1]
538182283.520 msgps[tid 1] MsgReply to display[tid 1] reply ''
812664494.289 msdisplay[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol)
795824494.607 msgps[tid 1] MsgReceive got the message from display[tid 1]
795924494.758 msgps[tid 1] MsgReply to display[tid 1] reply 'pos 50.529'
799684548.035 msdisplay[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol)
799784548.097 msgps[tid 1] MsgReceive got the message from display[tid 1]
799884548.197 msgps[tid 1] MsgReply to display[tid 1] reply 'pos 50.531'
802844603.056 msdisplay[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol)
802944603.109 msgps[tid 1] MsgReceive got the message from display[tid 1]
803084603.190 msgps[tid 1] MsgReply to display[tid 1] reply 'pos 50.533'
806304656.762 msdisplay[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol)
806404656.807 msgps[tid 1] MsgReceive got the message from display[tid 1]
806504656.868 msgps[tid 1] MsgReply to display[tid 1] reply 'pos 50.535'
820654710.601 msdisplay[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol)
820754710.647 msgps[tid 1] MsgReceive got the message from display[tid 1]
820854710.712 msgps[tid 1] MsgReply to display[tid 1] reply 'pos 50.537'
824394765.531 msdisplay[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol)
824494765.633 msgps[tid 1] MsgReceive got the message from display[tid 1]
824704766.041 msgps[tid 1] MsgReply to display[tid 1] reply 'pos 50.539'
827684820.750 msdisplay[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol)
827784820.798 msgps[tid 1] MsgReceive got the message from display[tid 1]
827884820.885 msgps[tid 1] MsgReply to display[tid 1] reply 'pos 50.541'
831514877.086 msdisplay[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol)
831614877.155 msgps[tid 1] MsgReceive got the message from display[tid 1]
831714877.243 msgps[tid 1] MsgReply to display[tid 1] reply 'pos 50.543'
835184930.760 msdisplay[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol)
835284930.802 msgps[tid 1] MsgReceive got the message from display[tid 1]
835384930.850 msgps[tid 1] MsgReply to display[tid 1] reply 'pos 50.545'
879214985.980 msdisplay[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol)
879314986.086 msgps[tid 1] MsgReceive got the message from display[tid 1]
879454986.218 msgps[tid 1] MsgReply to display[tid 1] reply 'pos 50.547'
883575040.528 msdisplay[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x01\x01' (_IO_READ, resource manager protocol)
883675040.577 msgps[tid 1] MsgReceive got the message from display[tid 1]
883775040.637 msgps[tid 1] MsgReply to display[tid 1] reply 'pos 50.549'
889715125.091 msdisplay[tid 1] MsgSend to gps (coid 0x3, chid 1) message '\x16\x01' (_IO_CLOSE, resource manager protocol)
889815125.232 msgps[tid 1] MsgReceive got the message from display[tid 1]
890025128.386 msgps[tid 1] MsgReply to display[tid 1] reply ''
894615131.190 msprocess display (pid 823326) destroyed
Why, according to claude-opus-5-5 confidence high

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

Message traffic

ClientServerIn contractMessagesRepliedErrorsUnansweredMedian replyWorst replyBudget
displaycamerayes5050000.16 ms2.92 ms20 ms
displaygpsno5252000.15 ms3.75 ms20 ms
displayloggeryes5050000.09 ms1.29 ms20 ms
displaynavyes5050000.94 ms3.11 ms50 ms
navgpsyes5151000.23 ms1.47 ms20 ms
navloggeryes5050000.09 ms1.86 ms20 ms