Skip to content

coredump when loading a dynamic library file. #485

Closed
@dreamyzhang

Description

@dreamyzhang
  • Node.js Version:6.9
  • OS:linux
  • Scope (install, code, runtime, meta, other?):
  • Module (and version) (if relevant):

node will coredump when loading a dynamic library file, and replace with another dynamic library file it will ok. I suspect that it is the problem of memory limit for v8, but not sure and how to solve this problem? the dynamic library file can work well in the binary program of c++.

[ops@smartwindev node-ctp]$ node  --trace_gc -e  ./tduser.js 
[18751:0x3b59730]        8 ms: Scavenge 2.1 (37.0) -> 2.0 (37.0) MB, 0.7 / 0 ms [allocation failure].
[18751:0x3b59730]        9 ms: Scavenge 2.1 (37.0) -> 2.1 (38.0) MB, 0.7 / 0 ms [allocation failure].
[eval]:1
./tduser.js
^
SyntaxError: Unexpected token .
    at Object.exports.runInThisContext (vm.js:76:16)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:556:32)
    at bootstrap_node.js:357:29
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)


strace node tduser.js  
lstat("/home/ops/dreamy/node-ctp", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat("/home/ops/dreamy/node-ctp/build", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat("/home/ops/dreamy/node-ctp/build/Release", {st_mode=S_IFDIR|0775, st_size=4096, ...}) = 0
lstat("/home/ops/dreamy/node-ctp/build/Release/shifctp.node", {st_mode=S_IFREG|0775, st_size=73608, ...}) = 0
clock_gettime(CLOCK_MONOTONIC, {779141, 167992244}) = 0
clock_gettime(CLOCK_MONOTONIC, {779141, 168109721}) = 0
futex(0x7f41f6dcb0d0, FUTEX_WAKE_PRIVATE, 2147483647) = 0
open("/home/ops/dreamy/node-ctp/build/Release/shifctp.node", O_RDONLY|O_CLOEXEC) = 9
read(9, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260u\0\0\0\0\0\0"..., 832) = 832
fstat(9, {st_mode=S_IFREG|0775, st_size=73608, ...}) = 0
mmap(NULL, 2146904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 9, 0) = 0x7f41f39b1000
mprotect(0x7f41f39bc000, 2097152, PROT_NONE) = 0
mmap(0x7f41f3bbc000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0xb000) = 0x7f41f3bbc000
close(9)                                = 0
open("/home/ops/dreamy/node-ctp/linux_api_trade_6.3.6/thosttraderapi.so", O_RDONLY|O_CLOEXEC) = 9
read(9, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0K\20\0\0\0\0\0"..., 832) = 832
fstat(9, {st_mode=S_IFREG|0755, st_size=4281233, ...}) = 0
mmap(NULL, 8168840, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 9, 0) = 0x7f41f31e6000
mprotect(0x7f41f3518000, 2093056, PROT_NONE) = 0
mmap(0x7f41f3717000, 282624, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 9, 0x331000) = 0x7f41f3717000
mmap(0x7f41f375c000, 2442632, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f41f375c000
close(9)                                = 0
mprotect(0x7f41f3bbc000, 4096, PROT_READ) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_ACCERR, si_addr=0x7f41f34aae0e} ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions