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

win: coredumps with --abort-on-uncaught-exception #7733

Closed
gibfahn opened this issue Jul 14, 2016 · 5 comments
Closed

win: coredumps with --abort-on-uncaught-exception #7733

gibfahn opened this issue Jul 14, 2016 · 5 comments
Labels
post-mortem Issues and PRs related to the post-mortem diagnostics of Node.js. windows Issues and PRs related to the Windows platform.

Comments

@gibfahn
Copy link
Member

gibfahn commented Jul 14, 2016

  • Version: v6.3.0
  • Platform: Win 7 64bit
  • Subsystem:

Ref: this comment by @mscdex: #6121 (comment)

I've been attempting to get a coredump with node --abort-on-uncaught-exception test.js on Windows. The test fails as expected, but I'm not sure whether the core has been generated and where to find it.

I've checked %localappdata%\Microsoft\Windows\WER.

I checked the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting and there wasn't a LocalDumps key. I've manually added one following these instructions and then rebooted. However I haven't found anything in C:\Gib.

I assume this is a setup problem, but can anyone confirm that it is actually possible to get a core dump from Windows.

cc. @orangemocha

Registry Setup

image

Test Output

C:\gib\code\node_test>node --abort-on-uncaught-exception t.js
Uncaught Input String Too Big

FROM
main (C:\gib\code\node_test\t.js:9:7)
Object.<anonymous> (C:\gib\code\node_test\t.js:14:1)
Module._compile (module.js:541:32)
Object.Module._extensions..js (module.js:550:10)
Module.load (module.js:458:32)
tryModuleLoad (module.js:417:12)
Function.Module._load (module.js:409:3)
Module.runMain (module.js:575:10)
run (bootstrap_node.js:352:7)
startup (bootstrap_node.js:144:9)
bootstrap_node.js:467:3

Test.js

function main() {
  var inputObject = {
    input: ["one", "two", "three", "fifteen", "one hundred"],
    counter:0,
  };

  for(; inputObject.counter< inputObject.input.length; inputObject.counter++) {
    if (inputObject.input[inputObject.counter].length > 8) {
      throw "Input String Too Big";
    }
  }
}

main();
@mscdex mscdex added windows Issues and PRs related to the Windows platform. post-mortem Issues and PRs related to the post-mortem diagnostics of Node.js. labels Jul 14, 2016
@joaocgreis
Copy link
Member

@gibfahn I don't know if WER can be used to generate a dump (that MSDN page says so, but I had the same luck as you). You can accomplish this by using Visual Studio: Open the node.sln solution, then in the Solution Explorer right-click the node project and Set as StartUp Project. Right-click again and select Properties, then under Debugging you can set the Command Arguments to --abort-on-uncaught-exception C:\gib\code\node_test\t.js. (That setting changes with the active configuration, so make sure it matches what you have enabled: Debug or Release.)

Start the debugger and it will stop on the v8 abort. From the Debug menu you can save a dump file if you want.

@gibfahn
Copy link
Member Author

gibfahn commented Jul 22, 2016

Thanks @joaocgreis, that sounds like the easiest graphical way.

I've been trying to script the coredumps though, so I've been looking for a command line utility. It looks like the easiest way is with procdump. I've managed to get a dump file (extension .dmp) with the following command:

procdump -e -ma -x C:\put\dump\here C:\path\to\node.exe --abort-on-uncaught-exception C:\path\to\throw_exception.js
-e      = dump on error
-ma     = full dump
-x      = execute program with arguments

Doesn't look like v8 supports core dumps on Windows natively, so I guess there's no easier method than downloading procdump (which is at least a 600kb Microsoft Sysinternals standalone .exe).

@gibfahn gibfahn closed this as completed Jul 22, 2016
@gibfahn
Copy link
Member Author

gibfahn commented Aug 23, 2016

Looks like this commit in V8 may add coredumps for windows. not sure whether it would work with node --abort-on-uncaught-exception though, or when it will get into node.

Discussion: https://groups.google.com/forum/#!topic/v8-dev/-WQike4xUp8

Commit: v8/v8@49c14f6 (original https://chromium.googlesource.com/v8/v8/+/49c14f63ef1ea94b8d7b5a9dfe939b2dbc02e42e)

@gibfahn
Copy link
Member Author

gibfahn commented Sep 23, 2016

@ofrobots I know it's a long shot, but do you know if it is now possible to get core dumps in Windows in node with --abort-on-uncaught-exception? I'm pretty sure that the above commit is now in Node master (with v8 5.4), but I'm still not getting dumps anywhere. Is it possible that Node needs to do something to enable them (or maybe I misunderstood the above discussion and we still can't get dumps through v8 in windows)?

@refack
Copy link
Contributor

refack commented Jun 30, 2017

It's only been a year #13947 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
post-mortem Issues and PRs related to the post-mortem diagnostics of Node.js. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

No branches or pull requests

4 participants