How do I report a bug in EK9 - an internal compiler error?
← Debugging and Troubleshooting · Ref: Q2287
When the compiler hits a fault in ITSELF (never in your source) it exits 14. The first stderr lines are the marker 'ek9: internal compiler error (exit 14)', the phase it was in, and a line telling you to run 'ek9 -reportbug'.
BARE: WRITE THE LAST CRASH
'ek9 -reportbug' alone reads the most recent of the crash records EK9 keeps in ~/.ek9/crash (the last 20; older ones are deleted) and writes a bug report, ek9-bug-report-<id>.ek9, into the CURRENT directory - so you see it and read it before pasting it anywhere. Everything in it is REDACTED on this machine first: your home folder, user name, host name, environment values and any path outside the project are replaced before you ever see the file. Your source is NEVER included unless you ask for it.
ADDING YOUR OWN PROGRAM
'ek9 -reportbug mycrash.ek9' adds a program you have already cut down yourself, after a pre-scan that refuses anything that is not pure computation (an extern module, a service, an application, an injected component, or most gated I/O types) - a public issue form is not the place for those. The report records whether your program still reproduces the crash; even when it does not, the report is still written, because a program that no longer crashes may still show the WRONG behaviour you meant to report in the first place.
MINIMISING WITH --check
'ek9 -reportbug --check candidate.ek9' is the tool for cutting a crashing program down to the smallest one that still crashes, by hand or with your own AI assistant: it compiles the candidate in a disposable child process and answers on its FIRST stdout line - 'reproduces: yes (crash <fp8>, same top frame)', 'reproduces: no - compiled cleanly', 'reproduces: no - compilation failed: <reason>', or 'reproduces: no - a different crash (...)'. A 'no' exits 20 (not 0, not 8), so a script or an agent can loop: cut something out, run --check, keep the cut only when it still says yes. Given the report file itself, --check also writes its answer into the report's "reproduces" line, so the file you paste says what was last checked.
FILING IT
The command then names the matching issue form (compiler, IDE or MCP) at https://github.com/ek9lang/ek9-issues and opens it in your browser at an interactive terminal; over SSH, or with output piped, it only prints the URL. Paste the whole report file - it is already redacted. A problem that is not a crash (a wrong or missing error, wrong output, a confusing message or page) goes to the same forms without a report file. A possible security problem goes to the private form the command names instead, never a public issue.
See Q246 for the wider EK9 debugging workflow. See Q247 for reading error messages.
Example
#!ek9 defines module qa.debugging.reportbug defines program ReportBugDemo() stdout <- Stdout() stdout.println("ek9 -reportbug writes a redacted bug report and names the matching issue form")
Other ways to ask this
- The compiler crashed with exit 14, what do I do?
- What is ek9 -reportbug?
- How do I make a minimal reproduction of a compiler crash?
- What does ek9 -reportbug --check do?
- Where do I file an EK9 bug?
Coming from another language?
Java: a stack trace on stderr, no structured report, no redaction - you paste it (and whatever it names) into the bug tracker yourself. Rust: 'error: internal compiler error' names a backtrace and the issue tracker, but builds no report file. Go: 'panic: runtime error' from 'go build' with no reporting tool at all. EK9: 'ek9 -reportbug' writes a redacted, fingerprinted report file for you and gives you '--check' to minimise it before you file it.
Keywords: bug report, check, crash, crash record, exit 14, internal compiler error, issue form, minimal reproduction, redacted, reportbug, reproduce