NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
PR/57946 CVS commit: [netbsd-10] src
The following reply was made to PR lib/57946; it has been noted by GNATS.
From: "Martin Husemann" <martin%netbsd.org@localhost>
To: gnats-bugs%gnats.NetBSD.org@localhost
Cc:
Subject: PR/57946 CVS commit: [netbsd-10] src
Date: Fri, 23 Aug 2024 16:56:31 +0000
Module Name: src
Committed By: martin
Date: Fri Aug 23 16:56:30 UTC 2024
Modified Files:
src/distrib/sets/lists/debug [netbsd-10]: mi
src/distrib/sets/lists/tests [netbsd-10]: mi
src/lib/libc/arch/arm/gen [netbsd-10]: setjmp.S
src/lib/libc/arch/i386/gen [netbsd-10]: setjmp.S sigsetjmp.S
src/lib/libc/arch/sh3/gen [netbsd-10]: setjmp.S sigsetjmp.S
src/lib/libc/arch/x86_64/gen [netbsd-10]: __setjmp14.S __sigsetjmp14.S
src/tests/lib/libc/setjmp [netbsd-10]: Makefile
Added Files:
src/tests/lib/libc/setjmp [netbsd-10]: t_sigstack.c
Log Message:
Pull up following revision(s) (requested by riastradh in ticket #795):
tests/lib/libc/setjmp/Makefile: revision 1.3
distrib/sets/lists/debug/mi: revision 1.425
lib/libc/arch/sh3/gen/setjmp.S: revision 1.12
lib/libc/arch/i386/gen/sigsetjmp.S: revision 1.19
lib/libc/arch/x86_64/gen/__setjmp14.S: revision 1.4
tests/lib/libc/setjmp/t_sigstack.c: revision 1.10
tests/lib/libc/setjmp/t_sigstack.c: revision 1.11
tests/lib/libc/setjmp/t_sigstack.c: revision 1.12
tests/lib/libc/setjmp/t_sigstack.c: revision 1.1
lib/libc/arch/sh3/gen/sigsetjmp.S: revision 1.11
tests/lib/libc/setjmp/t_sigstack.c: revision 1.2
tests/lib/libc/setjmp/t_sigstack.c: revision 1.3
tests/lib/libc/setjmp/t_sigstack.c: revision 1.4
tests/lib/libc/setjmp/t_sigstack.c: revision 1.5
tests/lib/libc/setjmp/t_sigstack.c: revision 1.6
lib/libc/arch/arm/gen/setjmp.S: revision 1.19
tests/lib/libc/setjmp/t_sigstack.c: revision 1.7
tests/lib/libc/setjmp/t_sigstack.c: revision 1.8
tests/lib/libc/setjmp/t_sigstack.c: revision 1.9
lib/libc/arch/i386/gen/setjmp.S: revision 1.18
lib/libc/arch/x86_64/gen/__sigsetjmp14.S: revision 1.4
distrib/sets/lists/tests/mi: revision 1.1306
longjmp(3): Add test for PR lib/57946.
longjmp(3): Paranoia: more error checking in PR lib/57946 test.
longjmp(3): Test signal mask vs stack restore with siglongjmp too.
PR lib/57946
longjmp(3) t_sigstack: Print which entry failed.
PR lib/57946
longjmp(3) t_sigstack: Note aarch64 seems to DTRT.
But only by code inspection; it appears to have another problem: on
re-entry, the signal handler is called on the normal stack, not on
the alternate signal stack.
PR lib/57946
longjmp(3) t_sigstack: Use a sigaltstack per handler entry.
longjmp evidently doesn't reset the state of whether the process is
executing on the alternate signal stack. So when we re-enter the
signal handler, the alternate stack appears to be still in use, and
the system chooses the original stack for the second call to the
signal handler -- which trips our assertion asking to verify that the
signal handler is always using an alternate stack.
Not strictly necessary for the signal handler to use an alternate
stack on re-entry, but this makes it clearer that the signal handler
itself is always using the alternate stack so we can verify that the
interrupted code is _not_ in the signal handler.
With this change, the test now passes on aarch64.
PR lib/57946
longjmp(3) t_sigstack: Fix fencepost error.
Extremely unlikely to cause trouble, but let's just turn that into
`never' to keep it easier for readers.
PR lib/57946
amd64 longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.
While here:
- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use `xorl %eXX,%eXX' instead of `xorq %rXX,%rXX'.
=> Same effect, one byte shorter, breaks dep chain on more uarches.
- Use forward branches for statically predicted not-taken.
=> val==0 is unlikely in longjmp
PR lib/57946
i386 longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.
While here:
- Tidy the code a little bit.
- Sprinkle comments to explain what's going on.
- Use forward branches for statically predicted not-taken.
=> val==0 is unlikely in longjmp
PR lib/57946
arm longjmp: Restore stack first, then signal mask.
Otherwise, a pending signal may be delivered on the wrong stack when
we restore the signal mask.
While here:
- Move the botched sp and lr tests earlier.
PR lib/57946
arm has been fixed
tests/lib/libc/setjmp/t_sigstack: Add missing comment for 1.10.
PR lib/57946
sh3: siglongjmp - restore register context first (PR lib/57946)
To generate a diff of this commit:
cvs rdiff -u -r1.394.2.6 -r1.394.2.7 src/distrib/sets/lists/debug/mi
cvs rdiff -u -r1.1238.2.6 -r1.1238.2.7 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.18 -r1.18.2.1 src/lib/libc/arch/arm/gen/setjmp.S
cvs rdiff -u -r1.17 -r1.17.34.1 src/lib/libc/arch/i386/gen/setjmp.S
cvs rdiff -u -r1.18 -r1.18.34.1 src/lib/libc/arch/i386/gen/sigsetjmp.S
cvs rdiff -u -r1.10 -r1.10.96.1 src/lib/libc/arch/sh3/gen/setjmp.S
cvs rdiff -u -r1.9 -r1.9.96.1 src/lib/libc/arch/sh3/gen/sigsetjmp.S
cvs rdiff -u -r1.3 -r1.3.34.1 src/lib/libc/arch/x86_64/gen/__setjmp14.S \
src/lib/libc/arch/x86_64/gen/__sigsetjmp14.S
cvs rdiff -u -r1.2 -r1.2.54.1 src/tests/lib/libc/setjmp/Makefile
cvs rdiff -u -r0 -r1.12.2.2 src/tests/lib/libc/setjmp/t_sigstack.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Home |
Main Index |
Thread Index |
Old Index