Skip to content

benchmark.py: refuse a worker interface with a NULL work or work_response (#41) - #97

Merged
linuxnow merged 3 commits into
mainfrom
fix/41-worker-null-check
Oct 18, 2026
Merged

linuxnow merged 3 commits into
mainfrom
fix/41-worker-null-check

Conversation

@linuxnow

Copy link
Copy Markdown
Contributor

Fixes #41.

The Python worker adapter called the plugin's work_response (and work) through ctypes with no NULL check; a NULL function pointer kills the process. worker_interface now raises WorkerInterfaceError (message starting with hosting.worker.nonconforming, naming the field) before anything is called, and the worker loop reports it as that plugin's error like any probe failure, so the batch goes on. end_run is optional in the LV2 worker spec and stays so.

Tests (TestWorkerInterfaceNonconforming): a real ctypes interface table with one field NULL, run in a child process so a crash fails the test instead of the run. Before the change both NULL cases came back as a normal interface; with the check they are refused; a complete table and one without end_run still work. All of tools passes (177).

Question: the code is a string in benchmark.py only. The TypeScript HOSTING_CODE table has no worker code, and the Python error text is not mapped to a verdict reason there (a failed probe reads as unmeasured). Whether to mint hosting.worker.nonconforming in src/hosting-codes.ts and map it needs a ruling.

…onse (#41)

The adapter called both through ctypes without a check, and a NULL function pointer kills the
process. worker_interface now raises WorkerInterfaceError, whose message starts with
hosting.worker.nonconforming, before anything is called; the worker loop reports it as the plugin's
error like any probe failure. end_run stays optional. Tests build real interface tables with a NULL
field in a child process.
…the probe's refusal (#41)

The Python refusal is now a code on the TypeScript side too. HOSTING_CODE.workerNonconforming;
the measurement vocabulary's worker-nonconforming term, chosen by probeReasonCode for any prober text
carrying the code (so it is never the generic probe-error); and hostingLatencyReasons rates a latency
refused that way unsuitable under that code instead of unknown/latency unmeasured. Tests by code in
hosting-suitability and probe-json, and one holding benchmark.py's constant equal to the TS code.
@linuxnow
linuxnow merged commit 67e793e into main Oct 18, 2026
4 checks passed
@linuxnow
linuxnow deleted the fix/41-worker-null-check branch October 18, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

benchmark.py worker adapter calls work_response without a NULL check

1 participant