1

我有一个我正在调用的节点 c++ 插件,它正在为我连接到数据库。它使用内部 c++ 库进行连接,并且在该库的一个调用中我失败了,这是打印的跟踪:

before conn 
zsh: abort (core dumped)  node test_connection.js

我不能透露我班级的所有内部工作,但只是为了理解痕迹,这是它失败的地方:

std::cout << "before conn" << std::endl;        
<library>ConnectionPtr conn = connmgr.open("<databasename>");
std::cout << "after connection" << std::endl;

设置连接并配置它之前的行。单独运行 c++ 代码可以正常工作,并且可以完美连接。所以设置和一切都是正常的。

因此,在 node.js 中运行它会导致它失败。

我已经下载并放置了两个库:

  • node-panic(为 Node.js 提供原始的事后调试工具)
  • segfault-handler(如果引发 SIGSEGV 信号,模块将向 STDERR 和时间戳文件打印本机堆栈跟踪)

但是,如果我在数据库连接信息中放置某种故意的错误,它们将起作用。当信息正确时,它们不会触发,并且我收到了这个毫无意义的(核心转储)消息。

我试过跑步

节点 --log_all test_connection.js

这给了我 v8 吐出的所有东西,但那里没有任何用处。

node --log_suspect test_connection.js //is giving me this: 

suspect-read,process,"noDeprecation"
suspect-read,process,"noDeprecation"
suspect-read,process,"_eval"
suspect-read,process,"noDeprecation"
suspect-read,global,"v8debug"
suspect-read,process,"domain"
suspect-read,Object,"domain"
suspect-read,Array,"toJSON"
suspect-read,Object,"toJSON"
suspect-read,Array,"toJSON"
suspect-read,Object,"O_SYMLINK"
suspect-read,global,"v8debug"
suspect-read,global,"v8debug"
suspect-read,Object,"module_root"
suspect-read,Object,"prepareStackTrace"
suspect-read,Object,"path"
suspect-read,Object,"path"
suspect-read,Object,"path"
suspect-read,global,"panicDbg"
suspect-read,process,"noDeprecation"
suspect-read,Object,"usingDomains"
suspect-read,Object,"_events"
suspect-read,Object,"_maxListeners"
suspect-read,Object,"fd"
suspect-read,Object,"allowHalfOpen"
suspect-read,process,"_events"
suspect-read,Object,"listener"
suspect-read,Object,"_connecting"
suspect-read,Object,"_idleTimeout"
suspect-read,Object,"_connecting"
suspect-read,Object,"_idleTimeout"

但我也没有看到任何可怕的东西。如何获取此核心转储并查看问题所在?

4

0 回答 0