<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/135966>135966</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[HWASan] hwasan_symbolize Fails to Distinguish Between Stripped and Unstripped ELFs with Identical Build IDs
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
StefanBossbaly
</td>
</tr>
</table>
<pre>
### Description
When running the `hwasan_symbolize` script with the `--index` flag, the script does not properly differentiate between stripped and unstripped ELF files that share the same build ID. If the script encounters and indexes a stripped ELF first, it will ignore the unstripped ELF (which contains debugging symbols) when that file appears later in the directory traversal. As a result, crash stacks are only partially symbolicated.
### Repro Steps
1. Run `hwasan_symbolize` with the `--index` flag on a directory containing both stripped and unstripped ELF files.
2. Observe that the script will sometime select the stripped ELF for symbolication, ignoring the unstripped ELF.
### Expected Behavior
`hwasan_symbolize` should use the unstripped ELF for symbolication even if a stripped ELF with the same build ID appears first in the directory traversal. Stripped ELFs should be ignored as they do not contain any information useful to the symbolizer.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyEVF-PozYQ_zTOy2gRmEA2DzwkzUVdqVKli6p7rAY8gFvHRh6THP30lYHdZvd6dxJSFA38_PvnQWbdWaJKFEdRnDY4ht756hKoRXt0zDWaaVM7NVVC5ssDJ-LG6yFoZ0V6-NKTBT9aq20HoScQZdrfkdH-ydO1dkb_Q6JMYfkG7jr0r689PWmr6GuctgY7IX-ZJ-ubyhGDdQEG7wbyZgKl25Y82aAxENQU7kQWOHg9DKQArYLRvv399NsZWm2IIfQYgHv0tODjlaAetVHwckrgpX08lWzjRhvI84w3EyQGhA-4nkPkq6MiY0B31q3wHygI-XzvddND42xAbRkU1WPXRbsWg1jIPdyjjTPRyBlwGAg9g8FAHrSdkZX21ATnJwgeb-QZTQKHSM4Tj2Ym1HjkHjhg8zdDVOysmWBAHzQaM61H6gYDqUSkh_i8JfuZBu_gEmhgkR6yBD6P9nt5_iBIcBbwge2qPCquXeh_nlgkJhP4vWbyN1psechodpzdlYK-EjAZatb5OyTnH9TGssa8Yk6vTX1_9DdufPo6UBNIwZF6vGnn4_Q75e7daBSM_L8V-IYJ0I0s6PZjrd48fVfRtzLMrfthGS4PaPzKqqa1ngowXgaaQLn5Zq3BANoJtG2dvy70RqZ2NBDcQuZVqU9g8Wijqlzt8z1uqMp22-1zJvN9semr4lnuVEtZrrIGs6LGdp-W2XPeNkW53T3vNrqSqSzSbVZm27TMi6SUe9y1Jcp8V5RZuxPblK6oTWLM7Zo4320080hVlhf7stwYrMnwvK6ktHSHeSqkjNvLV_Gjp3rsWGxToznwfzBBBzPvuV-_HC5oRXGCj0nCGbXhKPukOWjbjZp7OK575vLY2j_eJcxLci8q7qYGDRzX6HgzelP1IQws8oOQZyHPnQ79WCeNuwp5jvTWn6fBu7-oCUKeZ1Es5HlVfavkvwEAAP__t1D1JA">