This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/20375] posix_spawn fails when full signal set passed to posix_spawnattr_setsigdefault and POSIX_SPAWN_SETSIGDEF is set


https://sourceware.org/bugzilla/show_bug.cgi?id=20375

Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adhemerval.zanella at linaro dot o
                   |                            |rg

--- Comment #2 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
I can reproduce it on ubuntu 16.04 (glibc 2.23), but I can't on master:

glibc-git-build-m64$ gcc -Wall test.c -o test -D_GNU_SOURCE 
glibc-git-build-m64$ ./test
Run command: (null)
Child pid: 21213
Child exited with status 32512
glibc-git-build-m64$ ./testrun.sh ./test
Run command: (null)
Child pid: 21218
Makefile                         cpu-features-offsets.h.d  libBrokenLocale.map 
libnsl.map            lowlevelrobustlock.h.d  runtime-linker.stamp    
sysd-syscalls
Versions.all                     crypt                     libanl.map          
libnss_compat.map     lowlevelrwlock.h        setjmp                  
sysd-versions
Versions.def                     cstdlib                   libc-abis.h         
libnss_db.map         lowlevelrwlock.h.d      shadow                   sysvipc
Versions.tmp                     csu                       libc-abis.stamp     
libnss_dns.map        malloc                  shlib-versions.v        
tcb-offsets.h
Versions.v                       ctype                     libc-modules.h      
libnss_files.map      manual                  shlib-versions.v.i      
tcb-offsets.h.d
Versions.v.i                     debug                     libc-modules.stmp   
libnss_hesiod.map     math                    shlib.lds                termios
abi-versions.h                   dirent                    libc.a              
libnss_nis.map        mathvec                 sigaltstack-offsets.h    test
argp                             dlfcn                     libc.map            
libnss_nisplus.map    misc                    sigaltstack-offsets.h.d  test.c
assert                           dummy.c                   libc.so             
libpthread.map        nis                     signal                   test.c~
begin-end-check.out              dummy.o                   libc.so.6           
libresolv.map         nptl                    socket                  
testrun.sh
begin-end-check.test-result      dummy.o.dt                libc.so.dyn         
librt.map             nptl_db                 soversions.i            
tests.sum
bits                             elf                       libc.so.jmprel      
libthread_db.map      nscd                    soversions.mk            time
c++-types-check.out              gmon                      libc.so.phdr        
libutil.map           nss                     stamp.o                  timezone
c++-types-check.test-result      gnu                       libc.symlist        
link-defines.h        po                      stamp.oS                
tlsdesc.h
catgets                          gnulib                    libc_nonshared.a    
link-defines.h.d      posix                   stamp.os                
tlsdesc.h.d
check-local-headers.out          grp                       libc_pic.a          
linkobj               pthread-errnos.h        stdio-common            
ucontext_i.h
check-local-headers.test-result  gshadow                   libc_pic.os         
locale                pthread-errnos.h.d      stdlib                  
ucontext_i.h.d
cmath                            hesiod                    libcidn.map         
locale-defines.h      pthread-pi-defines.h    strace.log              
unwindbuf.h
config.h                         iconv                     libcrypt.map        
locale-defines.h.d    pthread-pi-defines.h.d  streams                 
unwindbuf.h.d
config.log                       iconvdata                 libdl.map           
localedata            pwd                     string                   wcsmbs
config.make                      inet                      libidn              
login                 resolv                  subdir-tests.sum         wctype
config.status                    intl                      libio               
lowlevelcond.h        resource                sunrpc
conform                          io                        libm.map            
lowlevelcond.h.d      rt                      sysd-rules
cpu-features-offsets.h           ld.map                    libmvec.map         
lowlevelrobustlock.h  runtime-linker.h        sysd-sorted
Child exited with status 0


Also, I am trying to understand why a __libc_sigaction call with SIGKILL can
possible kill this program, since the return of call for POSIX_SPAWN_SETSIGDEF
is not check on spawni function:

142   sigset_t hset;
143   __sigprocmask (SIG_BLOCK, 0, &hset);
144   for (int sig = 1; sig < _NSIG; ++sig)
145     {
146       if ((attr->__flags & POSIX_SPAWN_SETSIGDEF)
147           && sigismember (&attr->__sd, sig))
148         {
149           sa.sa_handler = SIG_DFL;
150         }
151       else if (sigismember (&hset, sig))
152         {
153           if (__nptl_is_internal_signal (sig))
154             sa.sa_handler = SIG_IGN;
155           else
156             {
157               __libc_sigaction (sig, 0, &sa);
158               if (sa.sa_handler == SIG_IGN)
159                 continue;
160               sa.sa_handler = SIG_DFL;
161             }
162         }
163       else
164         continue;
165 
166       __libc_sigaction (sig, &sa, 0);
167     }

Setting SIGKILL or SIGSTOP should not cause this to fail.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]