Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: JRuby 0.9.8
    • Component/s: None
    • Labels:
      None
    • Environment:
      JRuby-trunk, Linux
    • Number of attachments :
      1

      Description

      Try to run following snippet with Ruby and then JRuby. With JRuby you will get attached NPE.

      set_trace_func( lambda { |event, file, line, id, binding, classname|
        printf "%s, %s:%s, %s, %s\n", event, file, line, id, classname
      })
      
      a = 1 # OK
      sleep(1) # fails
      
      1. NPE.txt
        2 kB
        Martin Krauskopf

        Activity

        Hide
        Thomas E Enebo added a comment -

        I landed a fix for this earlier today....Here were the commit comments:

        The test case provided the proper line number with this change and more importantly it did not NPE. If this ends up generating bad line numbers please create a follow up issue.

        [Problem occurred with the introduction of fast method calls. Fast method calls do not create a Frame and now we cannot rely on getPreviousFrame existing anymore]

        Show
        Thomas E Enebo added a comment - I landed a fix for this earlier today....Here were the commit comments: The test case provided the proper line number with this change and more importantly it did not NPE. If this ends up generating bad line numbers please create a follow up issue. [Problem occurred with the introduction of fast method calls. Fast method calls do not create a Frame and now we cannot rely on getPreviousFrame existing anymore]
        Hide
        Martin Krauskopf added a comment -

        Probably the same needs to be fixed also in 'SimpleInvocationMethod', maybe others[1]. Try to change:

        a = 1 # OK
        sleep(1) # fails
        

        to

        puts
        

        And you will get similar NPE.

        [1]

        $ cd ....jruby-svn/jruby/src
        $ grep -rl 'runtime.callTraceFunction.*c-call' * | egrep -v '/\.svn/|SimpleCallbackMethod'
        org/jruby/internal/runtime/methods/SimpleInvocationMethod.java
        org/jruby/internal/runtime/methods/FullFunctionCallbackMethod.java
        org/jruby/internal/runtime/methods/FullInvocationMethod.java
        org/jruby/internal/runtime/methods/CompiledMethod.java
        
        Show
        Martin Krauskopf added a comment - Probably the same needs to be fixed also in 'SimpleInvocationMethod', maybe others [1] . Try to change: a = 1 # OK sleep(1) # fails to puts And you will get similar NPE. [1] $ cd ....jruby-svn/jruby/src $ grep -rl 'runtime.callTraceFunction.*c-call' * | egrep -v '/\.svn/|SimpleCallbackMethod' org/jruby/internal/runtime/methods/SimpleInvocationMethod.java org/jruby/internal/runtime/methods/FullFunctionCallbackMethod.java org/jruby/internal/runtime/methods/FullInvocationMethod.java org/jruby/internal/runtime/methods/CompiledMethod.java
        Hide
        Thomas E Enebo added a comment -

        I used getPosition so the top-level method calls will no longer NPE. Any test cases you provide for testing will be helpful as we refactor the interpreter since we can use those test cases to mae sure we get positioning right.

        Show
        Thomas E Enebo added a comment - I used getPosition so the top-level method calls will no longer NPE. Any test cases you provide for testing will be helpful as we refactor the interpreter since we can use those test cases to mae sure we get positioning right.

          People

          • Assignee:
            Thomas E Enebo
            Reporter:
            Martin Krauskopf
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: