Skip to content

Unittest: fix catch_assert for glibc2.41 (#1339)#1348

Open
anordal wants to merge 2 commits into
FreeRTOS:mainfrom
anordal:unittest-fix-catch-assert-for-glibc2.41
Open

Unittest: fix catch_assert for glibc2.41 (#1339)#1348
anordal wants to merge 2 commits into
FreeRTOS:mainfrom
anordal:unittest-fix-catch-assert-for-glibc2.41

Conversation

@anordal

@anordal anordal commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes unittests dying of SIGABRT. From what I can gather, probably related to glibc version.

Test Steps

Build and run the unittests as described in tests/unit-test/README.md

Checklist:

  • I have tested my changes: It's a macro used in testing only.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request: This unbreaks most of the tests.

Related Issue

#1339

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

anordal added 2 commits June 15, 2026 23:42
Makes tests not die of SIGABRT (FreeRTOS#1339).

I only suspect this to depend on Glibc version:
I have not dug in to the Glibc code to verify it,
and I can't rule out another library, but that's
my nullhypothesis. Tested:

* Opensuse Tumbleweed last time I contributed = Good
* Ubuntu 24.04 (Glibc 2.39) = Good
* OpenSuse Leap 16 (Glibc 2.40) = Good
* Ubuntu 25.04 (Glibc 2.41) = Bad
* Ubuntu 26.04 (Glibc 2.41) = Bad
* Opensuse Tumbleweed now = Bad

Hypothesis:

Signals are "blocked" (as in put in a queue) while the signal
handler runs to avoid recursion. Thus, longjumping out of the
signal handler may steer away from the signal unblocking path,
thus isn't really supposed to work.

This is the minimal but suboptimal change: Unblock the signal.
This can be done more elegantly with siglongjmp (next commit).
A more proper fix for FreeRTOS#1339 than the previous commit:
siglongjmp also restores signal state.

Also take the opportunity to minimize macro state, code and namespace
footprint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant