help-bash
[Top][All Lists]
Advanced

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

Re: trap removement / termux issue


From: Grisha Levit
Subject: Re: trap removement / termux issue
Date: Mon, 17 Jul 2023 00:02:34 -0400

On Sun, Jul 16, 2023, 15:41 Greg Wooledge <greg@wooledge.org> wrote:

> On Sun, Jul 16, 2023 at 09:36:12PM +0200, alex xmb ratchev wrote:
> > .. ignored upon entry .. who / how defines these
>
> The parent process.  This is how everything in Unix works.
>

In this case (Android) it's not the parent, but the loading of libc.so in
Bash itself (or in any non-app process) that sets this particular signal
disposition.

Android's bionic has some "reserved" signals [1] that go between the
kernel's SIGRTMIN and a higher-numbered SIGRTMIN that signals.h defines.
One of these is BIONIC_SIGNAL_ART_PROFILER (38).

When the dynamic linker loads libc.so, it calls a function [2] that, among
other things, runs [3]:

  signal(BIONIC_SIGNAL_ART_PROFILER, SIG_IGN);

So from Bash's perspective this signal was ignored upon entry, but the
reason is that happened very early in the process init, not that the parent
set things up that way.

[1]:
https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/platform/bionic/reserved_signals.h;drc=5d3aa86cd1fe2e8b1920003b14b9a0c91153b111;l=52

[2]:
https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/bionic/libc_init_dynamic.cpp;drc=408e1700f852f4143fd741296b8bcfdf8da7861d;l=109

[3]:
https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/bionic/android_profiling_dynamic.cpp;drc=2557f73c05f256db3ffa9ac9892b13e226b6ea4c;l=72

>


reply via email to

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