[BusyBox 0004324]: Busybox ASH cannot trap

bugs at busybox.net bugs at busybox.net
Sat Sep 20 16:23:42 UTC 2008


The following issue has been CLOSED 
====================================================================== 
http://busybox.net/bugs/view.php?id=4324 
====================================================================== 
Reported By:                corp186
Assigned To:                BusyBox
====================================================================== 
Project:                    BusyBox
Issue ID:                   4324
Category:                   Standards Compliance
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     closed
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             07-25-2008 10:03 PDT
Last Modified:              09-20-2008 09:23 PDT
====================================================================== 
Summary:                    Busybox ASH cannot trap
Description: 
The following script hangs up with
 kill -HUP %1
from the current shellm but not
with
 kill -HUP <processid> from another shell.

Without the trap, it does react to signals
from another shell, but of course it does not run
the signal handler.

This is a bug, right? Is there any way to make
the script handle a signla sent from another shell>


#!/bin/sh

cleanup ()
{
    echo "cleaning"
}
trap cleanup HUP

echo "sleeping "
sleep 100000
echo "done"
====================================================================== 

---------------------------------------------------------------------- 
 vda - 07-25-08 17:06  
---------------------------------------------------------------------- 
I do not see it hanging, the background process seems to be successfully
killed:

# ./ash
/.1/usr/srcdevel/bbox/fix/busybox.t1 # ./ash testcase.sh &
sleeping, pid 8809
/.1/usr/srcdevel/bbox/fix/busybox.t1 # kill -HUP %1
[1] + Done                       ./ash testcase.sh
/.1/usr/srcdevel/bbox/fix/busybox.t1 #

Can you explain more precisely your testcase? 

---------------------------------------------------------------------- 
 corp186 - 07-25-08 18:13  
---------------------------------------------------------------------- 
The test case does exit, but it obviously isn't calling the trap handler
cleanup() or it would print out "cleaning". Of course, maybe it could be
calling it but the echo isn't coming through or other some such, but one
way or another it's not working quite right. 

---------------------------------------------------------------------- 
 vda - 07-26-08 06:49  
---------------------------------------------------------------------- 
Try busybox-1.11.1-ash.patch attached to this bug. 

---------------------------------------------------------------------- 
 vda - 09-20-08 09:23  
---------------------------------------------------------------------- 
Assumed fixed (no feedback from bug submitter) 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-25-08 10:03  corp186        New Issue                                    
07-25-08 10:03  corp186        Status                   new => assigned     
07-25-08 10:03  corp186        Assigned To               => BusyBox         
07-25-08 17:06  vda            Note Added: 0009994                          
07-25-08 18:13  corp186        Note Added: 0010004                          
07-26-08 06:49  vda            File Added: busybox-1.11.1-ash.patch             
      
07-26-08 06:49  vda            Note Added: 0010014                          
09-20-08 09:23  vda            Status                   assigned => closed  
09-20-08 09:23  vda            Note Added: 0011734                          
======================================================================




More information about the busybox-cvs mailing list