BusyBox Bug and Patch Tracking
BusyBox
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001165 [BusyBox] Other minor always 01-18-07 12:30 02-13-08 10:11
Reporter adrianh View Status public  
Assigned To BusyBox
Priority normal Resolution fixed  
Status closed   Product Version 1.1.x
Summary 0001165: bug in busybox sh version 1.1.2 and would like to know if it has been resolved in the latest version
Description A signal will be caught once, but any signal following will not be captured. This can be seen by doing the following:

In BusyBox, make a file sleepTest.sh :
#!/bin/sh
sleeping=true
trap "echo got signal" USR1
for try in 1 2 3 4 5; do sleep 1; kill -USR1 $$; echo sent $try signal; done&
sleep 10&
while $sleeping; do
        trap
        if wait %%; then
                echo sleep completed;
                sleeping=false;
        elif [ $? == 127 ]; then
                echo no sleep tonite;
                sleeping=false;
        else
                echo sleep interrupted;
        fi
done
#--- end of file ---

Make it executable and then execute it.

BusyBox 1.1.2 gave the following:
sent 1 signal
got signal
sleep interrupted
sent 2 signal
sent 3 signal
sent 4 signal
sent 5 signal
sleep completed

Correct result:
sent 1 signal
got signal
sleep interrupted
got signal
sent 2 signal
sleep interrupted
got signal
sleep interrupted
sent 3 signal
got signal
sleep interrupted
sent 4 signal
got signal
sent 5 signal
sleep interrupted
sleep completed

I've tried this on other Linux systems with success. And it would make sense, as one writing a signal handling shell script would probably want more than one signal to be captured.
Additional Information
Attached Files

- Relationships

- Notes
(0004564)
vda
02-13-08 10:11

Fixed in svn. Your example is used for a testcase. Thanks!
 

- Issue History
Date Modified Username Field Change
01-18-07 12:30 adrianh New Issue
01-18-07 12:30 adrianh Status new => assigned
01-18-07 12:30 adrianh Assigned To  => BusyBox
02-13-08 10:11 vda Status assigned => closed
02-13-08 10:11 vda Note Added: 0004564
02-13-08 10:11 vda Resolution open => fixed


Copyright © 2000 - 2006 Mantis Group
Powered by Mantis Bugtracker