[Toybox] default SIGPIPE handler that calls _exit(0)?

Rob Landley rob at landley.net
Thu Feb 16 13:46:34 PST 2017


On 02/15/2017 06:43 PM, enh wrote:
> works for me, thanks. the comment isn't quite right though. patch attached.
...
> -  // Bionic's dynamic linker adds a handler to report SIGPIPE as an error,
> -  // then doesn't want that behavior for toybox. So disable it for bionic.
> +  // Up to and including Android 6.0 (Marshmallow), bionic's dynamic linker
> +  // added a handler to cause a crash dump on SIGPIPE. That was removed in
> +  // Android 7.0 (Nougat), but Android still gets bug reports about the
> +  // regular "ps: write: broken pipe" output when someone pipes the output
> +  // of ps into head.
>    if (CFG_TOYBOX_ON_ANDROID) signal(SIGPIPE, SIG_DFL);

The new code sets it to SIG_DFL, and you said that works for you, so
where is the "regular" error message you referred to coming from?

Built against glibc:

$ ./ps -A | head
  PID TTY          TIME CMD
    1 ?        00:01:01 init
    2 ?        00:00:01 kthreadd
    3 ?        00:16:17 ksoftirqd/0
    5 ?        00:00:00 kworker/0:0H
    7 ?        05:17:42 rcu_sched
    8 ?        00:00:00 rcu_bh
    9 ?        00:00:44 migration/0
   10 ?        00:00:43 watchdog/0
   11 ?        00:00:27 watchdog/1
landley at driftwood:~/toybox/toy3$

Built against musl:

$ ./ps -A | head
  PID TTY          TIME CMD
    1 ?        00:01:01 init
    2 ?        00:00:01 kthreadd
    3 ?        00:16:17 ksoftirqd/0
    5 ?        00:00:00 kworker/0:0H
    7 ?        05:17:47 rcu_sched
    8 ?        00:00:00 rcu_bh
    9 ?        00:00:44 migration/0
   10 ?        00:00:43 watchdog/0
   11 ?        00:00:27 watchdog/1
landley at driftwood:~/toybox/toy3$

I'm not seeing this error message here?

Rob


More information about the Toybox mailing list