Closed antonbaliasnikov closed 3 months ago
@antonbaliasnikov there are test failures that need to be addressed
Edit: May be unrelated
@antonbaliasnikov there are test failures that need to be addressed
Edit: May be unrelated
Hey @TheDan64 ,
I checked tests locally for a failed configuration of LLVM 4.0 on Ubuntu 20.04. All tests passed:
cargo test --release --features llvm4-0 --verbose
...
test result: ok. 296 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 11.67s
I'm attaching the full log for the reference.
This CI error (invalid memory reference
) is odd (hardware related?) and looks not feasible to debug from my side, especially without repository access (I can't even restart workflows to check if it's sporadic or not).
Could you, please, check it with a test PR from the master
? Let me know if I can help somehow.
Not sure why, but master started failing, even though it passed before. Perhaps GH changed hardware or something under us which revealed existing UB
Description
Fix a memory leak in the
verify
function that calls theLLVMVerifyModule
function of LLVM.If we build
inkwell
with Address sanitizer enabled:RUSTFLAGS="-Z sanitizer=address" cargo +nightly build --target aarch64-unknown-linux-gnu -Zbuild-std
And try to use the the
inkwell::module::Module::verify
function, then sanitizer will report the following memory leak (if the function succeeds):This is caused by not freeing the memory allocated in the
strdup()
call in theLLVMVerifyModule
LLVM function .This fix calls
LLVMDisposeMessage
to explicitly callfree()
for theerr_str
pointer fixing the memory leak.Related Issue
N/A
How This Has Been Tested
Manually by building with sanitizers including this fix and calling
verify
function.Option\<Breaking Changes>
N/A
Checklist