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)
- Deadlock on I/O HOT 10
- Debugger exceptions crash the debugger and disconnect from the client HOT 1
- Running irb on debugger on irb dose not save the irb history HOT 1
- Cannot attach docker container with `debugger` while `pry.binding` can HOT 4
- Any way to easily name the socket files? HOT 2
- The debugger command doesn't seem to work when using multiple threads at the same time. HOT 3
- Respect XDG basedir spec HOT 7
- Can't execute multiple line statement HOT 3
- Allow printing out + copying of full variables in VSCode HOT 1
- `rdbg` without no arguments HOT 2
- 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
- trace method can't accept number as first argument
- rdbg --util=gen-sockpath generate socket names that are too long HOT 5
- less paging support
- `source': uninitialized constant HOT 2
- Broken command history when I execute debugger on irb HOT 3
- DEBUGGER_.warn when skipping breakpoint because of RUBY_DEBUG_SKIP_PATH HOT 3
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.