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

Segfault when passing Uint8Array on Node 0.12 #60

Open
Kagami opened this issue Jul 20, 2015 · 0 comments
Open

Segfault when passing Uint8Array on Node 0.12 #60

Kagami opened this issue Jul 20, 2015 · 0 comments

Comments

@Kagami
Copy link

Kagami commented Jul 20, 2015

Hi. The following code works on Node 0.10 but segfaults on Node 0.12:

$ node -v
v0.12.7
$ cat 1.js
var Worker = require("webworker-threads").Worker;
new Worker(function() {}).postMessage(new Uint8Array(65));

Here is the gdb backtrace with debug symbols:

$ gdb node
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from node...Reading symbols from /usr/lib/debug//usr/bin/nodejs...done.
done.
(gdb) run 1.js
Starting program: /usr/bin/node 1.js
Traceback (most recent call last):
  File "/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19-gdb.py", line 63, in <module>
    from libstdcxx.v6.printers import register_libstdcxx_printers
ImportError: No module named 'libstdcxx'
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff6bca700 (LWP 1779)]
[New Thread 0x7ffff7fe7700 (LWP 1780)]
[New Thread 0x7ffff7fd6700 (LWP 1781)]
[New Thread 0x7ffff7fc5700 (LWP 1782)]
[New Thread 0x7ffff6199700 (LWP 1783)]
[New Thread 0x7ffff5998700 (LWP 1784)]
[New Thread 0x7ffff7fb4700 (LWP 1785)]
[New Thread 0x7ffff7fa3700 (LWP 1786)]
[New Thread 0x7ffff7f92700 (LWP 1787)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff6199700 (LWP 1783)]
0x00000000007981e3 in v8::EscapableHandleScope::EscapableHandleScope(v8::Isolate*) ()
(gdb) bt full
#0  0x00000000007981e3 in v8::EscapableHandleScope::EscapableHandleScope(v8::Isolate*) ()
No symbol table info available.
#1  0x0000000000bb0f25 in node::Buffer::New(v8::Isolate*, char const*, unsigned long) ()
No symbol table info available.
#2  0x00007ffff61b94ea in NanNewBufferHandle (data=0x12d5a46 "", size=65)
    at ../node_modules/nan/nan.h:672
No locals.
#3  0x00007ffff61aef0e in BSONDeserializer::DeserializeValue (this=0x7ffff6198a00, 
    type=BSON_TYPE_BINARY, promoteLongs=true) at ../src/bson.cc:539
        length = 65
        subType = 0
        buffer = {<v8::Handle<v8::Object>> = {val_ = 0x7ffff61999c0}, <No data fields>}
        argv = {{val_ = 0x7ffff6198900}, {val_ = 0x7ffff61b843c <v8::Value::IsNull() const+24>}}
#4  0x00007ffff61ae545 in BSONDeserializer::DeserializeDocumentInternal (this=0x7ffff6198a00, 
    promoteLongs=true) at ../src/bson.cc:427
        type = BSON_TYPE_BINARY
        name = @0x7ffff6198940: {val_ = 0x7ffff0044a38}
        value = @0x0: <error reading variable>
        returnObject = {<v8::Handle<v8::Object>> = {val_ = 0x7ffff0044a30}, <No data fields>}
#5  0x00007ffff61ae491 in BSONDeserializer::DeserializeDocument (this=0x7ffff6198c40, 
    promoteLongs=true) at ../src/bson.cc:414
        length = 81
        documentDeserializer = {bson = 0x7ffff004bdb0, pStart = 0x12d5a3b "\005data", 
          p = 0x12d5a46 "", pEnd = 0x12d5a87 ""}
#6  0x00007ffff61af17f in BSONDeserializer::DeserializeValue (this=0x7ffff6198c40, 
    type=BSON_TYPE_OBJECT, promoteLongs=true) at ../src/bson.cc:576
No locals.
#7  0x00007ffff61ae545 in BSONDeserializer::DeserializeDocumentInternal (this=0x7ffff6198c40, 
    promoteLongs=true) at ../src/bson.cc:427
        type = BSON_TYPE_OBJECT
        name = @0x7ffff6198b80: {val_ = 0x7ffff0044a18}
        value = @0x7ffff6198e10: {val_ = 0x7ffff004bdb0}
        returnObject = {<v8::Handle<v8::Object>> = {val_ = 0x7ffff0044a10}, <No data fields>}
#8  0x00007ffff61ae491 in BSONDeserializer::DeserializeDocument (this=0x7ffff6198e10, 
    promoteLongs=true) at ../src/bson.cc:414
        length = 89
        documentDeserializer = {bson = 0x7ffff004bdb0, pStart = 0x12d5a34 "\003\060", 
          p = 0x12d5a88 "", pEnd = 0x12d5a88 ""}
#9  0x00007ffff61b4ca6 in eventLoop (thread=0x11cc6e0) at ../src/WebWorkerThreads.cc:418
        bson = 0x7ffff004bdb0
        data = 0x12d5a30 "Y"
        i = -166097600
        size = 89
        deserializer = {bson = 0x7ffff004bdb0, pStart = 0x12d5a30 "Y", p = 0x12d5a89 "", 
          pEnd = 0x12d5a88 ""}
        result = {<v8::Handle<v8::Object>> = {val_ = 0x7ffff0044800}, <No data fields>}
        args = {{<v8::Handle<v8::Value>> = {val_ = 0x7ffff00448f8}, <No data fields>}, 
          {<v8::Handle<v8::Value>> = {val_ = 0x7ffff0044908}, <No data fields>}}
        len = 1
        array = {<v8::Handle<v8::Array>> = {val_ = 0x7ffff0044908}, <No data fields>}
        onError = {isolate_ = 0x7ffff00008c0, next_ = 0x0, exception_ = 0x2a4a76804181, 
          message_obj_ = 0x2a4a76804181, message_script_ = 0x2a4a76804181, 
          js_stack_comparable_address_ = 0x7ffff6198c48, message_start_pos_ = 0, 
          message_end_pos_ = 0, is_verbose_ = false, can_continue_ = true, capture_message_ = true, 
          rethrow_ = false, has_terminated_ = false}
        str = 0x12d59f0
        resultado = {<v8::Handle<v8::Value>> = {val_ = 0x7ffff00448f0}, <No data fields>}
        source = {<v8::Handle<v8::String>> = {val_ = 0x7ffff00448b8}, <No data fields>}
        script = {<v8::Handle<v8::Script>> = {val_ = 0x7ffff00448e0}, <No data fields>}
        job = 0x12d59b0
        qitem = 0x11cfc30
        scope = {isolate_ = 0x7ffff00008c0, prev_next_ = 0x0, prev_limit_ = 0x0}
        ctx = {<v8::Handle<v8::Context>> = {val_ = 0x7ffff00443c8}, <No data fields>}
        ctr = 2
        ftmpl = {<v8::Handle<v8::FunctionTemplate>> = {val_ = 0x7ffff00443b0}, <No data fields>}
        otmpl = {<v8::Handle<v8::ObjectTemplate>> = {val_ = 0x7ffff00443c0}, <No data fields>}
        fs_obj = {val_ = 0x7ffff00443f0}
---Type <return> to continue, or q <return> to quit---
        console_obj = {val_ = 0x7ffff0044480}
        dispatchEvents = {<v8::Handle<v8::Object>> = {val_ = 0x7ffff0044818}, <No data fields>}
        dispatchNextTicks = {<v8::Handle<v8::Object>> = {val_ = 0x7ffff0044858}, <No data fields>}
        _ntq = 0x7ffff0044870
        nextTickQueueLength = 0
        extensions = {name_count_ = 0, names_ = 0x0}
        global = {<v8::Handle<v8::Object>> = {val_ = 0x7ffff00443d8}, <No data fields>}
        threadObject = {<v8::Handle<v8::Object>> = {val_ = 0x7ffff0044748}, <No data fields>}
        isolate_scope = {isolate_ = 0x7ffff00008c0}
#10 0x00007ffff61b3acf in aThread (arg=0x11cc6e0) at ../src/WebWorkerThreads.cc:243
        myLocker = {has_lock_ = true, top_level_ = true, isolate_ = 0x7ffff00008c0, 
          static active_ = true}
        dummy = 0
        thread = 0x11cc6e0
#11 0x00007ffff6f98182 in start_thread (arg=0x7ffff6199700) at pthread_create.c:312
        __res = <optimized out>
        pd = 0x7ffff6199700
        now = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {140737322260224, 6434267845187848142, 1, 4, 
                140737322260928, 140737322260224, -6434253325479983154, -6434252500698019890}, 
              mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x0, 0x0}, data = {prev = 0x0, 
              cleanup = 0x0, canceltype = 0}}}
        not_first_call = <optimized out>
        pagesize_m1 = <optimized out>
        sp = <optimized out>
        freesize = <optimized out>
        __PRETTY_FUNCTION__ = "start_thread"
#12 0x00007ffff6cc547d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
No locals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant