Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: JRuby 1.7.0.pre2
    • Fix Version/s: JRuby 1.7.0.RC1
    • Component/s: Core Classes/Modules
    • Labels:
      None
    • Environment:
      jruby 1.7.0.preview2 (1.9.3p203) 2012-08-07 4a6bb0a on Java HotSpot(TM) Client VM 1.7.0_05-b05 [Windows 7-x86]
    • Number of attachments :
      0

      Description

      It seems that the Signal.list is missing "KILL" on Windows:

      # MRI
      irb(main):001:0> Signal.list.keys
      => ["EXIT", "INT", "ILL", "ABRT", "FPE", "KILL", "SEGV", "TERM"]
      
      # JRuby
      irb(main):001:0> Signal.list.keys
      => ["INT", "ILL", "ABRT", "FPE", "SEGV", "TERM", "EXIT"]
      

        Activity

        Hide
        Charles Oliver Nutter added a comment -

        Our list of signals is generated from the jnr-constants library, which basically has per-platform generated code to provide constant values.

        Looking at jnr-constants, I see this in the Windows Signal constants: // SIGKILL not defined

        This should be programmatically generated based on what's available at compile time, so I'm confused why KILL doesn't show up if it's actually supposed to be there.

        Show
        Charles Oliver Nutter added a comment - Our list of signals is generated from the jnr-constants library, which basically has per-platform generated code to provide constant values. Looking at jnr-constants, I see this in the Windows Signal constants: // SIGKILL not defined This should be programmatically generated based on what's available at compile time, so I'm confused why KILL doesn't show up if it's actually supposed to be there.
        Hide
        Charles Oliver Nutter added a comment -

        jnr-constants is here: https://github.com/jnr/jnr-constants

        The logic for generating the constants is in gen/ and has templates in gen/const/. Signal.rb there basically says what .h file to load (signal.h) and has a list of signal names to attempt to generate.

        So I guess my question is whether SIGKILL is defined in signal.h on Windows. If it is, something's wrong with our generation logic. If it is not, we need some other way to get SIGKILL's value for jnr-constants.

        Show
        Charles Oliver Nutter added a comment - jnr-constants is here: https://github.com/jnr/jnr-constants The logic for generating the constants is in gen/ and has templates in gen/const/. Signal.rb there basically says what .h file to load (signal.h) and has a list of signal names to attempt to generate. So I guess my question is whether SIGKILL is defined in signal.h on Windows. If it is, something's wrong with our generation logic. If it is not, we need some other way to get SIGKILL's value for jnr-constants.
        Hide
        Daniel Berger added a comment -

        Looks like it's being hard coded in include\ruby\win32.h

        #ifndef SIGINT
        #define SIGINT 2
        #endif
        #ifndef SIGKILL
        #define SIGKILL	9
        #endif
        

        In my copy of signal.h with VC 10, SIGINT is defined but SIGKILL is not. Why? I have no idea.

        Show
        Daniel Berger added a comment - Looks like it's being hard coded in include\ruby\win32.h #ifndef SIGINT #define SIGINT 2 #endif #ifndef SIGKILL #define SIGKILL 9 #endif In my copy of signal.h with VC 10, SIGINT is defined but SIGKILL is not. Why? I have no idea.
        Hide
        Charles Oliver Nutter added a comment -

        Ok...so I think what we can do is require 'win32.h' since that seems to be the only place to get SIGKILL and SIGINT on Windows, and I will hand-define them in jnr-constants for release with JRuby 1.7RC1.

        Show
        Charles Oliver Nutter added a comment - Ok...so I think what we can do is require 'win32.h' since that seems to be the only place to get SIGKILL and SIGINT on Windows, and I will hand-define them in jnr-constants for release with JRuby 1.7RC1.
        Hide
        Charles Oliver Nutter added a comment -

        Correction....SIGINT does seem to be defined correctly already.

        Show
        Charles Oliver Nutter added a comment - Correction....SIGINT does seem to be defined correctly already.
        Hide
        Charles Oliver Nutter added a comment -

        Fixed on jnr-constants master. Still needs release with JRuby 1.7RC1.

        commit f8fa3a5f1d5ddf143875c5278e0f9bd4c4ba8b05
        Author: Charles Oliver Nutter <headius@headius.com>
        Date:   Thu Aug 23 11:49:32 2012 -0500
        
            Add win32.h and SIGKILL for Windows (JRUBY-6855)
        
        :100644 100644 564f261... 73e752d... M	gen/const/Signal.rb
        :100644 100644 897803b... 692da90... M	src/main/java/jnr/constants/platform/windows/Signal.java
        
        Show
        Charles Oliver Nutter added a comment - Fixed on jnr-constants master. Still needs release with JRuby 1.7RC1. commit f8fa3a5f1d5ddf143875c5278e0f9bd4c4ba8b05 Author: Charles Oliver Nutter <headius@headius.com> Date: Thu Aug 23 11:49:32 2012 -0500 Add win32.h and SIGKILL for Windows (JRUBY-6855) :100644 100644 564f261... 73e752d... M gen/const/Signal.rb :100644 100644 897803b... 692da90... M src/main/java/jnr/constants/platform/windows/Signal.java
        Hide
        Roger Pack added a comment -

        now if it only actually did anything with those signals, on windows, anyway...

        Show
        Roger Pack added a comment - now if it only actually did anything with those signals, on windows, anyway...
        Hide
        Roger Pack added a comment -

        Appears fixed:

        >> Signal.list['KILL']
        => 9

        with

        "jruby 1.7.0.RC1 (1.9.3p203) 2012-09-26 52678af on Java HotSpot(TM) Client VM 1.6.0_35-b10 [Windows 7-x86]"

        Show
        Roger Pack added a comment - Appears fixed: >> Signal.list ['KILL'] => 9 with "jruby 1.7.0.RC1 (1.9.3p203) 2012-09-26 52678af on Java HotSpot(TM) Client VM 1.6.0_35-b10 [Windows 7-x86] "
        Hide
        Hiro Asari added a comment -

        Thanks for the confirmation.

        Show
        Hiro Asari added a comment - Thanks for the confirmation.

          People

          • Assignee:
            Charles Oliver Nutter
            Reporter:
            Daniel Berger
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: