EDIT: this bug seems resolved on Microsoft Azure as of 21.07.2023.
ARM64 linux 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
(gdb) run
Breakpoint 1, 0x0000aaaaaab522fc in readline ()
(gdb) continue
Program received signal SIGSEGV, Segmentation fault.
0x0000fffff7d91350 in strlen () from /lib64/libc.so.6
The above is on an ubuntu-22.04 with kernel 5.15.0-1040-azure, but all distributions and kernel versions have this issue on Azure apparently. VMWare ARM seems unaffected.
Is there a way for an application to determine on startup whether breakpoints and single-stepping work, before trying to attach uprobes ? The aim is to avoid a crash loop which renders the machine unreachable. Or is this a known virtualization-related limitation on some ARM hosts/VM's ?