llvm / llvm/llvm-project

[MIRSampleProfile] nullptr deref crash when profile sample use file not found

Open
#189,764 8 comments 0 reactions 0 assignees View on GitHub
crash-on-invalid good first issue llvm:codegen PGO
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Trying to reproduce https://github.com/llvm/llvm-project/issues/188897, I failed to pass a valid file for `-fprofile-sample-use=`; this caused a crash because `Reader` is `nullptr` in `MIRProfileLoader::runOnFunction`. Should be easy to guard against this I think. cc @htyu (author of 958a3d8e2dec95a878dfc9d823861b3a6c674534)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.