Repository navigation
Wire -memcheck into fun test, fix the real bugs it surfaced - #206
Merged
Merged
Conversation
…ta under -g has_pending_line_directive is cleared once flushed for the enclosing statement, before a hoisted temp needs its own, second #line.
-memcheck-leaks opts back in for a program meant to outlive its own process exit; double-free/UAF/overflow stay caught either way.
…rence Compiling one of its own dependencies directly under -memcheck reached that file a second time through the import this feature injects.
…ects int A plain %s is equivalent here anyway, both strings already NUL-terminated.
workflow_dispatch - the GitHub Actions equivalent of GitLab's manual job - since the guard-page allocator is too slow for every push/PR.
…nt64_t Matched by coincidence on macOS; Linux's int64_t is long, not long long.
… guard Pulled in the legacy winsock.h, conflicting with winsock2.h included elsewhere in the same generated file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-memcheck/-memcheck-leaksintofun test [<path>]. Leak reporting is off by default under-memcheck(opt in with-memcheck-leaks): a short-lived process - every CLI invocation this compiler makes, and every-testbinary - never has to free a transient allocation before it exits a moment later anyway, so treating that as a leak flags ordinary code, not a bug. Double-free/use-after-free/buffer-overflow stay caught unconditionally either way.-memcheck:#linedirective (under-g) could read an uninitializedPoswhen the enclosing statement's own directive had already been flushed, producing a real null-pointer crash. Caught because-memcheckimplies-gfor real file:line reports.std.memcheck's own dependencies directly under-memcheck(every stdlib file, in this project's own test corpus) reached that exact file a second time through theuse std.memcheckthe feature injects, double-merging its declarations.std.memcheckitself calling intostd.io/std.stringcreated a circular forward reference when the entry file was the one supplying those declarations - fixed by building its own reports withstd.c.io'ssnprintf/fprintfinstead, dropping the dependency entirely.flsdebug-log line passed a 64-bit length whereprintf's%.*sprecision expects a 32-bit int - undefined behavior, just never hit until this branch's own heavier compiler runs exercised it.-memcheckstep on the ubuntu lane, manual-trigger only (workflow_dispatch, the GitHub Actions equivalent of GitLab's manual job) - the guard-page allocator's own per-allocationmmap/mprotectcost is too slow to add to every push/PR, but it's there on demand.docs/tooling.md, and a "Ternary Conditional" section indocs/language.md(catching up docs for the ternary feature from the previous PR).Test plan
fun test .passes 56/56, run twice, after a fresh 3-stage bootstrap from the installed release-fmt-check-allclean,fun lint src/fun lint stdlibcleanscripts/run_examples.sh: 222 total, 0 failed, 21 expected-fail, 0 unexpected-pass (matches baseline)codegen_tests.fn's 125 tests, and the bulk of the suite verified passing under-memcheckdirectly (the full suite run is slow enough - guard pages are much slower than a realmalloc- that a single local run reliably completing end to end on this machine wasn't practical; the new manual-trigger CI step is the real full-suite gate going forward)#linedirective under-g,-memcheck/-memcheck-leaksflag parsing, leak-vs-double-free behavior under-test, and compiling astd.memcheckdependency directly under-memcheck