|
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 $ */ |
2 | 2 |
|
3 | 3 | /*- |
4 | 4 | * Copyright (c) 2024 The NetBSD Foundation, Inc. |
|
27 | 27 | */ |
28 | 28 |
|
29 | 29 | #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 $"); |
31 | 31 |
|
32 | 32 | #include <dlfcn.h> |
33 | 33 | #include <setjmp.h> |
@@ -124,30 +124,7 @@ on_sigusr1(int signo, siginfo_t *si, void *ctx) |
124 | 124 | * Ensure that if we enter the signal handler, we are entering |
125 | 125 | * it from the original stack, not from any of the alternate |
126 | 126 | * 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 |
146 | 127 | */ |
147 | | -#if defined __ia64__ |
148 | | - if (nentries > 0) |
149 | | - atf_tc_expect_fail("PR lib/57946"); |
150 | | -#endif |
151 | 128 | for (ssp = &ss[0]; ssp < &ss[__arraycount(ss)]; ssp++) { |
152 | 129 | ATF_REQUIRE_MSG((sp < ssp->ss_sp || |
153 | 130 | sp >= (void *)((char *)ssp->ss_sp + ssp->ss_size)), |
@@ -257,6 +234,12 @@ ATF_TC_HEAD(setjmp, tc) |
257 | 234 | ATF_TC_BODY(setjmp, tc) |
258 | 235 | { |
259 | 236 |
|
| 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 | + |
260 | 243 | /* |
261 | 244 | * Set up a return point for the signal handler: when the |
262 | 245 | * signal handler does longjmp(jmp, 1), it comes flying out of |
@@ -289,6 +272,12 @@ ATF_TC_BODY(compat13_setjmp, tc) |
289 | 272 |
|
290 | 273 | compatsetup(); |
291 | 274 |
|
| 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 | + |
292 | 281 | /* |
293 | 282 | * Set up a return point for the signal handler: when the |
294 | 283 | * signal handler does (*compat13_longjmp)(jmp, 1), it comes |
@@ -319,6 +308,12 @@ ATF_TC_HEAD(sigsetjmp, tc) |
319 | 308 | ATF_TC_BODY(sigsetjmp, tc) |
320 | 309 | { |
321 | 310 |
|
| 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 | + |
322 | 317 | /* |
323 | 318 | * Set up a return point for the signal handler: when the |
324 | 319 | * signal handler does siglongjmp(sigjmp, 1), it comes flying |
@@ -350,9 +345,14 @@ ATF_TC_HEAD(compat13_sigsetjmp, tc) |
350 | 345 | ATF_TC_BODY(compat13_sigsetjmp, tc) |
351 | 346 | { |
352 | 347 |
|
353 | | - |
354 | 348 | compatsetup(); |
355 | 349 |
|
| 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 | + |
356 | 356 | /* |
357 | 357 | * Set up a return point for the signal handler: when the |
358 | 358 | * signal handler does (*compat13_siglongjmp)(sigjmp, 1), it |
|
0 commit comments