Comments (3)
I've noticed lately that often the easiest way to un-stick the REPL is to run a sleep from the prompt.
[58, 67] in ~/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activemodel-7.0.8/lib/active_model/error.rb
58|
59| I18n.t(defaults.shift,
60| default: defaults,
61| attribute: attr_name,
62| message: message)
=> 63| end
64|
65| def self.generate_message(attribute, type, base, options) # :nodoc:
66| type = options.delete(:message) if options[:message].is_a?(Symbol)
67| value = (attribute != :base ? base.read_attribute_for_validation(attribute) : nil)
=>#0 ActiveModel::Error.full_message(attribute="name", message="can't be blank", base=#<Vessel:0x000000012d2b19b0 id: nil, name...) at ~/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activemodel-7.0.8/lib/active_model/error.rb:63 #=> "Name can't be blank"
#1 ActiveModel::Error#full_message at ~/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activemodel-7.0.8/lib/active_model/error.rb:160
# and 89 frames (use `bt' command for all frames)
(rdbg) c # <--- NOTE prompt failed to print the frame here
(rdbg) sleep 5
5 # <--- NOTE prompt _did_ print the result after sleep
(rdbg) whereami
[48, 57] in ~/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activemodel-7.0.8/lib/active_model/error.rb
48|
49| defaults << :"errors.format"
50| defaults << "%{attribute} %{message}"
51|
52| attr_name = attribute.remove(/\.base\z/).tr(".", "_").humanize
=> 53| debugger
54| attr_name = base_class.human_attribute_name(attribute, {
55| default: attr_name,
56| base: base,
57| })
=>#0 ActiveModel::Error.full_message(attribute="drive", message="must be power or sail", base=#<Vessel:0x000000012d2b19b0 id: nil, name...) at ~/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activemodel-7.0.8/lib/active_model/error.rb:53
#1 ActiveModel::Error#full_message at ~/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/activemodel-7.0.8/lib/active_model/error.rb:160
# and 89 frames (use `bt' command for all frames)
I still don't have a reliable repro, but it does seem to happen very often intermittently. Maybe this offers a clue?
from debug.
Does it always happen when you debug inside a live Rails server, or it happens when you debug tests too?
Also, could you try setting RUBY_DEBUG_SHOW_FRAMES=0
in your project for a while, which will stop displaying frames when you move forward, and see if the issue still occurs?
I don't have much proof atm, but I suspect it could be caused by inspecting frame arguments causing a livelock due to the thread-freezing mechanism. And evaluating input now temporarily unfreezes threads, which could resolve the locking as a side-effect.
from debug.
Does it always happen when you debug inside a live Rails server, or it happens when you debug tests too?
Now I'm wondering if I see it on a live development server—it may just be while debugging specs. And I'm usually debugging system specs that are driving a chrome browser with cuprite. So I wonder if that is related. I tried setting RUBY_DEBUG_SHOW_FRAMES=0
but I'm still seeing the same behaviour.
I've started running sleep 1
when it happens and it always unlocks it.
If you have any diagnostic ideas, let me know. I'm just not sure what to look for.
from debug.
Related Issues (20)
- `rdbg` without no arguments HOT 3
- LocalJumpError: break from proc-closure on typo in debug prompt HOT 2
- Setting breaking points with absolute path fails from nvim-dap and rdbg on Docker container HOT 1
- binding.b doesn't stop code on second controller request and above
- History not available
- Setting the irb_console configuration true has no effect HOT 1
- <enter> does not repeat last command in irb_console mode.
- Proposal: reverse continue
- Feat/Bug: Set the value of `_` (underscore) to the value of the last ruby expression HOT 3
- Slow print (STDOUT) of large objects
- Question: Could not load source 'Fastfile': not found, while debugging a Fastlane lane from VSCODE
- Remove usage of deprecated constant IRB::InputCompletor
- `!!!` to fast forward breakpoints like in pry HOT 5
- Large data output HOT 1
- Add a shorter alias for the whereami command HOT 1
- Could not find valid gem HOT 1
- Cut a new release for the Rails stdin bug HOT 2
- Keystrokes between `debugger` sessions seem to persist HOT 4
- after_fork_parent method waits for all child processes to stop HOT 2
- Having to specify bundle exec twice HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from debug.