Skip to content

Report corpus compiler launch errors without aborting with a traceback #809

Description

@LunaStev

Problem

Passing the existence and executable-bit checks does not guarantee that a compiler can start. An executable with an invalid format raises uncaught OSError inside the corpus loop. Missing loaders or removal between validation and launch have the same failure path, losing the normal per-file failure summary.

Starting points: tools/check_wave_corpus.py.

Reproduction

Executed on Linux amd64 with Python 3.14.7. The affected files at local ade878134519b0f957ca28a23c6f9cd98e43dff3 are byte-identical to canonical master 286dad9c8fcb0616f7c719c72cbf453a7d9925fd.

python3 -B - <<'PYREPRO'
import tempfile
from pathlib import Path
from unittest.mock import patch
from tools import check_wave_corpus as c
with tempfile.TemporaryDirectory() as tmp:
    p = Path(tmp) / 'bad-wavec'
    p.write_text('not an executable format\n')
    p.chmod(0o700)
    with patch.object(c, 'corpus_files', return_value=[c.ROOT / 'examples/std/net_tcp.wave']):
        c.main(['--wavec', str(p)])
PYREPRO

Observed: uncaught OSError: [Errno 8] Exec format error. This is distinct from the pre-launch permission check fixed in #594.

Scope

Easy: handle process-launch OSError in both source checking and std-example execution using the existing failure reporting. Preserve nonzero exit and timeout diagnostics.

Completion criteria

  • Launch failures return a nonzero tool status without a Python traceback.
  • The failed file and launch reason appear in the summary.
  • Cover ENOEXEC and a missing executable/loader with isolated tests for both loops.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugA problem that causes incorrect behavior or crashes.good first issueIssues that are good for newcomers or first-time contributors.needs testingIssues that require additional testing or verification.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions