HIL: Ctrl-C terminates the board worker before its lock task logs the failure
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python, raspberry-pi
- Domain
- embedded-iot, testing
Research direction
Start with test/hil/hil_test.py and trace main(), drain_pool, pool shutdown, and _abort_report to see how KeyboardInterrupt is handled. Check the board task's lock and failure logging path, then reproduce the Ctrl-C case on hardware. Done means the run writes an abort report, logs a failed event with its receipts, and leaves no stale lock record.
Written by the indexing model from the issue text.
Description
A Ctrl-C on test/hil/hil_test.py leaves the board's lock record stale instead of ending its task as failed. The
run also writes no report.
Evidence
- ci.lan, raspberry_pi_pico, #4499's branch with agentrc 48d46bbf. SIGINT went to the run's process group after 4
tests:- The run exited 130 with no report.
- The lock record stayed
stale(cleanupOwed: true, the board worker's pid), and no failed event was logged. - All 14 idle pool workers printed KeyboardInterrupt tracebacks. The board worker printed nothing.
- The next run on the board reported it as
previous-cleanup-failure(found-left). Its park loggedrestoredfor
it, so recovery works; only the interrupted run's own record of the failure is lost.
Cause
This is read from the source and is not yet confirmed by a trace:
- Main's
KeyboardInterruptindrain_poolis not caught byexcept Exceptioninmain(). - Leaving
with pool:therefore callsPool.terminate(), which sends SIGTERM to every worker. - The board worker has no SIGTERM handler, so it dies before its
board_taskcan end the task and log the failure. _abort_reportis skipped for the same reason, which is why there is no report.
Remaining work
- On
KeyboardInterruptinmain(), let in-flight workers end their board task (bounded join, orclose()+
join(timeout)) beforeterminate(). Write the abort report as the other abort paths do. - Confirm on hardware that a Ctrl-C then logs a failed event with the run's receipts and leaves no stale record.
Deferred: the pool shutdown predates #4499 and the recovery path covers it.
- Dominant language
- C
- Stars
- 7.3k
- Forks
- 1.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 67
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hathach/tinyusb
-
follow-up Port WCH USBFS Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
follow-up Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
hil-contract: a background hil_remote.py launch is killed at the Bash default 10 min timeoutPossibly taken @hathach claimed this 16 days ago. Openfollow-up Prio 📌
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
ch32v30x: debug UART loses queued bytes when its TX ring fillsPossibly taken @hathach claimed this 16 days ago. Openfollow-up Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
followup Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
-
Missing slice offset check in jvp_equal fast path corrupts slice comparison and aborts delpathsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
area9innovation/flow9#1805 ·
Maintainers usually reply within 3 days
-
AI:Robustness triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
open5gs/open5gs#5246 · 1 comment ·
Maintainers usually reply within 1 day