3714 Commits

Author SHA1 Message Date
dependabot[bot]
790aefd3a3 Bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.4 to 4.1.6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](0ad4b8fada...a5ac7e51b4)

Updates `github/codeql-action` from 3.25.3 to 3.25.7
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](d39d31e687...f079b84933)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 14:43:30 -04:00
Stephen Webb
8b9a387171 Add use of libabigail for ABI checks
Added `make -C src check-abi` target to leverage libabigail 2.0 tools to
check for ABI changes.

Add ABI baseline files for aarch64, i686, riscv, s390x, and x86_64 Linux
targets and aarch64 and x86_64 QNX SDP 7.1 targets.

Used the check-abi target in the CI-unix github workflow.
2024-05-14 12:02:11 -04:00
Ian Zborovsky
0be67323b2 Fixed miscompilation of unw_getcontext() on ARM 2024-05-07 08:39:33 -04:00
Stephen Webb
d8766d3faf Fixed arm-linux FTBFS
A recent change clobbered the predefinition of _GNU_SOURCE for arm-linux
targets. Repaired.
2024-05-06 09:06:48 -04:00
Rageking8
30041ef9f9 Fix following typos 2024-05-01 12:30:51 -04:00
dependabot[bot]
b3ad2ebefa Bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.2 to 4.1.4
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](9bb56186c3...0ad4b8fada)

Updates `github/codeql-action` from 3.24.9 to 3.25.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1b1aada464...d39d31e687)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-01 12:03:39 -04:00
Stephen Webb
8428e1f0ca Replace clobber of CFLAGS in configure.ac
Replaced the clobbering of the user variable CFLAGS in configure.ac with
UNW_EXTRA_CFLAGS.
2024-04-19 09:25:08 -04:00
Stephen Webb
be0b15d68f Replace defining CPPFLAGS in configure.ac
Replaced defining the user variable CPPFLAGS in configure.ac with
UNW_REMOTE_CPPFLAGS and UNW_TARGET_CPPFLAGS.
2024-04-19 09:25:08 -04:00
Stephen Webb
6aa693e7e0 Simplify --enable-debug
Enabling debug mode was convoluted and added cognitive load.

This change simplifies how the configuration option --enable-debug works
by simply adding -DUNW_DEBUG=1 to the preprocesor flags via a specific
confiuration variable, accomplishing the folowing goals.
    - don't clobber the CPPFLAGS user variable
    - don't mess with -DNDEBUG which has other meanings orthogonal
      to libunwind debug mode
    - don't hide the definition of the ABI-changing build-time option
      behind an ifdef in an internal header file

In addition I added a warning to confogure --help to point out that
enabling the option changes the ABI. Caveat lector.
2024-04-19 09:25:08 -04:00
Stephen Webb
96e0fef409 Remove explicit setting CCASFLAGS and AM_CCASFLAGS
The user variable CCASFLAGS should never be set in configure.ac, and the
default AM_CCASFLAGS already has AM_CPPFLAGS added so it ends up
appearing in the command line twice.

Remove setting both of these variables so using the user variable from
the command line will do the right thing and there is less noise in the
build logs.
2024-04-19 09:25:08 -04:00
Stephen M. Webb
0f5d5a636f Add issue templates 2024-04-19 09:01:32 -04:00
dependabot[bot]
984243c60d Bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.1 to 4.1.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](b4ffde65f4...9bb56186c3)

Updates `github/codeql-action` from 3.24.6 to 3.24.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](8a470fddaf...1b1aada464)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-15 08:49:16 -04:00
Jingyun Hua
05afdabf38 Remove the useless endina.h in getcontext.S for loongarch64
Fix issue #740
2024-04-10 11:32:04 -04:00
Kevin Gosse
e0dfc3a0ed Set image to null when invalid 2024-04-10 11:01:44 -04:00
Andreas Schwab
3705baed4d Fix unw_is_signal_frame for RISC-V
Don't require the IP to be 8-byte aligned.  Instructions can start at any
even address.
2024-04-03 13:56:38 -04:00
Aaron Robinson
f079064b19 Address warnings from MSVC (#734)
* Address warnings from MSVC

These issues were found when enabling
C4242 and C4244 warnings.

* Add support on CI
2024-04-03 13:37:43 -04:00
dependabot[bot]
0f86636e51 Bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [jirutka/setup-alpine](https://github.com/jirutka/setup-alpine) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `jirutka/setup-alpine` from 1.1.4 to 1.2.0
- [Release notes](https://github.com/jirutka/setup-alpine/releases)
- [Commits](458376dba1...359b91e094)

Updates `github/codeql-action` from 3.23.2 to 3.24.6
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b7bf0a3ed3...8a470fddaf)

---
updated-dependencies:
- dependency-name: jirutka/setup-alpine
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-22 08:45:18 -04:00
Stephen Webb
644fd6e6b4 Add do-release script
- scripts/do-release: New file. Prepares release tarballs with the
    latest up-to-date config scripts.
2024-02-20 15:17:35 -05:00
dependabot[bot]
8ad5e75fb4 Bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.22.12 to 3.23.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](012739e508...b7bf0a3ed3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-15 07:56:44 -05:00
Dan Horák
49cb302b53 tests/ppc64-test-plt: add parameter names
ISO C does not support omitting parameter names in function definitions
before C2X, so better add them.

fixes:
ppc64-test-plt.c: In function ‘unw_get_accessors_int’:
ppc64-test-plt.c:10:41: error: parameter name omitted
   10 | unw_accessors_t *unw_get_accessors_int (unw_addr_space_t) { return NULL; }
      |                                         ^~~~~~~~~~~~~~~~
ppc64-test-plt.c: In function ‘_Uppc64_dwarf_step’:
ppc64-test-plt.c:11:17: error: parameter name omitted
   11 | int dwarf_step (struct dwarf_cursor*) { return 0; }
      |                 ^~~~~~~~~~~~~~~~~~~~
make[1]: *** [Makefile:1662: ppc64-test-plt.o] Error 1

seen on ppc64 with gcc 10.3.1
2024-02-15 07:46:44 -05:00
Stephen Webb
7e16c2d244 Make tests installable
Tests will now always be built (unless configured with --disable-tests)
and installed by default in ${prefix}/libexec/libunwind. A new script,
test-runner, is supplied to run all of the tests and produce TAP output.

configure.ac: make tests/check-namespace.sh executable,
    add license boilerplate
tests/Makefile.am: remove run-coredump-unwind, add test-runner,
    add license boilerplate, remove XFAIL for riscv64
tests/README.md: new file
tests/check-namespace.sh.in: make LIBUNWIND and LIBUNWIND_GENERIC
    externally settable, add license boilerplate
tests/run-check-namespace: remove file
test/run-ptrace-mapper: look for test-ptrace relative to script,
    add license boilerplate
test/run-ptrace-misc: look for test-ptrace relative to script,
    add license boilerplate
test/test-runner.in: new file
.github/workflows/CI-unix.yml: change run-check-namespace to
    check-namespace.sh, use libtool to run in-tree binaries instead of
    forcing static linking
2024-02-14 08:55:01 -05:00
Andrew Au
5ce1a7a7bb Remove double indirection in unw_get_proc_info_in_range()
Fixes issue #713
2024-02-01 10:17:21 -05:00
Ross Burton
df0807c1c2 coredump: use glibc or musl register names as appropriate on MIPS
glibc has register macros of the form EF_REGx, but musl uses EF_Rx.

Handle this by using a macro to use the correct names.

Closes #708.

Signed-off-by: Ross Burton <ross.burton@arm.com>
2024-01-19 09:43:30 -05:00
Ross Burton
c8499e99dc tests/Garm64-test-sve-signal: check that SVE is present before running tests
If the compiler supports -march=armv8-a+sve then those options are used
to build this test, but all that needs is a sufficiently new compiler.

This then results in the __ARM_FEATURE_SVE check always passing, because
SVE is explicitly enabled.

However it's perfectly possible for the compiler to support +sve but the
machine running the code to not, which results with the test crashing
with "Illegal instruction".

Handle this case by checking HWCAP for SVE support, and skipping the
test unless we know it is available.  This check is Linux-specific at
present, but the logic is easily extended.

Signed-off-by: Ross Burton <ross.burton@arm.com>
2024-01-19 08:28:59 -05:00
François Rigault
3ac60d4087 handle .eh_frame_hdr with no binary search table
as reported on
https://github.com/libunwind/libunwind/issues/161
and https://github.com/benfred/py-spy/issues/398

some binaries contain table_enc=DW_EH_PE_omit which is valid according
to https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB/ehframehdr.html

On my environment I read:
```
$ objdump  -s -j .eh_frame_hdr /usr/lib64/libc.so.6

/usr/lib64/libc.so.6:     file format elf64-x86-64

Contents of section .eh_frame_hdr:
 1c37bc 011bffff 08000000                    ........
              ||<--- 0xff = table_enc
```
which causes py-spy to crash with sigabort.
Return an error code instead.
2024-01-19 08:26:34 -05:00
Adeel Mujahid
b07455ce4f Update Gstep.c 2024-01-18 11:36:07 -05:00
Adeel Mujahid
532d345363 Update Gstep.c 2024-01-18 11:36:07 -05:00
Adeel Mujahid
76587c9e51 Fix win-x64 crossbuild (remote unwind) 2024-01-18 11:36:07 -05:00
Adeel Mujahid
b603e634d2 Add missing functions for macOS 2024-01-16 09:59:10 -05:00
Adeel Mujahid
4faebf4d8b Check existence of attribute 2024-01-16 09:23:10 -05:00
Stephen M. Webb
75fe438e4a Add explicit support for linux-musl targets
- added musl target CI builds to CI-unix.yml
- added config-time check for libucontext
- added better detection of NULL IP in x86_64 unw_step() because musl does not
  follow the de facto x86_64 ABI conventions for main program entry
2024-01-16 09:00:23 -05:00
Adeel Mujahid
b0837eda99 Add missing defined for osx-arm64 (remote unwind) 2024-01-15 22:06:50 -05:00
Adeel Mujahid
b0abe4a24d Add missing return in _do_pipe2 2024-01-15 15:40:04 -05:00
dependabot[bot]
f0b3ad50ac Bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.22.11 to 3.22.12
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](b374143c11...012739e508)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-15 10:34:33 -05:00
Dmitry Chagin
a390849824 Fix style. 2024-01-11 13:19:57 -05:00
Dmitry Chagin
f642211e25 Fix build on FreeBSD/x86_64. 2024-01-11 13:19:57 -05:00
Stephen M. Webb
2de55a6ff7 Add project description to README 2023-12-31 09:46:30 -05:00
Stephen M. Webb
c7e653f431 Simplify test-coredump-unwind
This test source had all kinds of bells and whistles added, requiring all kinds
of (non-portable) dependencies that were never really used. Removed the extra
stuff (logging through syslog, catching segfaults).

Also remove the build dependency on libbacktrace since it actually causes
conflicts with libunwind.
2023-12-31 09:45:45 -05:00
Stephen M. Webb
41ff26e8e4 Remove coredump/_UCD_lib.h
This header file was included in all the other coredump sources and pulled in a
slew of system headers, none of which were used anywhere. Some of those headers
did not even exist on all supported targets.

Fewer build dependencies, fewer build failures, no change in functionality.
2023-12-31 09:45:45 -05:00
dependabot[bot]
c62e1f0d65 Bump the github-actions group with 3 updates
Bumps the github-actions group with 3 updates: [actions/checkout](https://github.com/actions/checkout), [github/codeql-action](https://github.com/github/codeql-action) and [actions/stale](https://github.com/actions/stale).


Updates `actions/checkout` from 3.6.0 to 4.1.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](f43a0e5ff2...b4ffde65f4)

Updates `github/codeql-action` from 2.22.10 to 3.22.11
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](305f654631...b374143c11)

Updates `actions/stale` from 5.2.1 to 9.0.0
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](f7176fd300...28ca103628)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-13 15:44:13 -05:00
Joyce
986ae8074c set top level to groom-issues.yml
Signed-off-by: Joyce <joycebrum@google.com>
2023-12-13 15:33:26 -05:00
Joyce
21537b88bf set top level codeql-analysis.yml
Signed-off-by: Joyce <joycebrum@google.com>
2023-12-13 15:33:26 -05:00
StepSecurity Bot
891fc2073c [StepSecurity] Apply security best practices (#1)
* [StepSecurity] Apply security best practices

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>

* Update dependabot.yml

Signed-off-by: Joyce <joycebrum@google.com>

---------

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
Signed-off-by: Joyce <joycebrum@google.com>
Co-authored-by: Joyce <joycebrum@google.com>
2023-12-13 15:33:26 -05:00
Sam James
1fcdb8af0c configure.ac: fix bashism in LDFLAGS append
'+=' is not required for POSIX shells and may not work with e.g. /bin/sh
provided by dash. Just expand it instead.
2023-12-04 08:09:00 -05:00
Stephen Webb
5dc97eb19c Annotate XFAILs in tests/Makefile.am
Added links back to github issues for most XFAILS in tests/Makefile.am.
Also added additional XFAILS for PPC32 (with links).
2023-12-02 10:00:26 -05:00
Stephen M. Webb
304caa90c1 Bump trunk to version 1.9-pre 2023-12-02 10:00:03 -05:00
Stephen Webb
75281907d3 Use header for test function prototype
Some of the unit test code was bringing an extern function prototype
into scoe in a function body. The idiomatic and expected way to do this
is by using a header file and not adhering to the idiom not only
increases the cognitive load of the reader but tgriggers warning from
static analysis tools.

This change just does it the right way instead. No functional change.
v1.8-branchpoint
2023-11-29 15:47:17 -05:00
Stephen Webb
35986bcd2e Add header guard to setjmp_i.h
No functional change.
2023-11-29 15:14:58 -05:00
Stephen Webb
995590e02d Fix edge condition in unw_address_is_valid
Logic was skipping the last page in a multi-page check.
2023-11-28 08:38:28 -05:00
Stephen Webb
f35c38746d Fix test-async-sig on x86-linux
The x86-specific code would often mistakenly advance the cursor through
the signal trampoline by misinterpreting what was on the stack, and it
just happened to work most of the time. It was wrong, however, and
moving the signal trampolive detection up before the DWARF stepping
(like it is on other target architectures) should make it do the right
thing.

This change had the cascade effect of tickling some undefined behaviour
in the target architecture-specific unw_resume code, so that got fixed
too.
2023-11-25 08:16:53 -05:00