Catch SIGSEGV during de-compression, and print state info
("auto debug") using /proc/self/maps and gdb.
This was motivated by suspicion of unreliable hardware
which triggered "Heisenbugs": a crash which cannot be reproduced.
If SIGSGV occurs without the "auto debug" info, then that
implies an error user code after de-compression, often when
user code accesses /proc/self/exe, which is not the un-compressed file.
modified: misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
modified: src/help.cpp
modified: src/main.cpp
modified: src/options.h
modified: src/p_lx_elf.cpp
modified: src/stub/Makefile
modified: src/stub/src/amd64-linux.elf-entry.S
modified: src/stub/src/amd64-linux.elf-fold.S
modified: src/stub/src/arm.v4a-linux.elf-entry.S
modified: src/stub/src/arm.v4a-linux.elf-fold.S
modified: src/stub/src/arm64-linux.elf-entry.S
modified: src/stub/src/arm64-linux.elf-fold.S
plus generated .h .dump .map
zig/powerpc64le/musl newly undefined openat64; adjacent literal strings
in C source were not concatenated; comment introduced by double slash
did not ignore backslash in rest of line
modified: ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
modified: stub/src/mipsel.r3000-linux.elf-fold.S
modified: stub/src/powerpc-linux.elf-entry.S
modified: stub/src/powerpc-linux.elf-fold.S
modified: stub/src/powerpc64-linux.elf-entry.S
modified: stub/src/powerpc64-linux.elf-fold.S
modified: stub/src/upxfd_linux.c
... or O_TMPFILE for recovery using /dev/shm
https://github.com/upx/upx/issues/889
modified: stub/src/upxfd_linux.c
modified: ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
plus generated .h .map .dump
Linux on bare metal (and explicit qemu) seems not to care,
but qemu-user-binfmt gives ENOEXEC (Exec format error)
https://github.com/upx/upx/issues/876
so that anti-virus checkers of apps for 64-bit Windows that are newly-
compressed by upx should not complain about new matches with malware.
This costs a few bytes and a small fraction of cycles in NRV2
de-compressors, but is considered to be a tolerable concession
to the cesspool environment of software for Microsoft Windows.
modified: ../misc/testsuite/upx_testsuite_1-expected_sha256sums.sh
modified: p_w64pe_amd64.cpp see code comments
modified: stub/amd64-win64.pe.h
modified: stub/src/arch/amd64/lzma_d.S see code comments
modified: stub/src/arch/amd64/nrv2b_d.S
modified: stub/src/arch/amd64/nrv2d_d.S
modified: stub/src/arch/amd64/nrv2e_d.S
modified: stub/tmp/amd64-win64.pe.bin.dump