<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61899>61899</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
LLDB to skip disabling ASLR in constrained environments
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
am11
</td>
</tr>
</table>
<pre>
Running application under lldb in a docker container gives an unfriendly error:
```gdb
# tested in the following docker containers:
# Ubuntu 22.04 -> apt install lldb
# Alpine 3.17 -> apk add lldb
(lldb) r
'A' packet returned an error: 8
# that's all; it gives up (no indication, whatsoever, that it is failing because of the environment constraint)
(lldb)
```
Workaround is to manually enable ASLR by setting disable-aslr to false: `settings set target.disable-aslr false`
gdb, on the other hand, makes its best effort by tolerating the case when disabling ASLR fails; with a warning:
```gdb
(gdb) r
Starting program: app
warning: Error disabling address space randomization: Operation not permitted
# and continues running the app
```
## Expected behavior
<ins>Warn but still continue with ASLR</ins>
Adapt to the environment constraints in a similar manner as gdb.
```diff
(lldb) r
- 'A' packet returned an error: 8
+ Warning! Disabling address space randomization failed with 'Operation not permitted'. Continuing..
```
<ins>Issue a friendly error and stop</ins>
Alternatively, a better (searchable) error message would be appreciated:
```diff
(lldb) r
- 'A' packet returned an error: 8
+ Error! Disabling address space randomization failed with 'Operation not permitted'. Stopping..
(lldb)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0VV-L67gP_TTui5iSOp2mfchD5x_84MIP7mWZZyVWEm8dO9hKu7OfflHSuW2Hmcsu7JaWEkWypHOOZEzJtp6oVPcP6v5pgSN3IZbYr1aLKpi38vvovfUt4DA4WyPb4GH0hiI4ZyqwHhBMqA8UoQ6e0XqK0NojJUDxbKIlb9wbUIwhqnyvsieV7dUmm7-tqc4WnQNTYjJyKHcETXAunCT5xwTpco7OQT6_VaPnEbReZmu4U_kz4MBgfWJ0bir11n_vBusJ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