Comments (9)
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.
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:
And here are two dumps:
Thanks!
from rbspy.
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.
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.
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.
yes, a PR along those lines sounds great. Thanks for investigating this! I'd love to get rbspy working with RVM.
from rbspy.
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.
@pixelastic #177 should have fixed your issue. Can you confirm this is the case?
from rbspy.
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)
- `cargo install` fails with older rustc versions (< 1.59) HOT 5
- Profiling multiple subprocesses fails in 0.12.1 HOT 2
- Compilation fails with rust 1.62 HOT 4
- memory allocation of 1266630535279424 bytes failed HOT 3
- Dropped 21/21 stack traces because of errors / Failed to copy memory address 0 HOT 5
- Add native traces to `RubySpy::get_stack_trace` HOT 4
- Failing to profile the nix ruby binary HOT 2
- Error: version `GLIBC_2.33' not found (required by rbspy) HOT 2
- Segmentation fault when recording container Ruby HOT 4
- (Note: may not be a bug) Build fails without `--locked` from crate and HEAD HOT 2
- Possible change in container image hosting HOT 2
- Is it possible to include class / module names in output? HOT 3
- Dropped 21/23 stack traces because of errors / stack base and cfp address out of sync HOT 3
- Thanks for building this awesome tool!! HOT 2
- Consider moving CLI functionality behind a feature flag
- Speedscope output fails (event ordering?) HOT 4
- Speedscope output confused by multiple PIDs
- Inaccurate stacktraces from multithreaded programs HOT 7
- terminal flamegraph viewer
- May I know the max sampling rate rbspy can support? 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 rbspy.