<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57838>57838</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            ERROR: AddressSanitizer failed to allocate 0x0 (0) bytes of ReadFileToBuffer (error code: 22)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          adonis0147
      </td>
    </tr>
</table>

<pre>
    Hi team,

Recently, I use clang++-14 with asan to compile our project, but I met the following errors when I start the program up.

```shell
==417382==ERROR: AddressSanitizer failed to allocate 0x0 (0) bytes of ReadFileToBuffer (error code: 22)
ERROR: Failed to mmap
```

Environment:

1. Macbook Pro 2020 (M1 chip)
2. QEMU 7.1.0
3. Ubuntu 22.04.1 LTS
4. LLVM
    1. sudo apt install clang-14 lld-14
    2. export PATH="/lib/llvm-14/bin:${PATH}"
5. QEMU 
    ```shell
    qemu-system-aarch64 
        -machine virt,accel=hvf \
        -cpu host \
        -smp 4 \
        -m 8G \
        -nic vde,model=virtio,sock=/var/run/vde.ctl \
        -drive if=virtio,cache=none,format=raw,file=./ubuntu.img \
        -drive if=virtio,cache=none,format=raw,file=./data.img \
        -nographic \
        -bios QEMU_EFI.fd
    ```

I compiled the project in guest OS in QEMU but failed to start the program up.

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9VElv4zYU_jXS5SGEdskHHZI47gRIMFMnM9eCIimJHYpUScqe9Nf3Uc5iTN2eigoERfJt31s7w1_aTxK8oFOU3UbJNkquT_teMKG9esFnuIfFCWCK6iHKbnBdpQUcpR-BOqrBG2BmmqUSYBYLszW_C-aDYLd4FJ6EBz8K6I1S5ij1AMJaYx0cR6GR7jy1Jw4UHSydYJnJOZaoSk7LjUKp17d8i6tI67zJTue7_f7zPsqv4ZpzK5x7olp6-aew0FPExgNOiggY9QKSHwlEWZNE2Qa6Fy8cmB72gvIdsj6bm6XvURA5VqjoHxdBdZahwAnAu7ndu_ZpovNPiM_duNMHaY2eMK4od05JCTxS1hnzHb5YA1mSregeU2CjnN9NZgR-vXv8CjVJyavmnMDXbtF-QWgkKUgKD89PJ1JB4OHh2-PpAvihFbdwDMLsQWqMulKnpIZ0KsXx98GMtsSP2WBivlw_fwoRDr7vlOzCrg5T4M52ndTBl6yI6puVsV4ZVzXlK9wPpZcSGd7_ENNy5V6cF9MVpZaNVXEmFb6riWIotAAMYSgtyphQiGo89BCVtz8xs3mB0Th_geSmGYoL7xM0v1x41pLBAXOf3U5YAsFiACANPjjDvq9x2R2oxd0uOpy5IMyrC6q4lQcBsj_XwdArLKytNjrY6I2dKBbH1tJjuGJh4YWg2mVNMpHT8F9r5tTTf9CrQzfOI4bg77ROGrem97e73T3p-YUkn1f4_duI4G-NHmYEliEMi8BEfX4K57VcwtD46Nh_GQ6xaNOqyquqqvMy5m3ON_mGxl56Jdr_bRrEi1Xt6P3s1kbY4RpwNC4dQY9fe-WtZd5H4046h37joaybvInHNq9oV7BO9EnKadF3ZdcVvK77lG9Y0xd9rGgnlGujEgdwpsURVhWh2cptLFucGVmyyZJkkzdlSRqalryqG9ZhdBqeRUUiJnScBBzE2CG27QqpWwaHRCWddx9E6pwctBCrOdRPFz8a21JutHRJWtTxar1d0f8Fgm_VrQ">