From: yamataka@...08.itscom.net Date: 2019-08-08T14:35:09+00:00 Subject: [ruby-core:94200] [Ruby master Bug#16087] Signal.trap(:INT) doesn't work on msys2 mingw64 ? Issue #16087 has been reported by roswell (Takahiro Yamaguchi). ---------------------------------------- Bug #16087: Signal.trap(:INT) doesn't work on msys2 mingw64 ? https://bugs.ruby-lang.org/issues/16087 * Author: roswell (Takahiro Yamaguchi) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.6.3p62 (2019-04-16 revision 67580) [x64-mingw32] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- My environment is Windows 10 msys2 mingw64 ``` yama@JPC00183513 ~/b/p/sample> uname -a MINGW64_NT-10.0-17763 JPC00183513 3.0.7-338.x86_64 2019-05-27 06:58 UTC x86_64 Msys yama@JPC00183513 ~/b/p/sample> ruby --version ruby 2.6.3p62 (2019-04-16 revision 67580) [x64-mingw32] ``` My script is ``` yama@JPC00183513 ~/b/p/sample> cat signal.rb # coding: utf-8 $stdout.sync = true p Signal.list # EXIT mignw fail # INT w pass mingw fail # QUIT mingw unsupported signal `SIGQUIT' (ArgumentError) # ILL mingw can't trap reserved signal: SIGILL (ArgumentError) # ABRT mingw fail # FPE mingw can't trap reserved signal: SIGFPE (ArgumentError) # KILL mingw Invalid argument - SIGKILL (Errno::EINVAL) # TERM mingw fail Signal.trap(:INT) { puts "������������" puts "������������" puts "������������" exit } while true puts "���������" sleep 3 end ``` Execute the above script, then type C-c to interrupt it ``` yama@JPC00183513 ~/b/p/sample> ruby signal.rb {"EXIT"=>0, "INT"=>2, "ILL"=>4, "ABRT"=>22, "FPE"=>8, "KILL"=>9, "SEGV"=>11, "TERM"=>15} ��������� ��������� yama@JPC00183513 ~/b/p/sample> ``` The "Signal.trap(:INT)" block is NOT executed. I assume the ruby msys2 mingw64 have a bug around Signal handling. -- https://bugs.ruby-lang.org/ Unsubscribe: