GDB breakpoints and uprobes result in SIGILL or SIGSEGV on arm64 Azure VMs

Bogdan Harjoc harjoc at gmail.com
Thu Jun 29 04:06:02 PDT 2023


Arm64 machines on Microsoft Azure seem to have a bug where attaching
uprobes or gdb breakpoints on most (but not all) binaries will result
in SIGILL or SIGSEGV being delivered when execution continues after
the breakpoint:

$ gdb /bin/bash
(gdb) break readline
Breakpoint 1 at 0xd610c
(gdb) run
Breakpoint 1, 0x0000aaaaaab7610c in readline ()
(gdb) stepi
0x0000aaaaaab76110 in readline ()
(gdb) stepi
Program received signal SIGSEGV, Segmentation fault.
__strlen_asimd () at ../sysdeps/aarch64/multiarch/strlen_asimd.S:96

It looks like the second stepi unexpectedly jumps out of readline and
into __strlen_asimd, where it crashes. The same happens with lldb
instead of gdb.

The above is on an ubuntu-22.04 with kernel 6.2.0-1005-azure, but all
tested distributions and kernel versions have this issue on Azure
apparently. Other tested virtualization platforms seem unaffected.

A simple test app which registers a SIGTRAP handler and then calls
__asm__("bkpt #0"), seems to continue correctly after the handler
updates pc to skip over the bkpt opcode.



More information about the linux-arm-kernel mailing list