[PATCH] D143369: [llvm-profdata] Fix bug llvm-profdata crashes when reading a text sample profile with an empty line with spaces.

William Junda Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 14:10:48 PDT 2023


huangjd added a comment.

In D143369#4295219 <https://reviews.llvm.org/D143369#4295219>, @ro wrote:

> I've taken the smallest failing testcase (`LLVM :: tools/llvm-profdata/sample-remap.test`) and reduced it further to
>
>   $ cat in
>   main:184019:0
>    4: 534
>    4.2: 534
>   $ llvm-profdata merge -sample -text in -o out
>
> Without your patch, the output is identical to the input, with it, I get
>
>   main:184019:0
>    4: 1068
>
> instead.  I'm completely unfamiliar with both the input format and the code, so I've not yet tried looking deeper.

What system are you running this on? I ran it on x86-64 linux and couldn't replicate it. It doesn't look like the line with `4.2` is skipped due to this patch, but instead it's parsed but being merged with the line with `4`, which indicates a bug somewhere else.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143369/new/

https://reviews.llvm.org/D143369



More information about the llvm-commits mailing list