[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: reboot from init script doesn't work with busybox-1.26.2
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2018-01-09 16:38:48
Message-ID: CAK1hOcPpE9=z6pU9vzL5gDe6OJg3_fvryhsp89YhQvuK_P3Ryw () mail ! gmail ! com
[Download RAW message or body]

On Wed, Dec 13, 2017 at 6:50 PM, Ankur Tank
<Ankur.Tank@lnttechservices.com> wrote:
> Hello,
>
>
> We have Beaglebone black based custom board,
>
>
> Recently we upgraded busybox from version 1.20.2 to 1.26.2.
> We are facing a issue where reboot(as mentioned below) from init scripts
> doesn't seem to work.
> In case of critical errors during initscript execution we used to reboot the
> board. Now reboot doesn't seem to work however reboot -f works but that
> doesn't run stop scripts to do cleanup.
>
> reboot_and_hang()
> {
>      reboot
>      while [ true ]
>      do
>           sleep 1
>      done
> }
>
> From Stakeoverflow I got redirected to below patch/commit
> https://git.busybox.net/busybox/commit/init/init.c?id=2bba9ad67a917de2624d427c8c107ce3e2d3d085
>
> I got to know that reboots are not allowed during init.
>
> However for our use case we need that.
>
> I have some queries regarding that.
> 1. Patch says it is racy wrt syslog and libc function, so what kind of
> scenario it will be racy , if you can point me to bug/documentation related
> to that. I wanted to get more understanding about it.

Sorry for the late reply.

Before that commit, halt_reboot_pwoff() was installed as a signal handler.
It calls run_shutdown_and_kill_processes(), which indirectly calls
printf-like functions, vfork(), etc.

If signal is received in the middle for something like printf(), malloc(),
syslog(), etc, recursive calls into them can cause all kinds of horrible things
(such as infinite loops or crashes).
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic