FAIL

cockpit architecture check

1 error, 0 warnings. Trace demo/cockpit/traces/backdoor.kev: QNX 8.0.0 on x86pc, 2 CPUs, 6.00 s, 42,894 events.

Architecture

display to camera: 50 messagesdisplay to gps: 50 messagesdisplay to logger: 50 messagesdisplay to nav: 50 messagesnav to gps: 50 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

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
EventTimeWhat happened
571382229.008 msdisplay[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10'
571482229.033 msgps[tid 1] MsgReceive got the message from display[tid 1]
571582229.070 msgps[tid 1] MsgReply to display[tid 1] reply '\x01\x10'
838894370.417 msdisplay[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10'
838994370.456 msgps[tid 1] MsgReceive got the message from display[tid 1]
839204370.644 msgps[tid 1] MsgReply to display[tid 1] reply '\x01\x10'
842404424.295 msdisplay[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10'
842504424.353 msgps[tid 1] MsgReceive got the message from display[tid 1]
842644424.453 msgps[tid 1] MsgReply to display[tid 1] reply '\x01\x10'
845904479.245 msdisplay[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10'
846004479.287 msgps[tid 1] MsgReceive got the message from display[tid 1]
846104479.337 msgps[tid 1] MsgReply to display[tid 1] reply '\x01\x10'
890394540.533 msdisplay[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10'
890494540.617 msgps[tid 1] MsgReceive got the message from display[tid 1]
890594540.735 msgps[tid 1] MsgReply to display[tid 1] reply '\x01\x10'
856394595.772 msdisplay[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10'
856494595.878 msgps[tid 1] MsgReceive got the message from display[tid 1]
856594595.971 msgps[tid 1] MsgReply to display[tid 1] reply '\x01\x10'
860144657.404 msdisplay[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10'
860244657.478 msgps[tid 1] MsgReceive got the message from display[tid 1]
860344657.555 msgps[tid 1] MsgReply to display[tid 1] reply '\x01\x10'
904134712.515 msdisplay[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10'
904234712.557 msgps[tid 1] MsgReceive got the message from display[tid 1]
904484712.888 msgps[tid 1] MsgReply to display[tid 1] reply '\x01\x10'
907884768.660 msdisplay[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10'
907984768.705 msgps[tid 1] MsgReceive got the message from display[tid 1]
908084768.755 msgps[tid 1] MsgReply to display[tid 1] reply '\x01\x10'
922564825.936 msdisplay[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10'
922664826.087 msgps[tid 1] MsgReceive got the message from display[tid 1]
922764826.152 msgps[tid 1] MsgReply to display[tid 1] reply '\x01\x10'
925854880.316 msdisplay[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10'
925954887.432 msgps[tid 1] MsgReceive got the message from display[tid 1]
926414890.100 msgps[tid 1] MsgReply to display[tid 1] reply '\x01\x10'
916094946.624 msdisplay[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10'
916194946.743 msgps[tid 1] MsgReceive got the message from display[tid 1]
916294946.823 msgps[tid 1] MsgReply to display[tid 1] reply '\x01\x10'
930465001.261 msdisplay[tid 1] MsgSend to gps (coid 0x40000004, chid 1) message '\x01\x10'
930565001.300 msgps[tid 1] MsgReceive got the message from display[tid 1]
930665001.336 msgps[tid 1] MsgReply to display[tid 1] reply '\x01\x10'
991325067.934 msprocess display (pid 933913) destroyed
Why, according to claude-opus-5-5 confidence high

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

Message traffic

ClientServerIn contractMessagesRepliedErrorsUnansweredMedian replyWorst replyBudget
displaycamerayes5050000.14 ms4.20 ms20 ms
displaygpsno5050000.11 ms9.78 ms20 ms
displayloggeryes5050000.09 ms0.38 ms20 ms
displaynavyes5050000.83 ms3.63 ms50 ms
navgpsyes5050000.17 ms1.07 ms20 ms
navloggeryes5050000.09 ms0.78 ms20 ms