Giter VIP home page Giter VIP logo

Comments (9)

jvns avatar jvns commented on September 28, 2024

Thanks for reporting this! I tried it on my computer and got this flamegraph, so I don't think it's to do with the Ruby code here.

How did you install Ruby? It would help if you could send me a core dump or two of the Ruby process's memory so I can see if I can figure out what's going on. Here's how to get a core dump:

first, start a while loop that will try to grab a core dump:

while true
do 
sudo gcore $(pgrep -f jekyll)
sleep 0.5
done

and then run bundle exec jekyll build

gcore will generate a file named like core.24996, which is the core dump.

you can either upload them somewhere or email them to [email protected].

from rbspy.

pixelastic avatar pixelastic commented on September 28, 2024

I'm using ruby through rvm. Here is the output of ruby -v:

ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]

Here is the incomplete flamegraph I initially got:
rbspy-2018-05-02-yzldx6arj9 flamegraph

And here are two dumps:

Thanks!

from rbspy.

pathawks avatar pathawks commented on September 28, 2024

I am getting a similar error message when I run on EC2 using Amazon Linux AMI 2018.03.0.20180508 x86_64 HVM

https://homepage.cs.uiowa.edu/~hawks/core.16680.zip

from rbspy.

pathawks avatar pathawks commented on September 28, 2024

I tried several different operating systems and machines, but could not get rbspy to work with RVM.

If I instead use rbenv it works without issue.

from rbspy.

wabain avatar wabain commented on September 28, 2024

It looks like what's happening here is that RVM has some kind of hooking logic that launches a Ruby process running ruby_executable_hooks, then execv's Bundler, wiping out the address space and starting up a new instance of the interpreter. The memory address that cannot be copied is the pointer to the initial Ruby thread.

The easy workaround here is that it seems RVM does all this indirection in service of allowing rbspy record -- jekyll build, which works. But more generally it would be nice if rbspy could handle execv calls. (I could imagine this coming up in programs using fork-then-execv strategies too.) I've hacked together some code that takes the naive approach of reinitializing the StackTraceGetter if the pointer to stack becomes invalid and it seems to work. Would a PR along those lines be of interest?

from rbspy.

jvns avatar jvns commented on September 28, 2024

yes, a PR along those lines sounds great. Thanks for investigating this! I'd love to get rbspy working with RVM.

from rbspy.

ethervoid avatar ethervoid commented on September 28, 2024

I'm getting a similar error attaching rbspy to a rake task without RVM:

[mymachine]:~$ sudo RAILS_ENV=production rbspy record bundle exec rake profile:db_size
Dropping permissions: running Ruby command as user ubuntu
Press Ctrl+C to stop
Dropped 21/33 stack traces because of errors. Please consider reporting a GitHub issue -- this isn't normal.
Wrote raw data to /home/ubuntu/.cache/rbspy/records/rbspy-2019-01-30-IxHGf8Be38.raw.gz
Writing formatted output to /home/ubuntu/.cache/rbspy/records/rbspy-2019-01-30-01i0vZzsrM.flamegraph.svg
Error. Causes: 
- Failed to copy memory address 7f6405991320
- Bad address (os error 14)

The ruby version is 2.2.7 coming from ubuntu package

from rbspy.

daniellockyer avatar daniellockyer commented on September 28, 2024

@pixelastic #177 should have fixed your issue. Can you confirm this is the case?

from rbspy.

pixelastic avatar pixelastic commented on September 28, 2024

Thanks for taking the time to investigate and fix this. Unfortunately I moved to other projects, stacks and environments in the meantime and can't try the fix and confirm if it's working.

I'm still going to close this, I'll re-open if I ever encounter this issue again.

Thanks for all your work

from rbspy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.