bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re[7]: Subshell exit trap is not invoked if shell exit trap also set


From: Al Payne
Subject: Re: Re[7]: Subshell exit trap is not invoked if shell exit trap also set
Date: Tue, 26 Mar 2019 15:55:35 -0400

Konstantin,

I also tried to replicate on CentOS (under Fusion), but get the two
expected trap messages when killing the internal process:

    ext pid=25449
    int pid=25450
    int exit trap in 25450
    subshell done
    ext exit trap in 25449

Test install:
- CentOS Linux release 7.2.1511 (Core) [under VMware Fusion]
- kernel-3.10.0-327.el7.x86_64; glibc 2.17
- GNU bash, version 5.0.3(1)-release

Al

On Tue, Mar 26, 2019 at 3:24 PM Konstantin Andreev <andreev@swemel.ru>
wrote:

> As you decide.
>
> Debian (working), subshell syscall trace on receiving sigterm:
>
> | $ strace -p 1436
> | strace: Process 1436 attached
> | wait4(-1, 0x7ffd49d66b90, 0, NULL)      = ? ERESTARTSYS (To be restarted
> if SA_RESTART is set)
> | --- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=1461,
> si_uid=1000} ---
> | rt_sigreturn({mask=[CHLD]})             = -1 EINTR (Interrupted system
> call)
> | rt_sigprocmask(SIG_BLOCK, NULL, [CHLD], 8) = 0
> | getpid()                                = 1436
> | write(1, "int exit trap in 1436\n", 22) = 22
> | rt_sigaction(SIGTERM, {sa_handler=SIG_DFL, sa_mask=[],
> sa_flags=SA_RESTORER, sa_restorer=0x7f3bbdc8b940},
> {sa_handler=0x5644f7bf6f40, sa_mask=[HUP INT ILL TRAP ABRT BUS FPE USR1
> SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], sa_flags=SA_RESTORER,
> sa_restorer=0x7f3bbdc8b940}, 8) = 0
> | getpid()                                = 1436
> | kill(1436, SIGTERM)                     = 0
> | --- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=1436,
> si_uid=1000} ---
> | +++ killed by SIGTERM +++
>
> Centos (not working):
>
> | $ strace -p 90700
> | Process 90700 attached
> | wait4(-1, 0x7ffd77995430, 0, NULL)      = ? ERESTARTSYS (To be restarted
> if SA_RESTART is set)
> | --- SIGTERM {si_signo=SIGTERM, si_code=SI_USER, si_pid=90617,
> si_uid=1000} ---
> | +++ killed by SIGTERM +++
>
> Regards, Konstantin.
>
> Chet Ramey, 26 Mar 2019 21:16 MSK:
> >
> > Run a system call tracer, I suppose. That will tell you the order in
> which things happen when the processes are traced, at least.
> >
> > Chet
>
> Konstantin Andreev, 26 Mar 2019 19:44 MSK:
> >
> > bash-5.0.3,
> > Just built and tested it. The systems are x86-64.
> >
> > + Debian GNU/Linux buster/sid (pre-10): works (both exit traps are
> invoked)
> > - CentOS Linux 7.2.1511:            NOT work (subshell exit trap is NOT
> invoked)
> > - Oracle Solaris 11.3:              NOT work (subshell exit trap is NOT
> invoked)
> >
> > What can I do to help you isolate this issue?
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]