-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
configuration option --gdb not working properly #2076
Comments
Running the same script with current master I get the following stack trace:
So even though the breakpoint is hit on master, it doesn't give us any information. Though d8 on the head of 4.2 branch gives:
Not sure how this could be happening. |
@bnoordhuis Sorry to pull you in on this one, but cannot figure out how a build of iojs with EDIT: Interesting note that d8 shows similar output to iojs if the |
@trevnorris I'll try to reproduce. In the meanwhile there is another trick you can try. After you have hit the out-of-memory abort, run this in gdb:
This should give you the javascript stacktrace (with a lot more verbose information). Note that you don't really need to reconfigure with |
@trevnorris Do you know the last time --gdbjit and --gdbjit-full worked for you? I can go all the way back to 1.0.0 and it still doesn't work. Whatever is broken, hasn't broken recently. Looking at the V8 code in gdb-jit.cc, I don't see anything obviously wrong, and as you mention d8 seems to work okay. Also, I have verified, using My suspicion is that there is something different about memory layout/map for the node process that confuses gdb somehow. |
Removed the build tag as the |
I'm not 100% sure but I believe gdbjit was broken until 4.3. The commit that fixes it (if I'm right) is v8/v8@652061e and is in next. |
Maybe worth installing gdbinit to $PREFIX/share/io.js, documenting it's use? It's not impossible to crash iojs / nodejs so this seems useful, especially if it can be used without recompiling iojs. |
@coreyfarrell 👍. It is much easier to use gdbinit than recompiling with |
@bnoordhuis gdbjit still doesn't seem to work for me with node in next, or any release of io.js (that I tried) going back to 1.0. Note that it does work with d8 in atleast 4.2. I think this is something node-specific, but I am not entirely sure what yet. |
@ofrobots The issue with current node v0.11.9 would show the first JS point in the backtrace output with Recently gave it a shot against d8 and found that it mostly worked. Though both options must be passed. But even with both options passed to io.js the end of the stack looks like so:
|
I think this is a gdb-related issue. This is how far I got: V8 is reporting the code-compile events to gdb by calling
The above was with io.js @ master. To compare I used a d8 from branch-heads/4.2. |
Is this still not working correctly? |
from @bnoordhuis' comment I believe it won't work properly until we bring in 4.7.3+. |
@trevnorris where are you getting the 4.7.3 from? The commit @bnoordhuis referenced landed in 4.3, and has been available in node v3.x and master. Last time I tried, it did not fix the issue for me though. It works fine with d8, but not with node. I personally think that Are there use-cases where people still want to use |
@ofrobots my bad. I misread the tag below the commit message on GitHub. |
As for |
Okay, that is a reasonable use-case. I don't have bandwidth at the moment, but I will try to take another look when I get some spare cycles. Others are welcome to investigate this too. |
Self-assigning so that I don't forget, but others are welcome to investigate it too. |
Thanks. Seems it has to be something like build configuration. Since it works perfectly in d8. I'll also try to take a peek there. |
Any chance someone knows if this is resolved or still an issue? |
@Trott This unfortunately is still an issue. Building d8@4.9.385.27 (same as current master) and running the simple script: performance.now(); and executing with:
we can see a significant amount of information. For example:
This is excellent we can walk through the JS on a release build. Unfortunately on master building with |
Original commit message: Unbreak --gdbjit for embedders. Embedders don't use d8.cc. Move gdbjit initialization to api.cc. Review URL: https://codereview.chromium.org/1710253002 Fixes: nodejs#2076 PR-URL: nodejs#5577 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
@bnoordhuis Awesome. Thanks much for taking care of this. |
Original commit message: Unbreak --gdbjit for embedders. Embedders don't use d8.cc. Move gdbjit initialization to api.cc. Review URL: https://codereview.chromium.org/1710253002 Fixes: #2076 PR-URL: #5577 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Original commit message: Unbreak --gdbjit for embedders. Embedders don't use d8.cc. Move gdbjit initialization to api.cc. Review URL: https://codereview.chromium.org/1710253002 Fixes: #2076 PR-URL: #5577 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Original commit message: Unbreak --gdbjit for embedders. Embedders don't use d8.cc. Move gdbjit initialization to api.cc. Review URL: https://codereview.chromium.org/1710253002 Fixes: #2076 PR-URL: #5577 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
After running
$ ./configure --gdb; make
it should be possible to do this from gdb:And it should break like so:
But it doesn't. The above was captured from d8 setting
ENABLE_GDB_JIT_INTERFACE
.I'll look into this later. Just filing a proper issue.
EDIT: Missing breakpoint is only exhibited on current
next
branch.The text was updated successfully, but these errors were encountered: