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

'next' command not stepping over a line? #16

Closed
skyjumper opened this issue Aug 20, 2013 · 73 comments
Closed

'next' command not stepping over a line? #16

skyjumper opened this issue Aug 20, 2013 · 73 comments

Comments

@skyjumper
Copy link

Apologies if I'm not understanding something, but it looks like 'next' isn't working right... it's stepping into Rails' association functions. I'm also having a similar problem with the 'debugger' gem:

'next' in byebug:

2.0.0-p247 :017 > reload!; Course.new.debuggertest
Reloading...
[1, 10] in /home/httpd/vhosts/site.org/app/models/course.rb
    1: class Course < ActiveRecord::Base
    2:   has_many :subjects, :class_name => 'CourseCurricularSubject', :foreign_key => :course_id, :dependent => :destroy, :autosave => true
    3:
    4:   def debuggertest
    5:     byebug
=>  6:     puts 'Line 2'
    7:     subject = subjects.first
    8:     puts 'Line 4'
    9:   end
   10: end
(byebug) next
Line 2
[1, 10] in /home/httpd/vhosts/site.org/app/models/course.rb
    1: class Course < ActiveRecord::Base
    2:   has_many :subjects, :class_name => 'CourseCurricularSubject', :foreign_key => :course_id, :dependent => :destroy, :autosave => true
    3:
    4:   def debuggertest
    5:     byebug
    6:     puts 'Line 2'
=>  7:     subject = subjects.first
    8:     puts 'Line 4'
    9:   end
   10: end
(byebug) next
[333, 342] in /home/user/.rvm/gems/ruby-2.0.0-p247@rails32/gems/activerecord-3.2.13/lib/active_record/associations/collection_association.rb
   333:       def load_target
   334:         if find_target?
   335:           @target = merge_target_lists(find_target, target)
   336:         end
   337:
=> 338:         loaded!
   339:         target
   340:       end
   341:
   342:       def add_to_target(record)
(byebug) 

'step' in byebug:

2.0.0-p247 :001 > reload!; Course.new.debuggertest
Reloading...
[1, 10] in /home/httpd/vhosts/site.org/app/models/course.rb
    1: class Course < ActiveRecord::Base
    2:   has_many :subjects, :class_name => 'CourseCurricularSubject', :foreign_key => :course_id, :dependent => :destroy, :autosave => true
    3:
    4:   def debuggertest
    5:     byebug
=>  6:     puts 'Line 2'
    7:     subject = subjects.first
    8:     puts 'Line 4'
    9:   end
   10: end
(byebug) step
Line 2
[1, 10] in /home/httpd/vhosts/site.org/app/models/course.rb
    1: class Course < ActiveRecord::Base
    2:   has_many :subjects, :class_name => 'CourseCurricularSubject', :foreign_key => :course_id, :dependent => :destroy, :autosave => true
    3:
    4:   def debuggertest
    5:     byebug
    6:     puts 'Line 2'
=>  7:     subject = subjects.first
    8:     puts 'Line 4'
    9:   end
   10: end
(byebug) step
[39, 48] in /home/user/.rvm/gems/ruby-2.0.0-p247@rails32/gems/activerecord-3.2.13/lib/active_record/associations/builder/association.rb
   39:       end
   40:
   41:       def define_readers
   42:         name = self.name
   43:         mixin.redefine_method(name) do |*params|
=> 44:           association(name).reader(*params)
   45:         end
   46:       end
   47:
   48:       def define_writers
(byebug)

'next' in debugger:

2.0.0-p247 :002 > reload!; Course.new.debuggertest
Reloading...
/home/httpd/vhosts/site.org/app/models/course.rb:7
puts 'Line 2'

[2, 11] in /home/httpd/vhosts/site.org/app/models/course.rb
   2    has_many :subjects, :class_name => 'CourseCurricularSubject', :foreign_key => :course_id, :dependent => :destroy, :autosave => true
   3
   4    def debuggertest
   5      require 'debugger'
   6      binding.debugger
=> 7      puts 'Line 2'
   8      subject = subjects.first
   9      puts 'Line 4'
   10    end
   11  end
(rdb:1) next
Line 2
/home/httpd/vhosts/site.org/app/models/course.rb:8
subject = subjects.first

[3, 12] in /home/httpd/vhosts/site.org/app/models/course.rb
   3
   4    def debuggertest
   5      require 'debugger'
   6      binding.debugger
   7      puts 'Line 2'
=> 8      subject = subjects.first
   9      puts 'Line 4'
   10    end
   11  end
(rdb:1) next
/home/user/.rvm/gems/ruby-2.0.0-p247@rails32/gems/activerecord-3.2.13/lib/active_record/associations/builder/association.rb:44
association(name).reader(*params)

[39, 48] in /home/user/.rvm/gems/ruby-2.0.0-p247@rails32/gems/activerecord-3.2.13/lib/active_record/associations/builder/association.rb
   39        end
   40
   41        def define_readers
   42          name = self.name
   43          mixin.redefine_method(name) do |*params|
=> 44            association(name).reader(*params)
   45          end
   46        end
   47
   48        def define_writers
(rdb:1) 

'step' in debugger:

2.0.0-p247 :001 > reload!; Course.new.debuggertest
Reloading...
/home/httpd/vhosts/site.org/app/models/course.rb:7
puts 'Line 2'

[2, 11] in /home/httpd/vhosts/site.org/app/models/course.rb
   2    has_many :subjects, :class_name => 'CourseCurricularSubject', :foreign_key => :course_id, :dependent => :destroy, :autosave => true
   3  
   4    def debuggertest
   5      require 'debugger'
   6      binding.debugger
=> 7      puts 'Line 2'
   8      subject = subjects.first
   9      puts 'Line 4'
   10    end
   11  end
(rdb:1) step
Line 2
/home/httpd/vhosts/site.org/app/models/course.rb:8
subject = subjects.first

[3, 12] in /home/httpd/vhosts/site.org/app/models/course.rb
   3  
   4    def debuggertest
   5      require 'debugger'
   6      binding.debugger
   7      puts 'Line 2'
=> 8      subject = subjects.first
   9      puts 'Line 4'
   10    end
   11  end
(rdb:1) step
/home/user/.rvm/gems/ruby-2.0.0-p247@rails32/gems/activerecord-3.2.13/lib/active_record/associations/builder/association.rb:44
association(name).reader(*params)

[39, 48] in /home/user/.rvm/gems/ruby-2.0.0-p247@rails32/gems/activerecord-3.2.13/lib/active_record/associations/builder/association.rb
   39        end
   40  
   41        def define_readers
   42          name = self.name
   43          mixin.redefine_method(name) do |*params|
=> 44            association(name).reader(*params)
   45          end
   46        end
   47  
   48        def define_writers
(rdb:1) 
@deivid-rodriguez
Copy link
Owner

That's very weird... The best thing could be if you could provide me with a sample application or a gist or something so I can reproduce the problem myself. In any case, I might be able to better understand the problem if you print the stack before every command using the byebug's command bt.

Thanks for your report man!

@eric-hu
Copy link
Contributor

eric-hu commented Aug 27, 2013

Couldn't reproduce this issue with Rails 4.0 and Rails 3.2. Feel free to expand further with either of these

@deivid-rodriguez
Copy link
Owner

Thanks for testing this @eric-hu !

@deivid-rodriguez
Copy link
Owner

@skyjumper Any updates on this? Are you still getting this issue?

@skyjumper
Copy link
Author

Sorry, I haven't been working on this project... will get more info to you soon

@deivid-rodriguez
Copy link
Owner

Great, thanks!

@ddoherty03
Copy link

I am seeing this too in Rails 4 (saw it before upgrade in Rails 3.2 as well). Really kills the usefulness of the debugger.

@deivid-rodriguez
Copy link
Owner

I'm aware of this and I hope to work on it soon.

A new bug fix has been recently released for the TracePoint API in ruby-core (https://bugs.ruby-lang.org/issues/8622), so this should happen less often in ruby 2.1 or in the next 2.0 patch level. But I've still seen the bug even with the patch applied.

A minimal example to reproduce the bug would be really useful.

@kentaroi
Copy link

This issue was solved for me when I upgraded ruby to 2.0.0-p353 today as David said.
Thank you very much, David.

@smoovej
Copy link

smoovej commented Nov 27, 2013

I just upgraded to 2.0.0-p353 and I'm still not getting proper "next" behavior. It's stepping me into rails code regardless of "next" vs. "step".

@deivid-rodriguez
Copy link
Owner

I'm aware of this and I hope to work on it soon. I've still seen the bug even with the patch applied. A minimal example to reproduce the bug would be really useful.

Sorry for quoting my previous comment but... all quiet on the Western Front

@pho3nixf1re
Copy link

I am seeing this problem as well with ruby 2.0.0p353. It's not rails based code fyi. Both debugger and byebug are doing this.

@deivid-rodriguez
Copy link
Owner

Another issue in ruby trunk might be related to this. A patch has been already submitted and it (might) be backported to ruby 2.0: https://bugs.ruby-lang.org/issues/9321

@deivid-rodriguez
Copy link
Owner

Thanks to https://bugs.ruby-lang.org/issues/9321 I've been able to isolate the bug (or one at least one of them) affecting the next command. The proper fix, and whether it should be fixed in ruby core or here, is still being discussed. If it's not fixed in core, how to approach it here doesn't seem trivial to me.

I've committed a failing test in 13a3268

@deivid-rodriguez
Copy link
Owner

The fix for the issue has been released and makes the failing test pass!

Anybody getting this issue, please give the patch a try to check whether this has been definitely resolved. Instructions for rvm:

git clone git://github.com/ruby/ruby.git
cd ruby
git format-patch -1 c2e72fb
rvm reinstall 2.1.0 --patch 0001-vm.c-rb_vm_pop_cfunc_frame-added.-It-cares-c_return-.patch

@ddoherty03
Copy link

Deivid,

Blindly following your recipe, I get the following error:

[git] $ rvm install 2.1.0 --patch 0001-vm.c-rb_vm_pop_cfunc_frame-added.-It-cares-c_return-.patch
Checking requirements for ubuntu.
Requirements installation successful.
Installing Ruby from source to: /home/ded/.rvm/rubies/ruby-2.1.0, this may take a while depending on your cpu(s)...
ruby-2.1.0 - #downloading ruby-2.1.0, this may take a while depending on your connection...
There is no checksum for '/ruby-2.1.0.tar.bz2' or 'ruby-2.1.0.tar.bz2', it's not possible to validate it.
This could be because your RVM install's list of versions is out of date. You may want to
update your list of rubies by running 'rvm get stable' and try again.
If that does not resolve the issue and you wish to continue with unverified download
add '--verify-downloads 1' after the command.

There has been an error fetching the ruby interpreter. Halting the installation.

Looks like rvm is trying to download 2.1.0. Adding --disble-binary and
--force did not help.

@deivid-rodriguez
Copy link
Owner

Follow the other suggestion, rvm get stable, and try again.

@ddoherty03
Copy link

Ah, that worked. Thanks.

@deivid-rodriguez
Copy link
Owner

What is it that worked? The instructions to get the patch installed or the patch itself?

@connertp
Copy link

Installing the patch solved the next/step confusion problem for me. Thanks for the info.

@deivid-rodriguez
Copy link
Owner

Thanks for trying it! Notice though that the patch shouldn't be necessary for ruby >= 2.1

However I think the issue is still there cause the test is still failing sometimes... :(

@deivid-rodriguez
Copy link
Owner

@ko1, I'm still hitting issue https://bugs.ruby-lang.org/issues/9321... I have no idea why if it's supposed to be fixed in ruby core...

Your help would be appreciated. Thanks a lot.

@ko1
Copy link

ko1 commented Mar 30, 2014

(2014/03/31 7:32), David Rodríguez wrote:

@ko1 https://github.com/ko1, I'm still hitting issue
https://bugs.ruby-lang.org/issues/9321... I have no idea why if it's
supposed to be fixed in ruby core...

Ah. you need re-open a ticket. Anyway, I'll check it.
Thank you for your reporting.

// SASADA Koichi at atdot dot net

@deivid-rodriguez
Copy link
Owner

Please, disregard my previous messages.

The bug is indeed fixed in ruby-head, it's just not present in 2.0 and 2.1. I asked for it to be backported, but in any case this should work fine in 2.2

@connertp, you do need the patch actually, thanks for confirming that it works!

@ddoherty03
Copy link

Deivid,

This issue makes me want to scream. You seem to be the only one paying
attention to this, so thanks for your all your work.

My question is, why are the ruby developer not more worried about the quality
of ruby's debugger? Every language I have worked with has had a really decent
debugger built in, yet the ruby devs seem not to care about it.

I'm sorry for using your github forum to rant, but this is the only place I
see this issue discussed. I have spent dozens (maybe hundreds) of hours
stepping through the bowels of ruby library code, or trying to step through a
loop because the debugger seems broken.

What can we do light a fire under the collective asses of the ruby devs to get
them interested in backporting your fix to production releases of ruby? Is
there a way to vote on what we want worked on? Something else?

Getting desperate.

@smoovej
Copy link

smoovej commented Apr 14, 2014

Amen, brother.  Lack of a quality debugger really sucks the joy out of ruby coding for me.  I would happily pay a bounty if someone close to the issue would be willing to get this stuff to a more useable state.

From: Daniel Doherty notifications@github.com
Reply: deivid-rodriguez/byebug reply@reply.github.com
Date: April 14, 2014 at 3:43:45 PM
To: deivid-rodriguez/byebug byebug@noreply.github.com
Cc: smoovej github@frazao.net
Subject:  Re: [byebug] 'next' command not stepping over a line? (#16)

Deivid,

This issue makes me want to scream. You seem to be the only one paying
attention to this, so thanks for your all your work.

My question is, why are the ruby developer not more worried about the quality
of ruby's debugger? Every language I have worked with has had a really decent
debugger built in, yet the ruby devs seem not to care about it.

I'm sorry for using your github forum to rant, but this is the only place I
see this issue discussed. I have spent dozens (maybe hundreds) of hours
stepping through the bowels of ruby library code, or trying to step through a
loop because the debugger seems broken.

What can we do light a fire under the collective asses of the ruby devs to get
them interested in backporting your fix to production releases of ruby? Is
there a way to vote on what we want worked on? Something else?

Getting desperate.


Reply to this email directly or view it on GitHub.

@smoovej
Copy link

smoovej commented Sep 23, 2014

Just wanted to say thank you for all the hard work around this. Updated to ruby-2.0.0-p576 and everything is working like a dream. Great work, much appreciated!

@deivid-rodriguez
Copy link
Owner

Appreciated @smoovej, I'm so happy about this! 😄 😄 😄

@fullofcaffeine
Copy link

I'm also getting this issue on Ruby 2.1.0. Any news regarding the solution?

@fullofcaffeine
Copy link

Oh, just saw the recommended Ruby versions 👍 I'll upgrade to 2.1.3.

@ddoherty03
Copy link

David,

Thanks a million for getting this done. I nominate this as the best "feature" of Ruby for 2014.

@deivid-rodriguez
Copy link
Owner

You are welcome @ddoherty03, but it's not me to thank but ruby-core developers, specially @ko1. I only spotted the specific bugs and opened the issues, but he solved them!

@mkanoor
Copy link

mkanoor commented Dec 22, 2014

@deivid-rodriguez
This works with simple ruby scripts but it sill seems to have issues in rails app with rspec. I tested with different versions of ruby at 2.0.x and 2.1.x. The only one that seems to work is in ruby 2.1.5. Ruby 2.1.3 had problems too. Are there other ruby fixes that have to be cherry picked like you mentioned in the post form Jul 1 2013 (Bug #9759, Bug #9959)

@deivid-rodriguez
Copy link
Owner

Hi @mkanoor, thanks for the feedback. I don't know what backports 2.1.3 migth be missing, but if 2.1.5 works fine I think that should be enough. I'll just update the README recommending 2.1.5 or older.

Regarding missing backports to 2.0, those 2 backports should be enough but not sure how easy it will be to apply them manually. It seems that there was some problems backporting them, that's why the issues are stalled.

@elado
Copy link

elado commented Jan 9, 2015

Referencing #85

@fetchak
Copy link

fetchak commented Mar 5, 2015

I'm getting inconsistent behavior with 'next' with ruby 2.1.5p273 and byebug/byebug-pry master branches. Sometimes it skips to the next line, sometimes it goes elsewhere. Same with ruby 2.1.1p76 and byebug 3.5.1 release version.

Anyone have a known working combination of byebug and ruby 2.1?

@deivid-rodriguez
Copy link
Owner

That is very weird, the only thing I can think of is that Rails 3.0.10 included code affected by #103

Could you create a sample repo reproducing the problem? Thanks.

@mcr
Copy link

mcr commented Apr 15, 2019

I'm seeing this problem again with rails 5.2.2.1 and ruby 2.6.2

@rockorequin
Copy link

rockorequin commented May 2, 2019

I'm also seeing this problem again with Rails 5.0.2 and ruby 2.6.3 and ruby-debug-ide. 'Run to cursor' works fine if you position the cursor over the next line, but the 'next' command just does a 'continue'.

@kamenomagic
Copy link

kamenomagic commented May 3, 2019

Also seeing this, surprised to find that I'm not the crazy one

Rails 5.2.2
Ruby 2.5.3

@DeegC
Copy link

DeegC commented Jun 14, 2019

I am also seeing a problem in Ruby 2.6.3--at times the 'next' command will behave like 'continue'. If I roll back to Ruby 2.5.3 (and keep everything else the same) all seems to be fine. Here's my Gemfile.lock. Let me know if any other info would help.

  remote: git://github.com/billr578/activeuuid.git
  revision: 5ae594de05af55694cdbfb1249444dd2fc47bd28
  branch: rails52
  specs:
    activeuuid (0.6.1)
      activerecord (>= 4.0)
      uuidtools

GEM
  remote: https://rubygems.org/
  specs:
    aasm (4.5.2)
    actioncable (5.2.1.1)
      actionpack (= 5.2.1.1)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailer (5.2.1.1)
      actionpack (= 5.2.1.1)
      actionview (= 5.2.1.1)
      activejob (= 5.2.1.1)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (5.2.1.1)
      actionview (= 5.2.1.1)
      activesupport (= 5.2.1.1)
      rack (~> 2.0)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (5.2.1.1)
      activesupport (= 5.2.1.1)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.0.3)
    active_model_serializers (0.9.7)
      activemodel (>= 3.2)
      concurrent-ruby (~> 1.0)
    activejob (5.2.1.1)
      activesupport (= 5.2.1.1)
      globalid (>= 0.3.6)
    activemodel (5.2.1.1)
      activesupport (= 5.2.1.1)
    activerecord (5.2.1.1)
      activemodel (= 5.2.1.1)
      activesupport (= 5.2.1.1)
      arel (>= 9.0)
    activestorage (5.2.1.1)
      actionpack (= 5.2.1.1)
      activerecord (= 5.2.1.1)
      marcel (~> 0.3.1)
    activesupport (5.2.1.1)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 0.7, < 2)
      minitest (~> 5.1)
      tzinfo (~> 1.1)
    addressable (2.6.0)
      public_suffix (>= 2.0.2, < 4.0)
    akami (1.3.1)
      gyoku (>= 0.4.0)
      nokogiri
    arel (9.0.0)
    ast (2.4.0)
    bcrypt (3.1.12)
    better_errors (2.5.1)
      coderay (>= 1.0.0)
      erubi (>= 1.0.0)
      rack (>= 0.9.0)
    bindex (0.7.0)
    binding_of_caller (0.8.0)
      debug_inspector (>= 0.0.1)
    bootsnap (1.4.4)
      msgpack (~> 1.0)
    bourbon (5.1.0)
      sass (~> 3.4)
      thor (~> 0.19)
    builder (3.2.3)
    bullet (5.7.6)
      activesupport (>= 3.0.0)
      uniform_notifier (~> 1.11.0)
    byebug (11.0.1)
    capybara (3.18.0)
      addressable
      mini_mime (>= 0.1.3)
      nokogiri (~> 1.8)
      rack (>= 1.6.0)
      rack-test (>= 0.6.3)
      regexp_parser (~> 1.2)
      xpath (~> 3.2)
    capybara-email (3.0.1)
      capybara (>= 2.4, < 4.0)
      mail
    clearbit (0.2.8)
      nestful (~> 1.1.0)
    cliver (0.3.2)
    coderay (1.1.2)
    concurrent-ruby (1.1.5)
    configatron (4.5.1)
    connection_pool (2.2.2)
    crack (0.4.3)
      safe_yaml (~> 1.0.0)
    crass (1.0.4)
    database_cleaner (1.7.0)
    debug_inspector (0.0.3)
    devise (4.5.0)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0, < 6.0)
      responders
      warden (~> 1.2.3)
    diff-lcs (1.3)
    docile (1.3.1)
    dotenv (2.7.2)
    encryptor (3.0.0)
    erubi (1.8.0)
    ethon (0.12.0)
      ffi (>= 1.3.0)
    execjs (2.7.0)
    factory_bot (5.0.2)
      activesupport (>= 4.2.0)
    factory_bot_rails (5.0.2)
      factory_bot (~> 5.0.2)
      railties (>= 4.2.0)
    faraday (0.15.4)
      multipart-post (>= 1.2, < 3)
    ffi (1.10.0)
    fuubar (2.3.2)
      rspec-core (~> 3.0)
      ruby-progressbar (~> 1.4)
    globalid (0.4.2)
      activesupport (>= 4.2.0)
    gyoku (1.3.1)
      builder (>= 2.1.2)
    haml (5.0.4)
      temple (>= 0.8.0)
      tilt
    hashdiff (0.3.9)
    httpclient (2.8.3)
    httpi (2.4.4)
      rack
      socksify
    i18n (1.6.0)
      concurrent-ruby (~> 1.0)
    iostreams (0.17.1)
      concurrent-ruby
    jaro_winkler (1.5.2)
    json (2.2.0)
    json-schema (2.8.1)
      addressable (>= 2.4)
    json_matchers (0.7.3)
      json-schema (~> 2.7)
    launchy (2.4.3)
      addressable (~> 2.3)
    libv8 (3.16.14.19)
    loofah (2.2.3)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    macaddr (1.7.1)
      systemu (~> 2.6.2)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    marcel (0.3.3)
      mimemagic (~> 0.3.2)
    method_source (0.9.2)
    mimemagic (0.3.3)
    mini_mime (1.0.1)
    mini_portile2 (2.4.0)
    minitest (5.11.3)
    money (6.13.3)
      i18n (>= 0.6.4, <= 2)
    msgpack (1.2.10)
    multipart-post (2.0.0)
    mustache (1.1.0)
    mustermann (1.0.3)
    mysql2 (0.5.2)
    nestful (1.1.3)
    net-sftp (2.1.2)
      net-ssh (>= 2.6.5)
    net-ssh (5.2.0)
    newrelic_rpm (6.3.0.355)
    nio4r (2.3.1)
    nokogiri (1.10.3)
      mini_portile2 (~> 2.4.0)
    nori (2.6.0)
    orm_adapter (0.5.0)
    parallel (1.17.0)
    parser (2.6.3.0)
      ast (~> 2.4.0)
    phantomjs (2.1.1.0)
    poltergeist (1.18.1)
      capybara (>= 2.1, < 4)
      cliver (~> 0.3.1)
      websocket-driver (>= 0.2.0)
    pry (0.12.2)
      coderay (~> 1.1.0)
      method_source (~> 0.9.0)
    public_suffix (3.0.3)
    puma (3.12.1)
    rack (2.0.7)
    rack-protection (2.0.5)
      rack
    rack-ssl (1.4.1)
      rack
    rack-test (1.1.0)
      rack (>= 1.0, < 3)
    raddocs (2.2.0)
      haml (>= 4.0)
      json
      sinatra (~> 2.0)
    rails (5.2.1.1)
      actioncable (= 5.2.1.1)
      actionmailer (= 5.2.1.1)
      actionpack (= 5.2.1.1)
      actionview (= 5.2.1.1)
      activejob (= 5.2.1.1)
      activemodel (= 5.2.1.1)
      activerecord (= 5.2.1.1)
      activestorage (= 5.2.1.1)
      activesupport (= 5.2.1.1)
      bundler (>= 1.3.0)
      railties (= 5.2.1.1)
      sprockets-rails (>= 2.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.0.4)
      loofah (~> 2.2, >= 2.2.2)
    railties (5.2.1.1)
      actionpack (= 5.2.1.1)
      activesupport (= 5.2.1.1)
      method_source
      rake (>= 0.8.7)
      thor (>= 0.19.0, < 2.0)
    rainbow (3.0.0)
    rake (12.3.2)
    rb-fsevent (0.10.3)
    rb-inotify (0.10.0)
      ffi (~> 1.0)
    redis (4.1.1)
    ref (2.0.0)
    regexp_parser (1.4.0)
    responders (2.4.1)
      actionpack (>= 4.2.0, < 6.0)
      railties (>= 4.2.0, < 6.0)
    rspec (3.8.0)
      rspec-core (~> 3.8.0)
      rspec-expectations (~> 3.8.0)
      rspec-mocks (~> 3.8.0)
    rspec-core (3.8.0)
      rspec-support (~> 3.8.0)
    rspec-expectations (3.8.3)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.8.0)
    rspec-mocks (3.8.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.8.0)
    rspec-rails (3.8.2)
      actionpack (>= 3.0)
      activesupport (>= 3.0)
      railties (>= 3.0)
      rspec-core (~> 3.8.0)
      rspec-expectations (~> 3.8.0)
      rspec-mocks (~> 3.8.0)
      rspec-support (~> 3.8.0)
    rspec-support (3.8.0)
    rspec_api_documentation (6.1.0)
      activesupport (>= 3.0.0)
      mustache (~> 1.0, >= 0.99.4)
      rspec (~> 3.0)
    rubocop (0.68.1)
      jaro_winkler (~> 1.5.1)
      parallel (~> 1.10)
      parser (>= 2.5, != 2.5.1.1)
      rainbow (>= 2.2.2, < 4.0)
      ruby-progressbar (~> 1.7)
      unicode-display_width (>= 1.4.0, < 1.6)
    rubocop-rspec (1.32.0)
      rubocop (>= 0.60.0)
    ruby-progressbar (1.10.0)
    safe_yaml (1.0.5)
    sass (3.7.4)
      sass-listen (~> 4.0.0)
    sass-listen (4.0.0)
      rb-fsevent (~> 0.9, >= 0.9.4)
      rb-inotify (~> 0.9, >= 0.9.7)
    savon (2.11.1)
      akami (~> 1.2)
      builder (>= 2.1.2)
      gyoku (~> 1.2)
      httpi (~> 2.3)
      nokogiri (>= 1.4.0)
      nori (~> 2.4)
      wasabi (~> 3.4)
    shoulda (3.6.0)
      shoulda-context (~> 1.0, >= 1.0.1)
      shoulda-matchers (~> 3.0)
    shoulda-context (1.2.2)
    shoulda-matchers (3.1.3)
      activesupport (>= 4.0.0)
    sidekiq (5.2.7)
      connection_pool (~> 2.2, >= 2.2.2)
      rack (>= 1.5.0)
      rack-protection (>= 1.5.0)
      redis (>= 3.3.5, < 5)
    simple_form (4.1.0)
      actionpack (>= 5.0)
      activemodel (>= 5.0)
    simplecov (0.16.1)
      docile (~> 1.1)
      json (>= 1.8, < 3)
      simplecov-html (~> 0.10.0)
    simplecov-html (0.10.2)
    sinatra (2.0.5)
      mustermann (~> 1.0)
      rack (~> 2.0)
      rack-protection (= 2.0.5)
      tilt (~> 2.0)
    socksify (1.7.1)
    sprockets (3.7.2)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.2.1)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    sys-proctable (1.2.1)
      ffi
    systemu (2.6.5)
    table_print (1.5.6)
    temple (0.8.1)
    therubyracer (0.12.3)
      libv8 (~> 3.16.14.15)
      ref
    thor (0.20.3)
    thread_safe (0.3.6)
    tilt (2.0.9)
    timecop (0.9.1)
    typhoeus (1.3.1)
      ethon (>= 0.9.0)
    tzinfo (1.2.5)
      thread_safe (~> 0.1)
    uglifier (4.1.20)
      execjs (>= 0.3.0, < 3)
    unicode-display_width (1.5.0)
    uniform_notifier (1.11.0)
    usps (0.1.3)
      builder (>= 2.1.2)
      nokogiri (>= 1.4.1)
      typhoeus (>= 0.1.18)
    uuid (2.3.9)
      macaddr (~> 1.0)
    uuidtools (2.1.5)
    warden (1.2.8)
      rack (>= 2.0.6)
    wasabi (3.5.0)
      httpi (~> 2.0)
      nokogiri (>= 1.4.2)
    web-console (3.7.0)
      actionview (>= 5.0)
      activemodel (>= 5.0)
      bindex (>= 0.4.0)
      railties (>= 5.0)
    webmock (3.5.1)
      addressable (>= 2.3.6)
      crack (>= 0.3.2)
      hashdiff
    webrick (1.4.2)
    websocket-driver (0.7.0)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.3)
    will_paginate (3.1.7)
    xpath (3.2.0)
      nokogiri (~> 1.8)

PLATFORMS
  ruby

DEPENDENCIES
  aasm (~> 4.5.0)
  active_model_serializers (~> 0.9.0)
  activeuuid!
  better_errors
  binding_of_caller
  bootsnap (>= 1.1.0)
  bourbon
  bullet (~> 5.7.0)
  byebug
  capybara
  capybara-email
  clearbit
  configatron
  database_cleaner
  devise (~> 4.5.0)
  dotenv
  encryptor
  factory_bot_rails
  faraday
  fuubar
  httpclient
  httpi
  iostreams
  json_matchers (~> 0.7.0)
  launchy
  money
  mysql2 (= 0.5.2)
  net-sftp
  newrelic_rpm
  nokogiri
  phantomjs
  poltergeist
  pry
  puma
  rack
  rack-ssl
  raddocs
  rails (= 5.2.1.1)
  rspec-mocks
  rspec-rails
  rspec_api_documentation
  rubocop
  rubocop-rspec
  sass
  savon (= 2.11.1)
  shoulda
  sidekiq
  simple_form
  simplecov
  sinatra
  sys-proctable
  table_print
  therubyracer
  timecop
  uglifier
  usps
  uuid
  web-console
  webmock
  webrick
  will_paginate

RUBY VERSION
   ruby 2.5.3p105

BUNDLED WITH
   1.17.2

@maslenkov
Copy link

Thanks for a great job!
Just to keep the issue in an actual state with more details.
I've stuck with the same issue. I have byebug, pry and pry-byebug in my Gemfile (no bootsnap, spring, etc.). Rails 5.2.2. And ruby 2.6.3p62 (docker image - https://hub.docker.com/_/ruby/ ruby:2.6.3-stretch ). Downgrading to 2.5.3 helps. I've checked on two other machines. It is reproducible. If necessary - I can prepare a dummy app.

@jacquescrocker
Copy link

jacquescrocker commented Aug 4, 2019

Seeing a similar issue with ruby 2.6.3 and byebug 11.0.1, rspec 3.8.0, and rails 5.2.3

When I use next, it doesn't go to the next line. It jumps to the next line up the call stack

example in an rspec:

[39, 48] in user_repo_spec.rb
   39:     end
   40:
   41:     context "with email username" do
   42:       it "returns a user with given email username" do
   43:         existing_user = FactoryBot.create(:user, email: "someone@somewhere.com")
=> 44:         user = repo.lookup("someone")
   45:         expect(repo.count).to eql(1)
   47:         expect(existing_user).to eql(user)
   48:       end
(byebug) next

[254, 263] in 2.6.3/lib/ruby/gems/2.6.0/gems/rspec-core-3.8.2/lib/rspec/core/example.rb
   254:             with_around_and_singleton_context_hooks do
   255:               begin
   256:                 run_before_example
   257:                 @example_group_instance.instance_exec(self, &@example_block)
   258:
=> 259:                 if pending?
   260:                   Pending.mark_fixed! self
   261:
   262:                   raise Pending::PendingExampleFixedError,
   263:                         'Expected example to fail since it is pending, but it passed.',

@deivid-rodriguez
Copy link
Owner

I'm sorry you're all having this issue. If I can get a repro, I'll have a look at it.

These bugs are most of the times issues in the underlying TracePoint API. One thing you can try is giving ruby 2.7.0-preview1 a try, maybe those bugs are fixed there.

@rockorequin
Copy link

@deivid-rodriguez I couldn't reproduce this problem in my code using byebug, but I have a very similar problem in debase with ruby 2.6 (see ruby-debug/debase#75) and 2.7.0-preview1 does seem to fix the problem there.

@theblang
Copy link

theblang commented Aug 21, 2019

Wanted to echo @DeegC and @jacquescrocker 's comments. We are also seeing this on ruby 2.6.3p62; sometimes n will work, but sometimes it behaves like a continue. I'm currently reproducing the issue in an RSpec test.

  • ruby 2.6.3p62 (2019-04-16 revision 67580)
  • rspec-core (3.8.2)
  • pry-byebug (3.7.0)
    • byebug (~> 11.0)
    • pry (~> 0.10)

Edit: Just reporting back, updating to 2.7.0-preview1 fixed the issue for me as well.

@prashantvithani
Copy link

I guess it's clear that there was clearly an issue with byebug on ruby-2.6.3. However, upgrading the ruby version to 2.6.5 fixed it for me.

@theblang
Copy link

theblang commented Oct 4, 2019

That is great to know that 2.6.5 fixes it, thanks @prashantvithani !

@diabolo
Copy link

diabolo commented Mar 27, 2020

I can confirm that 2.6.5 fixes this, and that the issue still exists in ruby 2.5.7p206

@ghost
Copy link

ghost commented Apr 22, 2020

Ruby 2.7.1, byebug 11.1.2, Rails 6.0.2.2 -> Still having the same issue

@deivid-rodriguez
Copy link
Owner

Please, post reproduction instructions as part of a separate issue if you want this looked at. Thanks.

@chrisbloom7
Copy link

I cannot reliably reproduce a setup. Sometimes it happens, sometimes it doesn't. When it does it seems to consistently happen on the same line. Currently experiencing this with Ruby 2.7.1p92, rails (6.0.3.2), byebug (11.1.3), and pry-byebug (3.9.0). I'll hit a byebug breakpoint and start stepping with n or s. At some point it just decides to continue instead of advancing. If I move the breakpoint lower and try again it will stop at the new spot, as expected, and I can maybe advance a few more steps again but eventually it will just decide to continue on a n or s command.

@chrisbloom7
Copy link

A coworker of mine that was also experiencing this said he got around it by using c <next_line_no> to keep stepping in or over when n or s would kick him out

@oliverguenther
Copy link

This appears to be related to ruby/ruby@3e02cd5 and #719 with Ruby 2.7.1 and appears to be fixed in upstream Ruby (upcoming version 2.7.2)

@eelectron
Copy link

next is not jumping to next line .

$ ruby -v                                                         [11:33:22]
ruby 3.0.1p64 (2021-04-05 revision 0fb782ee38) [x86_64-darwin19]

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