Page MenuHomeFreeBSD

Basic signal tests: Can we deliver a signal?
ClosedPublic

Authored by imp on Nov 22 2021, 4:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 1, 3:44 AM
Unknown Object (File)
Sun, Oct 20, 12:08 AM
Unknown Object (File)
Oct 2 2024, 8:19 PM
Unknown Object (File)
Sep 30 2024, 1:15 AM
Unknown Object (File)
Sep 29 2024, 9:48 PM
Unknown Object (File)
Sep 26 2024, 7:27 AM
Unknown Object (File)
Sep 24 2024, 6:35 AM
Unknown Object (File)
Sep 24 2024, 6:26 AM
Subscribers
None

Details

Summary

Basic signal tests that tests can we deliver a signal via raise() and
can we deliver one via SIGALARM asynchronously.

In addition, tests whether or not on ARM T32 (Thumb) code can interrupt
A32 (normal) and vice versa.

While this test is aimed at ensuring basic qemu signals are working,
it's good to have in the base.

Sponsored by: Netflix

Test Plan

Tested on x86 and passes.
Haven't tested the armv7 stuff yet.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42917
Build 39805: arc lint + arc unit

Event Timeline

imp requested review of this revision.Nov 22 2021, 4:34 PM
imp created this revision.
tests/sys/kern/basic_signal.c
4

Nice

13

+volatile here and on the ARM ones

78

I think this and the below will need alternative GCC versions; the GCC documentation seems to indicate that arch= is specifically for -march options, and the GCC equivalents to this specifically are just target("arm") and target("thumb").

I wonder if these are worth macros in cdefs.h, but I really can't come up with a good name for those... __thumb is maybe not terrible, but __arm probably is. __a32 and __t32 maybe, but that feels a bit obscure.

tests/sys/kern/basic_signal.c
78

I think clang now support the GNU syntax, so maybe using it would be enough ?

https://reviews.llvm.org/D33721

tests/sys/kern/basic_signal.c
78

They build and appear to work on both. I'm not sure I want to invent something for FreeBSD for an architecture that may be the long glide path after peaking that currently only has use in a test.

imp edited the test plan for this revision. (Show Details)

+ volatile.

tests/sys/kern/basic_signal.c
78

Hmmm, there may be a clang issue... Rebuilding to make sure.

imp marked 2 inline comments as done.Nov 22 2021, 11:31 PM

Updated with the 'marker' things. Didn't see that we had this in the rest of the tree, so I thought I'd limit them to this file...

tests/sys/kern/basic_signal.c
78

As you see, I needed to update since the above code review doesn't seem to be in the clang tree yet. Or at least the latest tree needs them...

... The only other place that we'd need them is when we do T32 / A32 thread tests...

tests/sys/kern/basic_signal.c
83

Shouldn't that be just target("arm") and target("thumb") for gcc ? :)

Turns out cognet was right. target("arm") not target("arch=arm") is the
form. And it seems to work for both clang and arm.

better comments. remind the reader that thumb function addresses have the low
bit set.

imp marked 2 inline comments as done.Nov 23 2021, 8:40 PM

I'm going to go ahead and commit this: it passes in my env for amd64, aarch64 and armv7 (running in a chroot on aarch64).

tests/sys/kern/basic_signal.c
78

My last comment is wrong: this code was wrong in arch=arm. target(arm) and target(thumb) just work for both gcc and clang.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 23 2021, 8:42 PM
This revision was automatically updated to reflect the committed changes.