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

    <tr>
        <th>Summary</th>
        <td>
            [lldb] PlatformPOSIX::DoLoadImage() failed on the remote target during the TestCompletion test
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            lldb,
            platform:linux
      </td>
    </tr>

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

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

<pre>
    The TestCompletion test failed in case of the remote target Linux AArch64 (the host is Windows). LoadImage() installs the .so image to the remote target with correct permissions. But PlatformPOSIX::DoLoadImage() reports the following error:
```
dlopen error: untu\tests\functionalities\completion\1\TestCompletion.test_process_unload\libshared.so: cannot open shared object file: No such file or directory
```
Note 1: The path separator is `\` in the error message, but `lldb.SBFileSpec(remote_path, False)` is used with the correct remote_path and the file `libshared.so` is correctly installed to the remote target. I have no idea where `/` has been converted to `\`.

Note 2: The tests directory is `/home/ubuntu/tests`. The path in the error message is cropped at the beginning (exactly 8 chars `/home/ub`) and probably some useful info in the error message is cropped too.

Note 3: All `dlopen error` messages contain a hardcoded description except the last one where `token == 0` in lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp, line 903:
```
lldb::addr_t token = process->ReadPointerFromMemory(return_addr, utility_error);
```
So, most probably this error is caused here.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVd2O4zYPfRrlhljDkeOMfZGLTPIFWGC_7aCzQHs3kCU6ViuLhiTPz9sXlDOT3W6KFggQy6IOzXMOKRWjPXvEnajvRX1cqTkNFHbRvRk7Kr_qyLztvg0I3zCmA42Tw2TJQ8KYoFfWoQHrQauIQD2kASHgSAkhqXDGBF-sn19hvw962G5AyIZDBooJbITfrDf0EoVsC_hCynwe1RmFbIRswfqYlHMxYxaRwPImJLqR5MWmATSFgDrBhGG0MVrysYD7OcGDU6mnMD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