Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Destination frame (0) is out of range (-1) in Ruby 2.6.6 #725

Open
stanhu opened this issue Sep 9, 2020 · 0 comments
Open

Destination frame (0) is out of range (-1) in Ruby 2.6.6 #725

stanhu opened this issue Sep 9, 2020 · 0 comments

Comments

@stanhu
Copy link

stanhu commented Sep 9, 2020

Problem description

While trying to debug through a bunch of nested blocks and Enumerators, I see Destination frame (0) is out of range (-1). I think is a debugger issue because the code seems to execute in the Ruby interpreter, but I can't tell if there's a real failure here or not.

Expected behavior

byebug follows the exception flow and no Destination frame errors.

Actual behavior

byebug reports Destination frame (0) is out of range (-1), and I can't follow the exception to the last rescue.

Steps to reproduce the problem

require 'byebug'

def simulate_grpc
  byebug
  fail 'test failure'
end

def call_grpc
  puts "call_grpc start"

  enum_for(:simulate_grpc)
ensure
  puts "call_gprc ensure"
end

def recording_request(&block)
  puts "recording_request start"

  yield
ensure
  puts "recording_request ensure"
end

def instrument_stream(response)
  Enumerator.new do |yielder|
    loop do
      value = recording_request { response.next }

      yielder.yield(value)
    end
  ensure
    puts "instrument_stream ensure"
  end
end

def start_call
  response = recording_request do
    call_grpc
  end

  instrument_stream(response)
rescue => err
  puts "got #{err}"
end

begin
  start_call.to_a
rescue => err
  puts "caught exception #{err}"
end
$ ruby repro.rb
recording_request start
call_grpc start
call_gprc ensure
recording_request ensure
recording_request start

[1, 10] in /Users/stanhu/gitlab/bugs/testfailure/repro.rb
    1: require 'byebug'
    2:
    3: def simulate_grpc
    4:   byebug
=>  5:   fail 'test failure'
    6: end
    7:
    8: def call_grpc
    9:   puts "call_grpc start"
   10:
(byebug) step

[16, 25] in /Users/stanhu/gitlab/bugs/testfailure/repro.rb
   16: def recording_request(&block)
   17:   puts "recording_request start"
   18:
   19:   yield
   20: ensure
=> 21:   puts "recording_request ensure"
   22: end
   23:
   24: def instrument_stream(response)
   25:   Enumerator.new do |yielder|
(byebug) step
*** Destination frame (0) is out of range (-1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant