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

ThreadError: can't be called from trap context #72

Open
yourtallness opened this issue Jun 24, 2019 · 0 comments
Open

ThreadError: can't be called from trap context #72

yourtallness opened this issue Jun 24, 2019 · 0 comments

Comments

@yourtallness
Copy link

I'm trying to follow this guide with ruby 2.4.6 & rails 4.2.11.1.

On my locally running sidekiq instance it does not seem to work:

bundle exec rbtrace -p <pid> -e "load 'command.rb'"

I've put the following line in command.rb to work around the Mac OS line-too-long issue:

Thread.new{GC.start; require "objspace";io=File.open("/tmp/ruby-heap.dump", "w"); ObjectSpace.dump_all(output: io); io.close}

In my application.rb I have:

require 'rbtrace'
require 'objspace'
ObjectSpace.trace_object_allocations_start

Yet, the result I get is:

*** attached to process 24295
>> load 'yolo.rb'
=> #<ThreadError: can't be called from trap context>
*** detached from process 24295

Please advise how I can get around this, thanks in advance.

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