Skip to content

Commit c899f40

Browse files
riastradhriastradh
authored andcommitted
tests/lib/libc/setjmp/t_sigstack: Update xfails.
Designations based on actual test run for i386 and code inspection for arm and sh3 (and code inspection for all the other architectures not listed because I expect the tests to pass on them -- they mostly use sigreturn which will DTRT). Move the ia64 xfail to just setjmp/sigsetjmp -- no compat13 on ia64. Nix the long comment now that just about everything has been fixed. PR lib/57946: longjmp fails to restore stack first before restoring signal mask on most architectures
1 parent 7178abc commit c899f40

1 file changed

Lines changed: 26 additions & 26 deletions

File tree

tests/lib/libc/setjmp/t_sigstack.c

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: t_sigstack.c,v 1.19 2025/04/24 01:48:21 riastradh Exp $ */
1+
/* $NetBSD: t_sigstack.c,v 1.20 2025/04/24 16:50:02 riastradh Exp $ */
22

33
/*-
44
* Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
2727
*/
2828

2929
#include <sys/cdefs.h>
30-
__RCSID("$NetBSD: t_sigstack.c,v 1.19 2025/04/24 01:48:21 riastradh Exp $");
30+
__RCSID("$NetBSD: t_sigstack.c,v 1.20 2025/04/24 16:50:02 riastradh Exp $");
3131

3232
#include <dlfcn.h>
3333
#include <setjmp.h>
@@ -124,30 +124,7 @@ on_sigusr1(int signo, siginfo_t *si, void *ctx)
124124
* Ensure that if we enter the signal handler, we are entering
125125
* it from the original stack, not from any of the alternate
126126
* signal stacks.
127-
*
128-
* On some architectures, this is broken. Those that appear to
129-
* get this right are:
130-
*
131-
* aarch64
132-
* alpha
133-
* arm
134-
* hppa
135-
* i386
136-
* m68k
137-
* mips
138-
* or1k
139-
* powerpc
140-
* powerpc64
141-
* sparc
142-
* sparc64
143-
* riscv
144-
* vax
145-
* x86_64
146127
*/
147-
#if defined __ia64__
148-
if (nentries > 0)
149-
atf_tc_expect_fail("PR lib/57946");
150-
#endif
151128
for (ssp = &ss[0]; ssp < &ss[__arraycount(ss)]; ssp++) {
152129
ATF_REQUIRE_MSG((sp < ssp->ss_sp ||
153130
sp >= (void *)((char *)ssp->ss_sp + ssp->ss_size)),
@@ -257,6 +234,12 @@ ATF_TC_HEAD(setjmp, tc)
257234
ATF_TC_BODY(setjmp, tc)
258235
{
259236

237+
#if defined __ia64__
238+
atf_tc_expect_fail("PR lib/57946:"
239+
" longjmp fails to restore stack first before"
240+
" restoring signal mask on most architectures");
241+
#endif
242+
260243
/*
261244
* Set up a return point for the signal handler: when the
262245
* signal handler does longjmp(jmp, 1), it comes flying out of
@@ -289,6 +272,12 @@ ATF_TC_BODY(compat13_setjmp, tc)
289272

290273
compatsetup();
291274

275+
#if defined __arm__ || defined __i386__ || defined __sh3__
276+
atf_tc_expect_fail("PR lib/57946:"
277+
" longjmp fails to restore stack first before"
278+
" restoring signal mask on most architectures");
279+
#endif
280+
292281
/*
293282
* Set up a return point for the signal handler: when the
294283
* signal handler does (*compat13_longjmp)(jmp, 1), it comes
@@ -319,6 +308,12 @@ ATF_TC_HEAD(sigsetjmp, tc)
319308
ATF_TC_BODY(sigsetjmp, tc)
320309
{
321310

311+
#if defined __ia64__
312+
atf_tc_expect_fail("PR lib/57946:"
313+
" longjmp fails to restore stack first before"
314+
" restoring signal mask on most architectures");
315+
#endif
316+
322317
/*
323318
* Set up a return point for the signal handler: when the
324319
* signal handler does siglongjmp(sigjmp, 1), it comes flying
@@ -350,9 +345,14 @@ ATF_TC_HEAD(compat13_sigsetjmp, tc)
350345
ATF_TC_BODY(compat13_sigsetjmp, tc)
351346
{
352347

353-
354348
compatsetup();
355349

350+
#if defined __arm__ || defined __i386__ || defined __sh3__
351+
atf_tc_expect_fail("PR lib/57946:"
352+
" longjmp fails to restore stack first before"
353+
" restoring signal mask on most architectures");
354+
#endif
355+
356356
/*
357357
* Set up a return point for the signal handler: when the
358358
* signal handler does (*compat13_siglongjmp)(sigjmp, 1), it

0 commit comments

Comments
 (0)