On Tue, Nov 14, 2017 at 4:26 AM, Florian Weimer wrote: > On 11/14/2017 12:22 AM, H.J. Lu wrote: >> >> diff --git a/setjmp/tst-sigsetjmp2.c b/setjmp/tst-sigsetjmp2.c >> new file mode 100644 >> index 0000000000..131531feb0 >> --- /dev/null >> +++ b/setjmp/tst-sigsetjmp2.c >> @@ -0,0 +1,50 @@ >> +/* Test that sigprocmask does not read from the unused part of jmpbuf. >> + Copyright (C) 2017 Free Software Foundation, Inc. >> + This file is part of the GNU C Library. >> + >> + The GNU C Library is free software; you can redistribute it and/or >> + modify it under the terms of the GNU Lesser General Public >> + License as published by the Free Software Foundation; either >> + version 2.1 of the License, or (at your option) any later version. >> + >> + The GNU C Library is distributed in the hope that it will be useful, >> + but WITHOUT ANY WARRANTY; without even the implied warranty of >> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >> + Lesser General Public License for more details. >> + >> + You should have received a copy of the GNU Lesser General Public >> + License along with the GNU C Library; if not, see >> +. */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +static int >> +do_test (void) >> +{ >> + struct support_next_to_fault jmpbuf >> + = support_next_to_fault_allocate (SAVED_MASK_OFFSET + (_NSIG / 8)); >> + struct __jmp_buf_tag *sj = (struct __jmp_buf_tag *) jmpbuf.buffer; >> + >> + errno = 0; >> + if (sigsetjmp (sj, 1) == 0) >> + { >> + siglongjmp (sj, 1); >> + return EXIT_FAILURE; >> + } >> + if (errno != 0) >> + { >> + printf ("sigsetjmp: %s\n", strerror (errno)); >> + return EXIT_FAILURE; >> + } >> + return EXIT_SUCCESS; >> +} >> + >> +#define TEST_FUNCTION do_test () >> +#include "../test-skeleton.c" > > > Please use . Done. > Wouldn't the test start to fail if sigsetjmp/siglongjmp actually started > using the padding you are freeing up for use? You are right. > I think you need test sigprocmask directly to ensure it has the desired > property of not clobbering the padding. Here is the updated patch. OK for master? Thanks. -- H.J.