-
Notifications
You must be signed in to change notification settings - Fork 9
pargs code 1: /bin/sh: pargs: not found #1
Comments
It looks like there is no implementation of |
tr '\0' '\n' < /proc//cmdline seems to be the way to get it into shape. |
We get an error with ECONNREFUSED (it looks like it's using net.js to |
Sorry about this. At Joyent, we've switched to using OS core files and MDB for post-mortem debugging (see http://dtrace.org/blogs/dap/2012/01/13/playing-with-nodev8-postmortem-debugging/). As a result, this one's fallen into disrepair. It looks like Node's internal debugging API changed some time before 0.8.0, and this module was never updated. I was able to run the "ncore" example on OS X with Node 0.8.22 after applying this delta:
As you already found, I had to comment out the "pargs" check (which is just a sanity check anyway). That should either be replaced with something that works across platforms, or replaced with a platform-specific check, or made overridable (e.g., with a "-f" flag). The other change is that reqEval now emits an (err, result) tuple, where the result looks like:
That change is needed in both places where we call "reqEval" in order for "ncore" to work on Node 0.8 and later. I'd happily take pull requests to apply these changes properly. I'd like to keep this module working for platforms that can't make use of native OS core files to debug Node programs, but unfortunately I don't have much time to spend on it. |
@davepacheco I'll try that, but according to you can node-panic be used to debug infinite loop problems? I'm almost sure this is what's happening to our program in production. If it relies on some kind of REPL, then, I'm afraid we won't be able to connect to the process because of course, we'll never reach the "connected" callback. Am I understanding this correctly? Thanks, |
That's not a problem. We modified Node back in the 0.4 days to support opening the debugger port even if the Node program itself is stuck in an infinite loop, and V8 is able to evaluate expressions in this context. The README in this repo contains an example of doing exactly that, though it has to be modified as I described above because of changes to the debugger API. It does work, though -- I tested it on OS X yesterday, and did it again just now (again, with the above changes):
Notice that the stack trace includes my function "func", that function's call to caDebugState.set, followed by the debugger frames. So if I didn't already know where this program was looping, I'd now see it was in func(). This worked even though the Node program was stuck in a loop. |
I'm afraid the patch does not work great on Debian. Here is what I did:
In another window:
Not sure what I'm doing wrong, but I'm completely unable to connect to the process with an infinite loop. We're using node -v v0.10.2. |
Is there a way for you to tell whether the Node program opened the debug port? Is there a way to see the native stack trace of the program? (I'm not sure what the GNU/Linux equivalent is, but on SmartOS you'd use "pfiles" and "pstack" for this, respectively.) |
Hello
I'm trying to run ncore on a linux (debian) box and well it seems that it requires "pargs", which I have no idea where to find:
Any clue?
The text was updated successfully, but these errors were encountered: