It is currently Sat Apr 19, 2014 6:53 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: CPU Burn-in still runs on background when user 'Ctrl+C'
PostPosted: Wed Sep 05, 2012 12:31 am 
Offline

Joined: Fri Jun 17, 2011 11:23 pm
Posts: 152
Steps to reproduce this bug:
1. Have a computer that has 2 or more CPU cores. (i.e. Test this bug on modern computers)
2. Boot UBCD 5.0.3 (UBCD 5.1 will cause a kernel panic and thus can't test.)
2. Select "CPU -> CPU Burn-in" from UBCD boot menu.
3. Wait and let cpuburn-in run for a few minutes. You should see some output like this:
Code:
20000 iterations complete.
20000 iterations complete.
25000 iterations complete.
25000 iterations complete.
30000 iterations complete.
30000 iterations complete.

4. Press Ctrl+C.

Actual result:
All of the cpuburn-in instances are still running in the background, and you are still seeing them output things.
Code:
35000 iterations complete.
35000 iterations complete.
^C
# 40000 iterations complete.
40000 iterations complete.
......


Expected result:
All instances of cpuburn-in should be terminated.

Notes:
The same problem happens when you press CTRL+\ .


Top
 Profile  
 
 Post subject: Re: CPU Burn-in still runs on background when user 'Ctrl+C'
PostPosted: Sun Oct 21, 2012 7:10 am 
Offline

Joined: Fri Jun 17, 2011 11:23 pm
Posts: 152
Ahh... I forgot to tell that I've already patched this bug in my modified CPUstress image v2.1expl3.

Patch is attached below. Basically I added two trap commands to catch the signals generated by Ctrl+C and Ctrl+\, and finally release them.
Code:
--- initrd-old/usr/local/bin/cpuburn   2012-10-21 22:49:42.458631019 +0800
+++ initrd-new/usr/local/bin/cpuburn   2012-10-21 22:53:25.106636051 +0800
@@ -23,7 +23,8 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
-# Last updated by Gert Hulselmans on 26 February 2009.
+# Last updated by Gert Hulselmans on 7 September 2012.
+# Patched by Explorer to fix a "Ctrl+C" bug and terminate cpuburn-in properly.


CPUS=`awk '/^processor/ {CPU=$3}; END {print CPU+1}' /proc/cpuinfo`
@@ -65,7 +66,9 @@
         /opt/cpuburn/cpuburn-in $time &
     done

+    trap 'pkill cpuburn-in; trap - 2 3; exit' 2 3
     read -s -n1
     pkill cpuburn-in
+    trap - 2 3
fi


Top
 Profile  
 
 Post subject: Re: CPU Burn-in still runs on background when user 'Ctrl+C'
PostPosted: Wed Oct 24, 2012 10:21 pm 
Offline

Joined: Fri Jun 17, 2011 11:23 pm
Posts: 152
2nd revision. I moved the first trap command to the place before the instances of cpuburn-in are started.

Code:
--- initrd-old/usr/local/bin/cpuburn   2012-10-25 14:20:26.628338545 +0800
+++ initrd-new/usr/local/bin/cpuburn   2012-10-25 14:17:05.000000000 +0800
@@ -23,8 +23,7 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
-# Last updated by Gert Hulselmans on 25 October 2012.
-# Patched by Explorer to fix a "Ctrl+C" bug and terminate cpuburn-in properly.
+# Last updated by Gert Hulselmans on 26 February 2009.


CPUS=`awk '/^processor/ {CPU=$3}; END {print CPU+1}' /proc/cpuinfo`
@@ -59,7 +58,6 @@
     echo
     echo 'To stop cpuburn-in, press any key.'

-    trap 'pkill cpuburn-in; trap - 2 3; exit' 2 3
     for i in `seq 1 $CPUS`; do
         echo
         echo "Starting instance $i of cpuburn-in ('cpuburn-in $time &')."
@@ -69,6 +67,5 @@

     read -s -n1
     pkill cpuburn-in
-    trap - 2 3
fi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group