<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/134853>134853</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[compiler-rt] hwasan_symbolize Windows bug
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
automatedbugreportingfacility
</td>
</tr>
</table>
<pre>
https://github.com/llvm/llvm-project/blob/008c875be85732f72c4df4671167f5be79f449eb/compiler-rt/lib/hwasan/scripts/hwasan_symbolize#L423
On Windows, `os.getcwd()` can return something like "C:\sdk\llvm\...". The string with unescaped backslashes is then fed into `re.sub()`:
https://github.com/llvm/llvm-project/blob/008c875be85732f72c4df4671167f5be79f449eb/compiler-rt/lib/hwasan/scripts/hwasan_symbolize#L176
which results in an error:
`re.error: bad escape \l at position 31`
My workaround:
```
paths_to_cut.append(os.getcwd().replace("\\", "/") + '/')
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzMU8mOnDwQfhpzKQ2CwjRw4NDToz79v3KJlOPISwFOu21km2l1nj4ys2Q0t9wiWViUt2-pT8RoZkc0svaRtU-F2NLiwyi25K8ikZbbHGj1IRk3T0IZa9K9kF7fxyWlNbLmyPDM8DybtGyyVP7K8Gzty_v0sAb_k1RieJbWS4bnqupV37WS-rZrcOpQcT3xQ1fXh25qJXXDxPlAeavy19VYCg8hn7cm15abiMIxPEcVzJriR-k53q_SW_OLGDb_cWxYdWTV8ZuDH8Zpf4sMT8AOlY_lTEndNMOe4cAOFSjhIFDagoPor5QW42aw5kLAEE-ZY3uK-sLa086sPZVlyRBL-L4QxBTy9ptJC2yOohIraZBCXaIVcaEIJkJayMFEGoxLPqMIVMZNfkDIb-xw_21V6-7wCvO2GLVAoLjZFME4EA4oBB8-iLxyfK-BFBpetYEsI4gEq48mGe-gqbMC-6n_73Dz4SKC35z-fNfbqI4AAKtIS3xO_lltqRTrSi6b-cXYMtBqhaL9D1l7ygNx74I8nffvAAwfgWG3F7rsxqf3Cj02emgGUdBYd5zXdc9bXizjUA99pWR9mETf4qBk10yNHjjVQ0WdngozYoVtxau-brBqecl73SheoxpUJwbsGK_oKowts5-lD3NhYtxorBvet01hhSQb91QiOrrBvroTeSrCuDeB3ObIeGVNTPHPNckku8f5s8_tE3z18z0WILe52IL9-0DvkHKrvGF-GfF3AAAA___Zf1bS">