| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
* Fix typos
* Cleanup trailing whitespaces in committed files
* Update include/tdep-ia64/libunwind_i.h
|
|
|
|
|
|
| |
Some (older) OSes do not support this POSIX function. Make it optional.
Fixes #379.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The coredump remote was architected on the assumption that the .text and
.eh_frame sections were mapped onto the same segment, and that that segment was
always the first PT_LOAD segment in an ELF file. Well, that was never a valid
assumption, and moderns releases of various toolchains have started splitting
the PT_LOAD segments for security reasons.
This change implements an M:N mapping of PT_LOAD segments in a coredump file to
backing ELF files and calculates and adjusts offsets appropriately. Because the
backing files get mapped in a lot of file I/O operations have been replaced with
simple memory reads. Once a backing file is memory mapped is stays mapped until
the address space is destroyed.
The ucd_*.[ch] files contain only functions that should not be exposed through
the public API so they;re not mangled using the UB naming schedule because I
just bring myself to write code with undefined behaviour.
Reformatted some of the changed files using `astyle --style=gnu` for internal
consistency withing the file.
Fixes #363
|
| |
|
|
|
|
|
|
| |
Stray errors were being reported on travis.ci because /bin/sh was not bash.
Fixes #374.
|
|
|
|
|
|
|
| |
Specifying --with-testdriver=TESTDRIVER at configure time allows the
substitution of a alternative LOG_DRIVER to be specified to enable remote
testing of a cross-built target. See the automake docuemntation on Custom Test
Drivers for more information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds support for Linux on LoongArch. Only 64-bit is supported
at the moment.
The changes were tested on a LoongArch architecture Loongson-3A5000
processor (LoongArch is a new RISC ISA, which is a bit like MIPS or
RISC-V.).
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
Signed-off-by: Jinyang He <hejinyang@loongson.cn>
Signed-off-by: Youling Tang <tangyouling@loongson.cn>
|
|
|
|
|
|
| |
The unw_get_proc_name_by_ip() function returns the name
of a procedure just like unw_get_proc_name(), except that it's
looked up by an instruction-pointer instead of a cursor.
|
|
|
|
|
|
|
| |
Commit 06468efcb52fb1ecbffed99818c1f567c60b1b90 switched `test-ptrace.c`
to use `execvpe` instead of `execve`. However, the former doesn't exist
on FreeBSD. This now adds a guard such that `execve` is used on FreeBSD
and `execvpe` is retained on other systems.
|
|
|
|
|
|
| |
Since glibc 2.32 [1], sigemptyset() no longer clears the entire sigset_t.
[1] "signal: Use <sigsetops.h> for sigemptyset, sigfillset" (9f6bd1f6057e57cce9b07844c28f15859ab15d49)
|
|
|
|
| |
In NixOS, coreutils aren't in their FHS-mandated locations.
|
|
|
|
| |
See #222 and #227. The tests are so fragile :(
|
|
|
|
|
| |
This commit adds support for Linux on RISC-V. Only 64-bit is supported
at the moment.
|
|
|
|
| |
This disallows frame reuse for tail and other sibling calls.
|
|
|
|
|
|
| |
The test is unwinding a precise number of frames, which assumes the
compiler will not inline these functions. Mark this explicitly to be
more reliable, and add some more verbose debugging aids.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The libunwind code base uses __linux__ already in many locations, but
some others relied on __linux instead. Apparently on some older
toolchain configurations, such as Ubuntu Trusty that's still used for
AppImage generation sometimes, __linux is never defined - only
__linux__ is. Fixes compiler warning on such platforms:
```
coredump/_UPT_get_dyn_info_list_addr.c: In function 'get_list_addr':
coredump/_UPT_get_dyn_info_list_addr.c:86:3: warning: #warning Implement get_list_addr(), please. [-Wcpp]
# warning Implement get_list_addr(), please.
^
```
|
|
|
|
|
|
|
| |
Bernhard Übelacker noticed that Ltest-cxx-exceptions was actually
testing the gcc implementation due to not linking with libunwind.
Fixes: #129
|
|
|
|
|
| |
A Linux core dump passes backing file names for LOAD segments. The coredump
library should take advantage of them if they are present.
|
|
|
|
|
| |
Use the (former) POSIX-standard <ucontext.h> everywhere instead of sometimes
using the Linux-specxific <sys/ucontext.h>.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Signed-off-by: Bert Wesarg <bert.wesarg@tu-dresden.de>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* x86_64: Add fixup code if previous RIP was invalid
Previous RIP could become invalid if a bad function pointer
was followed. Calling unwind from a signal frame in this case
skips the frame that called the bad pointer.
Check if the value at RSP looks to be valid in this case. It
should be the value of RIP pushed to the stack by the CALL instruction.
If it looks valid use this value as the next frames RIP else fallback
to the previous method.
|
| |
|
|
|
|
|
|
|
|
| |
dwarf: Push correct CFA onto stack for dwarf expression evaluation.
This change fixes a bug where stale CFAs were pushed onto the dwarf
expression stack before expression evaluation. Some optimising compilers
emit CFI which relies on this being correct.
|
|
|
|
| |
Without these, I was getting errors from this test set claiming that
wait, WIFCONTINUED, et al. were undefined on FreeBSD 11.1.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds a port to Linux on the IBM Z platform (a.k.a s390x). It only
supports the 64-bit ABI. Most functionality is working and all the tests
pass with the exception of the coredump tests*.
Unwinding is only supported if DWARF unwind information is present.
libunwind can't currently make use of the backchain (if present).
The getcontext/setcontext functions only preserve/restore a subset of
registers. Currently this only consists of callee-saved registers and
some parameter registers.
Vector registers and access registers are not saved (and aren't callee-
saved) by getcontext and cannot currently be modified. They will however
be restored unmodified after resuming a context from a signal handler.
There is no special libunwind support for setjmp, the functionality is
emulated using glibc (I think all the ports do this for modern Linux
kernels).
* Unwinding on s390x requires floating point register access which the
coredump library doesn't currently support.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(At least on x86(_32),) `unw_resume` will call `setcontext` which will modify the signal masks
based on the value in the context. Since the signal mask is not being initialized by
`unw_getcontext`, this cause the signal mask to be set to a random (uninitialized) value after
`unw_resume` which cause the test to fail since it relies on the signal mask for SIGUSR2 being
cleared.
The proper fix is likely to either make `unw_resume` not touch the signal mask if the context
wasn't initialized with a signal ucontext, or to make `unw_getcontext` record the signal mask too.
It's unclear to me which approach should be taken...
In the mean time, the intermittent failure can be fixed simply by zero initialing the context first
which would clear all the signal masks.
When siginfo is available, a more reliable way is to use the `ucontext` passed in
to the signal handler directly and rely on `sigreturn` to reset it.
Unfortunately, this is currently not implemented on all archs either.
|
|
|
|
|
|
|
|
|
| |
* Add `SA_SIGINFO` flag
This is needed to guarantee the availability of the `ucontext` argument
* Mark the `NULL` pointer load as `volatile`
Further prevent any compiler optimization on the load.
|
| |
|
|
|
|
| |
Sponsored by: The FreeBSD Foundation
|
|
|
|
| |
Ptrace interface doesn't understand multilib registers, so tests all fail.
|
|
|
|
|
|
|
|
| |
The calls to mincore() or msync() are not checking for actual accessibility
this could lead to SIGSEGV if the address from a mapped page with the
PROT_NONE property occurs on the stack.
Hence an attempt to write one byte from the checked address to a pipe will
fail if the address is not readable.
|
|
|
|
| |
Add unw_init_local2 with a flag for better extensibility in the future
|
| |
|
|
|
|
|
| |
Needs to be build with --enable-per-thread-cache. Default caching policy
is also UNW_CACHE_PER_THREAD than.
|
|
|
|
|
|
| |
We've tried to run slightly modified test-coredump-unwind.c built with
tcmalloc, and it promptly crashed. Attached patch fixes the heap buffer
overflow bug which caused it.
|
|
|
|
|
|
| |
state and
apply_reg_state to use it to complete the unw_step.
|
|
|
|
| |
data on/off the register state stack.
|
| |
|
|
|
|
| |
some tests are failing with clang currently.
|
| |
|
|
|
|
|
| |
init_local, but *not* setting use_prev_instr.
This is necessary to correctly unwind using ucontext argument to signal handlers.
|