Re: git: b014e0f15bc7 - main - Enable ASLR by default for 64-bit executables

From: Dawid_Górecki <dgr_at_semihalf.com>
Date: Wed, 24 Nov 2021 16:37:56 UTC
On Wed, Nov 24, 2021 at 3:41 PM Slawa Olhovchenkov <slw@zxy.spb.ru> wrote:
>
> On Tue, Nov 16, 2021 at 10:26:42PM +0000, Marcin Wojtas wrote:
>
> >
> >     Enable ASLR by default for 64-bit executables
> >
>
> Now any core dumps will be useless?
>

Core dumps work fine. I just created a test application to confirm.
LLDB resolves everything without issues.

First run:

root@aslr-dgr:~/coretest # lldb ./coretest --core ./coretest.core
(lldb) target create "./coretest" --core "./coretest.core"
Core file '/root/coretest/coretest.core' (x86_64) was loaded.
(lldb) bt
This version of LLDB has no plugin for the language "assembler".
Inspection of frame variables will be limited.
* thread #1, name = 'coretest', stop reason = signal SIGABRT
  * frame #0: 0x000021d0be68c53a libc.so.7`__sys_thr_kill at thr_kill.S:4
    frame #1: 0x000021d0be604bf4 libc.so.7`__raise(s=6) at raise.c:52:10
    frame #2: 0x000021d0be6b62c9 libc.so.7`abort at abort.c:67:8
    frame #3: 0x000021c8bd67d9f5 coretest`main at coretest.c:10:2
    frame #4: 0x000021c8bd67d7cd coretest`_start(ap=<unavailable>,
cleanup=<unavailable>) at crt1_c.c:73:7
(lldb) frame select 3
frame #3: 0x000021c8bd67d9f5 coretest`main at coretest.c:10:2
   7            int a = 1;
   8            printf("Core dump test.\n");
   9
-> 10           abort();
   11
   12           return 0;
   13   }
(lldb) frame v
(int) a = 1
(lldb) quit

Second run:

root@aslr-dgr:~/coretest # ./coretest
Core dump test.
Abort trap (core dumped)
root@aslr-dgr:~/coretest # lldb ./coretest --core ./coretest.core
(lldb) target create "./coretest" --core "./coretest.core"
Core file '/root/coretest/coretest.core' (x86_64) was loaded.
(lldb) bt
This version of LLDB has no plugin for the language "assembler".
Inspection of frame variables will be limited.
* thread #1, name = 'coretest', stop reason = signal SIGABRT
  * frame #0: 0x0000063d5022353a libc.so.7`__sys_thr_kill at thr_kill.S:4
    frame #1: 0x0000063d5019bbf4 libc.so.7`__raise(s=6) at raise.c:52:10
    frame #2: 0x0000063d5024d2c9 libc.so.7`abort at abort.c:67:8
    frame #3: 0x000006354fc1d9f5 coretest`main at coretest.c:10:2
    frame #4: 0x000006354fc1d7cd coretest`_start(ap=<unavailable>,
cleanup=<unavailable>) at crt1_c.c:73:7
(lldb)

You can see that addresses change but core dump still works.