-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
Byebug.start breaks Timeout::timeout #54
Comments
Hi @jordoh, thanks for the report and the test. I reverted a stupid commit that was probably causing this. Can you try version 2.7.0 and let me know if it fixes it for you? |
Hey @deivid-rodriguez - still seeing this on the latest in master. Updated my branch with the failing test here: https://github.com/jordoh/byebug/tree/failing_timeout_test - want a pull request? |
The thing is, I did try your test and it passed... Let me give it another try and I'll get back to you! |
Hi deivid - I'm seeing the exception on both OS X and Linux:
Is there any other environment info that would be helpful? |
I am also seeing that error on 2.7.0 and on master (ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]) |
I'm sorry @jordoh and @Goltergaul, I'm not having any spare time lately to work on byebug. I'll try have a look at this by the end of this week. |
I stiil can't reproduce this. I don't get a failure with none of 2.0.0, 2.1.0 or 2.1.1 @jordoh or @Goltergaul, could you please checkout branch
Thanks! |
@deivid-rodriguez sure no problem, here is the result:
Which info on my environment would help you? |
i just noticed that i get many errors if i run the whole test suite:
Here is the full gist: https://gist.github.com/Goltergaul/9806165 |
I'm aware, have a look at #39 if you want to contribute. |
ah ok i thought it might be related to this issue here. What info can i give you so that you can reproduce this? |
Let me try this using rbenv (I'm using rvm) and I'll get back to you. Also post the output of Thanks!! |
Actually not necessary, the failure is reproduced in travis, which uses rvm as well... |
i'm using rbenv but here is my env anyway: RubyGems Environment:
Thanks for looking into this :) |
To try to reproduce #54 locally.
@deivid-rodriguez I'm on rvm with ruby 2.1.1 and can reproduce the error on master too. I've been doing some lurking/digging on my side too to see if I can help out but I'm coming up short. Here's my env as well:
|
This might help narrow down the problem. I did some manual digging, and the test runs fine in v2.1.0, but began breaking in v2.2.0. So I used |
Ok, I think I found a fix to that test. Just copying in a git diff instead of a PR because I don't fully understand what's going on. Maybe someone else can pick up where I'm leaving off. diff --git a/lib/byebug/context.rb b/lib/byebug/context.rb
index 376991b..126b918 100644
--- a/lib/byebug/context.rb
+++ b/lib/byebug/context.rb
@@ -18,6 +18,8 @@ module Byebug
def real_stack_size
if backtrace = Thread.current.backtrace_locations(0)
backtrace.size
+ else
+ 0
end
end
Apparently
|
@zamoazeni Wow, THANKS a lot for tracking this down!! I think you diff makes total sense and I'll merge it to fix the crash but I'll also research on why a thread might return a nil backtrace. Could it be a bug in ruby? Again, thanks because I was pretty lost in this one... |
@deivid-rodriguez I really don't know. I'm out of my depth here with this C extension code. And I've never used these methods before. Reading the Ruby docs it is documented that it could return nil. I just don't really grok the scenario when it does. And I didn't follow the code backwards to see if returning 0 from I'm kinda in the "naively I think this works, but I have no clue why" mode. |
I don't think returning 0 will do worse things than returning nil! Again thanks a lot for this!! |
Awesome. Thanks for your hard work @deivid-rodriguez |
😉 |
Update failing test for #54
@jordoh yes thats exactly where i encounter those errors. thanks for making a test! :) |
Yes, thanks @jordoh. Also I'm able to reproduce the failure in my environment now. With the previous test I just couldn't! |
Any workarounds to execute code while on a breakpoint? I see the "No live threads left" issue with 3.1.2 |
Execute code on a breakpoint should work as long as the code doesn't use threads. What is it that fails for you? |
A library call, not sure what it does. I'm wondering why it is a problem though. If I insert on that place |
Not sure either, I hope to be able to have a look at this at some point. In any case, it seems that you found your workaround! |
workaround - not really, it doesn't support multiline nor blocks. Pry doesn't start for some reason. I did the job anyways but would be nice to have byebug for other features as well. |
Of course, feel free to help. |
I encountered this bug; I found this similar issue in a different repo: maxdemarzi/neography#165 |
+1 |
It currently hangs the test suite
If it helps: We use Capybara (1.1.2) in ours project, and byebug causes to crash entire app with this error if you call any of Capybara methods on a breakpoint (we use Capybara in the app itself in a pair with Selenium, not in tests). Even if you just put a breakpoint somewhere, if you type 'continue' after a stop, it will crash with the error 'No live threads left' as well as when it will try to execute first forward capybara method (click_on, has_content? etc.) in the code. We were using the same gems some time ago with a ruby 1.9.2, and since original debugger does not support ruby 2.1, we moved to Byebug and this error started to appear. Not sure if I can provide test to describe it more, project is pretty complicated to cut the case out of it. |
Thanks for the feedback, @nattfodd. We already have a test for the issue, but any feedback is always welcome. |
Not really sure how (I was just researching a bit), but I just fixed this issue! 😀 |
cool, is there already a new release or should we test with the mastercode? |
I confirm, bug exists no more. Waiting for a new release to use it in a project. Thanks a lot! |
No, not yet, I'm fixing one last issue and then I'll release. Test master for now! |
I decided to release a bug fix version now. 3.4.1 is out! |
Failing test here: https://github.com/jordoh/byebug/tree/failing_timeout_test
Test:
Output:
The text was updated successfully, but these errors were encountered: