[Bug #1952] cannot stop with Ctrl+C

Bug #1952: cannot stop with Ctrl+C
http://redmine.ruby-lang.org/issues/show/1952

e$B5/I<<Te(B: Usaku NAKAMURA
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
e$B%+%F%4%je(B: core, Target version: 1.9.x
ruby -v: ruby 1.9.2dev (2009-08-17 trunk 24569) [i386-netbsdelf]

e$B0J2<$N%9%/%j%W%H$,e(BCtrl+Ce$B$GDd;_$;$:!"e(BCtrl+Ce$B2!2<8e$Oe(Bkill
-9e$B$G$7$+;&$;$^$;$s!#e(B

Thread.new do
begin
begin
sleep
ensure
raise
end
rescue
retry
end
end.join

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:39107] [Bug #1952] cannot stop with Ctrl+C”
on Aug.18,2009 23:50:32, [email protected] wrote:

e$B0J2<$N%9%/%j%W%H$,e(BCtrl+Ce$B$GDd;_$;$:!"e(BCtrl+Ce$B2!2<8e$Oe(Bkill -9e$B$G$7$+;&$;$^$;$s!#e(B

e$BD4::$r?J$a$F$_$^$7$?!#e(B

e$BEv=i$Oe(Bpthreade$B$J4D6-0MB8$+$H;W$C$F$$$^$7$?$,!"e(Bmswin32e$B$G$bF1$8e(B
e$B8=>]$,5/$-$^$7$?!#e(B
[email protected]$H!"e(B1e$B2sL$Ne(BCtrl+Ce$B$G$ODd;_$;$:!"e(B2e$B2sL$Ne(BCtrl+Ce$B$G;`$K$^$9!#e(B

e$B$H$j$"$($:e(Btrunke$B%Y!<%9$G8=>]$rD/$a$F$_$k$H!"e(B

(1)
Ctrl+Ce$B2!2<;[email protected]$Ge(Bmaine$B%9%l%C%I$He(BThread.newe$B$5$l$?%9%l%C%Ie(B
e$BN>J}$,e(BTHREAD_TO_KILLe$B$H$J$k!#e(B

(2)
maine$B%9%l%C%I$Oe(BTAG_FATALe$B$Ge(Brb_longjmp()e$B$5$l$?8e!"B>$N%9%le(B
e$B%C%I$N;`K4BT$A%k!<%W$KF~$k!#e(B

(3)
Thread.newe$B$5$l$?%9%l%C%I$NJ}$Oe(BTAG_FATALe$B$Ge(Brb_longjmp()e$B$5e(B
e$B$l!“e(Bsleepe$B$,CfCG$5$l$k!#e(B
e$B$=$3$GFbB&$Ne(Bbegine$B!Ae(Bende$BFb$Ne([email protected]$KF~$k$N$Ge(Braisee$B$,<B9Te(B
e$B$5$l$k!#e(B
e$B:#EY$O30B&$Ne(Bbegine$B!Ae(Bende$BFb$Ne([email protected]$KF~$j!“e(Bretrye$B$,<B9T$5e(B
e$B$l$k!#e(B
e$B0J>e$N2aDx$G!”$=$b$=$be([email protected]$C$?$3$H$,K:$l5n$i$l$Fe(B
e$B$7$^$$!”:F$Se(Bsleepe$B$,<B9T$5$l$k!#e(B

(4)
Thread.newe$B$5$l$?%9%l%C%I$,e(Bsleepe$B$G?2$?$-$j$J$N$G!"e(Bmaine$B%9e(B
e$B%l%C%I$O1d!9$H;`K4BT$A%k!<%W$rB3$1$k!#e(B
e$B:FEYe(BCtrl+Ce$B$r2!$7$F$b!"e(B(3)e$B$,[email protected]$1!#e(B

e$B$H$$$&$3$H$K$J$C$F$k$h$&$G$9!#e(B
e$B$*$=$i$/!"e(B(3)e$B$Ne(BTAG_FATALe$B$,K:$l5n$i$l$k$N$,LdBj$G!"30B&$Ne(Brescue
[email protected]$KF~$i$J$$$h$&$K$7$J$$$H$$$1$J$$$N$G$O$J$$$+$H;W$$$^$9!#e(B
[email protected]$Ge(Braisee$B$9$k$H$-!"8=:_e([email protected]$C$?$ie(BTAG_RAISEe$B$G$J$/e(B
TAG_FATALe$B$GHt$V$Y$-$J$s$G$7$g$&$+$M$(!#Fq$7$$!#e(B

e$B$=$l$G$O!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:39126] Re: [Bug #1952] cannot stop with
Ctrl+C”
on Wed, 19 Aug 2009 15:47:18 +0900, “U.Nakamura”
[email protected] writes:

|e$B$*$=$i$/!"e(B(3)e$B$Ne(BTAG_FATALe$B$,K:$l5n$i$l$k$N$,LdBj$G!"30B&$Ne(Brescue
|[email protected]$KF~$i$J$$$h$&$K$7$J$$$H$$$1$J$$$N$G$O$J$$$+$H;W$$$^$9!#e(B
|[email protected]$Ge(Braisee$B$9$k$H$-!"8=:_e([email protected]$C$?$ie(BTAG_RAISEe$B$G$J$/e(B
|TAG_FATALe$B$GHt$V$Y$-$J$s$G$7$g$&$+$M$(!#Fq$7$$!#e(B

e$B$&!<$s!“e(Bensuree$B$Ge(Braisee$B$7$?$j!”$=$N30$Ge(Brescuee$B$Ge(Bretrye$B$7$?$j$7$Fe(B
e$B$$$k$o$1$G$9$+$i!"L58B%k!<%W$=$N$b$N$O!V0U?^DL$j!W$J$N$G$O$Je(B
e$B$$$G$7$g$&$+!#$`$7$m!"e(Braisee$B$,e(BTAG_FAGALe$B$GHt$VJ}$,5$;}$A$,0-$$e(B
e$B$G$9!#e(B

e$B$3$l$Oe(Bmain
threade$B$,B>%9%l%C%IBT$A$N4V$K3d$j9~$_$,8z$+$J$$J}$re(B
e$BD>$9$Y$-$G$O$J$$$G$7$g$&$+!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:39128] Re: [Bug #1952] cannot stop with
Ctrl+C”
on Wed, 19 Aug 2009 16:35:56 +0900, “U.Nakamura”
[email protected] writes:

|In message “[ruby-dev:39127] Re: [Bug #1952] cannot stop with Ctrl+C”
| on Aug.19,2009 16:00:28, [email protected] wrote:
|> e$B$&!<$s!“e(Bensuree$B$Ge(Braisee$B$7$?$j!”$=$N30$Ge(Brescuee$B$Ge(Bretrye$B$7$?$j$7$Fe(B
|> e$B$$$k$o$1$G$9$+$i!"L58B%k!<%W$=$N$b$N$O!V0U?^DL$j!W$J$N$G$O$Je(B
|> e$B$$$G$7$g$&$+!#$`$7$m!“e(Braisee$B$,e(BTAG_FAGALe$B$GHt$VJ}$,5$;}$A$,0-$$e(B
|> e$B$G$9!#e(B
|
|e$B;d$H$7$F$Oe(BTAG_FATALe$B$,0.$j$D$V$72DG=$G$”$k$3$H$NJ}$,5$;}$A$,0-e(B
|e$B$$$G$9!#e(B

e$B$3$l$J$s$G$9$,!"$=$b$=$b$J$<e(BInterrupte$B$,e(BTAG_FATALe$B$J$s$G$7$g$&e(B
e$B$+!#e(B1.8e$B$G$OIaDL$Ke([email protected]$H;W$$$^$9!#$b$A$m$s!"$&$5$5$s$Ke(B
e$BJ9$$$F$b$7$g$&$,$J$$$s$G$9$,!#e(B

|e$B$D$^$j!"$$$+$J$kJ}K!$Ge([email protected]$,=*N;$7$?>l9ge(B([email protected]$m$&$,e(Breturn
|[email protected]$m$&$,e(Bende$BE~C#[email protected]$m$&$,e(B)e$B$b!“e(BTAG_FATALe$B$H$7$F$N=hM}$rB39T$9$Y$-e(B
|e$B$G$O$J$$$+!”$H$$$&$3$H$G$9!#e(B
|e$B;d$N85$NJ8LL$,$h$/$"$j$^$;$s$G$7$?$,!“e(BTAG_RAISEe$B$G$J$$e(BTAG_FATAL
|e$B$JNc30$rH/@8$5$;$k!”$H$$$&0U?^$O$"$j$^$;$s!#e(B
|
|e$B$3$&$$$&[email protected]$$J}[email protected]$H!V5$;}$A$,0-!W$/$J$/$J$k$G$7$g$&$+e(B?
|e$B$=$l$H$b!"!V0U?^DL$j!W$N$O$:$NL58B%k!<%W$,CfCG$5$l$k$3$H$,!Ve(B
|e$B5$;}$A$,0-$$!W$N$G$7$g$&$+e(B?

e$B;d$N46A[$Oe(B

  • C-ce$B$Ge(BTAG_FATALe$B$,H/@8$9$k8=>u$,5$;}$A0-$$e(B

  • ensure + raise e$B$GNc30$r0.$jDY$9$3$H$,$G$-$k$N$O0JA0$+$ie(B
    e$BCN$i$l$F$$$?$3$H$G$"$j!"$=$l$r$G$-$J$/$9$kI,[email protected]$,$o$+$ie(B
    e$B$J$$e(B

e$B$H$$$&$3$H$G$9!#$5$i$Ke(B

  • kill -9e$B$rI,MW$H$9$k$N$OLdBj$G$"$k!#$N$G!"e(Bmain threade$B$O3de(B
    e$B$j9~$_2DG=$K$7$F$*$/$Y$-e(B

  • C-ce$B$Ge(BTAG_RAISEe$B$G$"$k$Y$-e(B([email protected]$H;W$&e(B)

  • C-ce$B$N$3$H$OJL$K$7$F!"$&$5$5$s$,$*$C$7$c$k$h$&$Ke(BTAG_FATAL
    e$B>uBV$Ge(Bensuree$B$7$?>l9g!"$?$H$(ESCf$GDL>o$Ne(Braisee$B$,$"$C$F$b$=e(B
    e$B$l$OL5;k$7$F!“e(BTAG_FATALe$B$r7QB3$9$k$H$$$&;EMM$O==J,$”$j$($ke(B

e$B$H;W$$$^$9!#e(B

                            e$B$^$D$b$He(B e$B$f$-$R$me(B /:|)

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:39129] Re: [Bug #1952] cannot stop with Ctrl+C”
on Aug.19,2009 17:06:30, [email protected] wrote:

e$B$3$l$J$s$G$9$,!"$=$b$=$b$J$<e(BInterrupte$B$,e(BTAG_FATALe$B$J$s$G$7$g$&e(B
e$B$+!#e(B1.8e$B$G$OIaDL$Ke([email protected]$H;W$$$^$9!#$b$A$m$s!"$&$5$5$s$Ke(B
e$BJ9$$$F$b$7$g$&$,$J$$$s$G$9$,!#e(B

e$B$"$l!"$H;W$C$FDI$$D>$7$F$_$?$H$3$m!"e(BTAG_FATALe$B$Oe(Bvm_exec()e$B$NCfe(B
e$B$G>C?T$5$l$F$$$F!"e(Beval.ce$BFb$K$Oe(BTAG_RAISEe$B$G=hM}$5$l$F$$$^$7$?!#e(B

e$B$9$_$^$;$se(B…

e$B$H$$$&$o$1$G!"e(B

  • kill -9e$B$rI,MW$H$9$k$N$OLdBj$G$"$k!#$N$G!"e(Bmain threade$B$O3de(B
    e$B$j9~$_2DG=$K$7$F$*$/$Y$-e(B

e$B$H$j$"$($:$3$l$G$9$M!#e(B
e$B$A$J$_$K!"e(Bthread.c:320e$B$Ne(B/* ignore exception
*/e$B$N$H$3$m$K$J$je(B
e$B$^$9!#e(B

  • C-ce$B$N$3$H$OJL$K$7$F!"$&$5$5$s$,$*$C$7$c$k$h$&$Ke(BTAG_FATAL
    e$B>uBV$Ge(Bensuree$B$7$?>l9g!"$?$H$(ESCf$GDL>o$Ne(Braisee$B$,$"$C$F$b$=e(B
    e$B$l$OL5;k$7$F!“e(BTAG_FATALe$B$r7QB3$9$k$H$$$&;EMM$O==J,$”$j$($ke(B

e$B$3$l$O$=$N$&$Ae(BTAG_FATALe$B$r5/$3$9J}K!$r9M$($F8&5f$7$F$_$^$9!#e(B

e$B$=$l$G$O!#e(B

e$B%A%1%C%He(B #1952 e$B$,99?7$5$l$^$7$?!#e(B (by Yukihiro M.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

Applied in changeset r24591.

http://redmine.ruby-lang.org/issues/show/1952

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:39127] Re: [Bug #1952] cannot stop with Ctrl+C”
on Aug.19,2009 16:00:28, [email protected] wrote:

e$B$&!<$s!“e(Bensuree$B$Ge(Braisee$B$7$?$j!”$=$N30$Ge(Brescuee$B$Ge(Bretrye$B$7$?$j$7$Fe(B
e$B$$$k$o$1$G$9$+$i!"L58B%k!<%W$=$N$b$N$O!V0U?^DL$j!W$J$N$G$O$Je(B
e$B$$$G$7$g$&$+!#$`$7$m!"e(Braisee$B$,e(BTAG_FAGALe$B$GHt$VJ}$,5$;}$A$,0-$$e(B
e$B$G$9!#e(B

e$B;d$H$7$F$Oe(BTAG_FATALe$B$,0.$j$D$V$72DG=$G$"$k$3$H$NJ}$,5$;}$A$,0-e(B
e$B$$$G$9!#e(B
e$B$D$^$j!"$$$+$J$kJ}K!$Ge([email protected]$,=*N;$7$?>l9ge(B([email protected]$m$&$,e(Breturn
[email protected]$m$&$,e(Bende$BE~C#[email protected]$m$&$,e(B)e$B$b!“e(BTAG_FATALe$B$H$7$F$N=hM}$rB39T$9$Y$-e(B
e$B$G$O$J$$$+!”$H$$$&$3$H$G$9!#e(B
e$B;d$N85$NJ8LL$,$h$/$"$j$^$;$s$G$7$?$,!“e(BTAG_RAISEe$B$G$J$$e(BTAG_FATAL
e$B$JNc30$rH/@8$5$;$k!”$H$$$&0U?^$O$"$j$^$;$s!#e(B

e$B$3$&$$$&[email protected]$$J}[email protected]$H!V5$;}$A$,0-!W$/$J$/$J$k$G$7$g$&$+e(B?
e$B$=$l$H$b!"!V0U?^DL$j!W$N$O$:$NL58B%k!<%W$,CfCG$5$l$k$3$H$,!Ve(B
e$B5$;}$A$,0-$$!W$N$G$7$g$&$+e(B?

e$B$3$l$Oe(Bmain threade$B$,B>%9%l%C%IBT$A$N4V$K3d$j9~$_$,8z$+$J$$J}$re(B
e$BD>$9$Y$-$G$O$J$$$G$7$g$&$+!#e(B

e$B$=$l$Ge(B1.8e$B$HF1$8e(B(2e$B2se(BCtrl+Ce$B$G%9%/%j%W%H$r=*N;$G$-$ke(B)e$B$K$O$J$j$^e(B
e$B$9$M!#e(B

e$B$=$l$G$O!#e(B

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:39131] Re: [Bug #1952] cannot stop with Ctrl+C”
on Aug.19,2009 17:49:23, [email protected] wrote:

  • kill -9e$B$rI,MW$H$9$k$N$OLdBj$G$"$k!#$N$G!"e(Bmain threade$B$O3de(B
    e$B$j9~$_2DG=$K$7$F$*$/$Y$-e(B

e$B$H$j$"$($:$3$l$G$9$M!#e(B
e$B$A$J$_$K!"e(Bthread.c:320e$B$Ne(B/* ignore exception */e$B$N$H$3$m$K$J$je(B
e$B$^$9!#e(B

e$B%Q%C%A$OMQ0U$7$F$$^$7$?$,!"$=$b$=$b$J$<$3$3$G$ONc30$rL5;k$7e(B
e$B$F$$$?$N$G$7$g$&e([email protected]$5$se(B
e$BIaDL$K9M$($k$H!"$3$3$G5/$-$&$kNc30$C$F<+?H$KBP$9$k3d$j9~$
[email protected](B
e$B$1$N$h$&$J5$$,$9$k$s$G$9$,e(B…

Index: thread.c

— thread.c (revision 24567)
+++ thread.c (working copy)
@@ -298,6 +298,7 @@ rb_thread_terminate_all(void)
{
rb_thread_t th = GET_THREAD(); / main thread */
rb_vm_t *vm = th->vm;

  • int state;
    if (vm->main_thread != th) {
    rb_bug(“rb_thread_terminate_all: called by child thread (%p, %p)”,
    (void *)vm->main_thread, (void *)th);
    @@ -311,14 +312,12 @@ rb_thread_terminate_all(void)
    thread_debug(“rb_thread_terminate_all (main thread: %p)\n”, (void
    *)th);
    st_foreach(vm->living_threads, terminate_i, (st_data_t)th);
  • while (!rb_thread_alone()) {
  • state = 0;
  • while (state == 0 && !rb_thread_alone()) {
    PUSH_TAG();
  • if (EXEC_TAG() == 0) {
  • if ((state = EXEC_TAG()) == 0) {
    rb_thread_schedule();
    }
  • else {
  •  /* ignore exception */
    
  • }
    POP_TAG();
    }
    rb_thread_stop_timer_thread();

e$B$=$l$G$O!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:39141] Re: [Bug #1952] cannot stop with
Ctrl+C”
on Thu, 20 Aug 2009 14:47:18 +0900, “U.Nakamura”
[email protected] writes:

|In message “[ruby-dev:39140] Re: [Bug #1952] cannot stop with Ctrl+C”
| on Aug.20,2009 13:22:10, [email protected] wrote:
|> e$B%Q%C%A$OMQ0U$7$F$$^$7$?$,!"$=$b$=$b$J$<$3$3$G$ONc30$rL5;k$7e(B
|> e$B$F$$$?$N$G$7$g$&e([email protected]$5$se(B
|> e$BIaDL$K9M$($k$H!"$3$3$G5/$-$&$kNc30$C$F<+?H$KBP$9$k3d$j9~$
[email protected](B
|> e$B$1$N$h$&$J5$$,$9$k$s$G$9$,e(B…
|
|e$B4{$KD>$C$F$?$N8+Mn$H$7$F$^$7$?e(B orz

e$B<[email protected][email protected]$H3N?.$G$-$l$P!"$&$5$5$s$N%Q%C%A$Ne(B
e$BJ}$,[email protected]$$$V%7%s%W%k$G$$$$$G$9$h$M$(!#$I$&$J$s$G$7$g!#e(B

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:39140] Re: [Bug #1952] cannot stop with Ctrl+C”
on Aug.20,2009 13:22:10, [email protected] wrote:

e$B%Q%C%A$OMQ0U$7$F$$^$7$?$,!"$=$b$=$b$J$<$3$3$G$ONc30$rL5;k$7e(B
e$B$F$$$?$N$G$7$g$&e([email protected]$5$se(B
e$BIaDL$K9M$($k$H!"$3$3$G5/$-$&$kNc30$C$F<+?H$KBP$9$k3d$j9~$
[email protected](B
e$B$1$N$h$&$J5$$,$9$k$s$G$9$,e(B…

e$B4{$KD>$C$F$?$N8+Mn$H$7$F$^$7$?e(B orz

e$B$=$l$G$O!#e(B

e$B%A%1%C%He(B #1952 e$B$,99?7$5$l$^$7$?!#e(B (by Yusuke E.)

e$B%9%F!<%?%9e(B Closede$B$+$ie(BOpene$B$KJQ99e(B
e$BC4Ev<Te(B Yukihiro M.e$B$K%;%C%He(B
e$BM%@hEYe(B Normale$B$+$ie(BHighe$B$KJQ99e(B

e$B1sF#$G$9!#e(B

e$B$3$N%A%1%C%H$N$?$a$Ke(B r24591 e$B$Ge(B

* thread.c (rb_thread_terminate_all): do not ignore interrupt when
  reaping threads on termination.  [ruby-dev:39107]

e$B$H$$$&JQ99$,F~$j$^$7$?$,!“e(Brb_thread_terminate_all e$B$N8e$Oe(B
main thread e$B0J30$O;`$s$G$$$k$H$$$&2>Dj$,$”$k$N$G!"Hs>o$Ke(B
e$BET9g$,0-$$$G$9!#e(B

e$B6qBNE*$K$O!“0J2<$N%3!<%I$G!”$^[email protected]@8$-$F$$$k%9%l%C%I$,$$$ke(B
e$B$N$Ke(B vm e$B$,e(B destruct e$B$5$l$F!"e(BSEGV e$B$7$^$9e(B
(e$B$?$^$Ke(B) e$B!#e(B

begin
100.times do |i|
begin
Thread.start(Thread.current) {|u| u.raise }
raise
rescue
ensure
end
end
rescue
p 100
end

e$B!V=*N;;~$K$OA4%9%l%C%I$KNc30$rEj$2!";`$L$^$GBT$D!W$H$$$&e(B
e$B;[email protected]$H9M$($k$H!"$=$NNc30$rDY$7$F$7$^$&$h$&$J%9%l%C%I$,e(B
e$B$$$l$P!"=*N;;~$K8G$^$k$N$OEvA3$G$O$J$$$G$7$g$&$+!#e(B

begin; sleep; rescue Exception; retry; end

e$B$,e(B Ctrl+C e$B$G;[email protected]$H;W$$$^$9!#e(B

e$B$H$$$&$3$H$G!“Ev3:%3%_%C%H$re(B revert e$B$7!”$3$N%A%1%C%H$Oe(B
rejected e$B$H$9$k$3$H$rDs0F$7$^$9!#e(B


Yusuke ENDOH [email protected]

http://redmine.ruby-lang.org/issues/show/1952

e$B1sF#$G$9!#e(B

2010e$BG/e(B4e$B7ne(B14e$BF|e(B10:20 U.Nakamura [email protected]:

e$B85$N:F8=%3!<%I$Oe(BCtrl+C(=Interrupt)e$B$rDY$7$F$$$^$;$s!#e(B
e$B$J$N$G!"F1$8$G$O$J$$$H;W$$$^$9!#4V0c$C$F$k$+$7$i!#e(B

e$BA4$/F1$8$G$O$J$$$G$9$,!"!V=*N;$7$m!<!W$H$$$&Nc30$rDY$7$F$$$ke(B
[email protected]$,[email protected]$H;W$$$^$9!#e(B

Interrupt e$B$K$h$C$F%a%$%s%9%l%C%I$,%W%m%;%9$N=N;=hM}$r3+;O$7!"e(B
[email protected]$-$F$$$k%5%V%9%l%C%I$Ke(B eTerminateSignal (Ruby e$B%l%Y%k$+$i$Oe(B
e$B8+$($J$$2>A[E
$JNc30e(B) e$B$rEj$2$F%5%V%9%l%C%I$rA4>C$7$7$h$&$H$7e(B
e$B$F$$$k$N$K!"%5%V%9%l%C%IB&$,$=$NNc30DY$7$F$$$k!"$H$$$&$N$,!“e(B
e$B<B:]$K5/$-$F$$$k$3$H$G$9!#e(B
e$B$=$&9M$($k$H!”$3$l$O;EMM$+$J!<$H;W$&$N$G$7$?!#e(B

e$B$H$$$&$3$H$G!“Ev3:%3%_%C%H$re(B revert e$B$7!”$3$N%A%1%C%H$Oe(B
rejected e$B$H$9$k$3$H$rDs0F$7$^$9!#e(B

SEGVe$B$O:$$C$?$b$s$J$N$G!"$3$N$3$H<+BN$KH?BP$O$7$^$;$s!#e(B

e$B$I$&$7$F$bD>$7$?$$$J$i$P!"e(B

  • e$B%5%V%9%l%C%I$N=*N;BT$A>uBV$Ge(B SIGINT e$B$r<u$1<h$C$?$i!"e(B
    eTerminateSignal e$B$r:FAw$9$ke(B

    • e$B$7$D$3$/e(B Ctrl+C e$B$r2!$7$F$$$l$P$$$D$+=*N;$G$-$k!"$+$be(B
  • eTerminateSignal e$B$rJaB*$G$-$J$$Nc30$H$9$ke(B

    • e$B%5%V%9%l%C%I$Ne(B ensure e$B$,<B9T$5$l$J$$e(B
  • eTerminateSignal e$B$rEj$2$F?tIC$7$F$b=$o$C$F$/$l$J$$>l9g!"e(B
    e$BJaB
    $G$-$J$$Nc30$rEj$2$ke(B

    • e$B%5%V%9%l%C%I$Ne(B ensure e$B$,<B9T$5$l$J$$4m81$,4KOB$5$l$k$,e(B
      e$BK<AE*$K2r7h$O$7$J$$!#$"$H%@%5$$e(B

e$B$/$i$$$r;W$$$D$-$^$7$?$,!"$I$l$bLdBj$,$"$ke(B or e$BLLE]$G$9$M!#e(B

new feature e$B$J5$$b$9$k$N$G!"$d$k$H$7$F$be(B 1.9.3 e$B0J9_$H$$$&e(B
e$B$3$H$K$7$F!":#2s$Oe(B revert e$B$5$;$F$b$i$&$3$H$K$7$^$9!#e(B

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:40936] Bug #1952 cannot stop with Ctrl+C”
on Apr.09,2010 00:47:49, [email protected] wrote:

e$B!V=*N;;~$K$OA4%9%l%C%I$KNc30$rEj$2!";`$L$^$GBT$D!W$H$$$&e(B
e$B;[email protected]$H9M$($k$H!"$=$NNc30$rDY$7$F$7$^$&$h$&$J%9%l%C%I$,e(B
e$B$$$l$P!"=*N;;~$K8G$^$k$N$OEvA3$G$O$J$$$G$7$g$&$+!#e(B

begin; sleep; rescue Exception; retry; end

e$B$,e(B Ctrl+C e$B$G;[email protected]$H;W$$$^$9!#e(B

e$B85$N:F8=%3!<%I$Oe(BCtrl+C(=Interrupt)e$B$rDY$7$F$$$^$;$s!#e(B
e$B$J$N$G!"F1$8$G$O$J$$$H;W$$$^$9!#4V0c$C$F$k$+$7$i!#e(B

e$B$H$$$&$3$H$G!“Ev3:%3%_%C%H$re(B revert e$B$7!”$3$N%A%1%C%H$Oe(B
rejected e$B$H$9$k$3$H$rDs0F$7$^$9!#e(B

SEGVe$B$O:$$C$?$b$s$J$N$G!"$3$N$3$H<+BN$KH?BP$O$7$^$;$s!#e(B

e$B$=$l$G$O!#e(B

e$B%A%1%C%He(B #1952 e$B$,99?7$5$l$^$7$?!#e(B (by Yusuke E.)

e$B1sF#$G$9!#e(B

e$BCY$/$J$j$^$7$?$,!"0lC6e(B revert e$B$7$^$7$?!#e(B

1.9.2 e$B$O$H$j$"$($:8=>u$r;EMM$H$9$l$P$$$$$H;W$$$^$9$,!">-MhE*$Ke(B
e$B$9$C$-$j$5$;$k$J$i$P!"e(B

  • e$B=*N;;~$N%9%l%C%IA4>C$7$be(B Thread#kill e$B$be(B TAG_FATAL
    e$B$G$J$/e(B
    [email protected]$NNc30$rEj$2$ke(B

    • e$B;R%9%l%C%IB&$G%V%m%C%/$7$?>l9g$O<[email protected]$$H$9$ke(B
    • TAG_FATAL e$B<+BN!"$[$H$s$IITMW!)e(B
  • TAG_FATAL e$B$Ge(B ensure [email protected]$,8F$P$l$?;~$K:Fe(B raise
    e$B$7$?$i!"e(B
    TAG_FATAL e$B$rEj$2$ke(B

    • e$B5$;}$A0-$$$H$$$&$N$OF10U$7$^$9$,!“L50z?te(B raise e$B$OF1$8e(B
      e$BNc30$rEj$2$k$O$:$J$N$G!”@5$7$$5$$b$9$ke(B

e$B$N$$$:$l$+$,$$$$$h$&$K;W$$$^$7$?!#e(B

Feature e$B%H%i%C%+$K0\F0$7$F$*$-$^$9!#e(B


Yusuke E. [email protected]

http://redmine.ruby-lang.org/issues/show/1952

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs