Skip to content

Harden compiler-error display against disposed LLVM modules#854

Merged
maleadt merged 1 commit into
mainfrom
tb/error_retain
Jun 19, 2026
Merged

Harden compiler-error display against disposed LLVM modules#854
maleadt merged 1 commit into
mainfrom
tb/error_retain

Conversation

@maleadt

@maleadt maleadt commented Jun 19, 2026

Copy link
Copy Markdown
Member

InvalidIRError retained a live LLVM.Instruction (from check_ir_values), so showing a caught error after its module was disposed segfaulted in Value::getName (e.g. Test rendering a failed test's exception). Snapshot the instruction to a string at construction, and route show through showerror for InvalidIRError/KernelError so display never field-dumps internal IR refs.

InvalidIRError retained a live LLVM.Instruction (from check_ir_values), so
showing a caught error after its module was disposed segfaulted in
Value::getName (e.g. Test rendering a failed test's exception). Snapshot the
instruction to a string at construction, and route `show` through `showerror`
for InvalidIRError/KernelError so display never field-dumps internal IR refs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.45%. Comparing base (e107287) to head (798642c).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/error.jl 0.00% 1 Missing ⚠️
src/validation.jl 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #854      +/-   ##
==========================================
- Coverage   79.49%   79.45%   -0.04%     
==========================================
  Files          25       25              
  Lines        4769     4771       +2     
==========================================
  Hits         3791     3791              
- Misses        978      980       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt maleadt merged commit 12bbcbc into main Jun 19, 2026
37 checks passed
@maleadt maleadt deleted the tb/error_retain branch June 19, 2026 19:55
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.

1 participant