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

Abort trap: 6 #5646

Closed
dmitryame opened this issue Mar 10, 2016 · 22 comments
Closed

Abort trap: 6 #5646

dmitryame opened this issue Mar 10, 2016 · 22 comments
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.

Comments

@dmitryame
Copy link

All over sudden I started getting the following error and node just crashes:
DsMacBookPro:TLogServer dmitry$ node app.js
Assertion failed: (handle->type == UV_TCP || handle->type == UV_TTY || handle->type == UV_NAMED_PIPE), function uv___stream_fd, file ../deps/uv/src/unix/stream.c, line 1545.
Abort trap: 6

I really have no idea how to reproduce it. I've seen there were issues related to stream.c which were fixed in the later releases of node.js. Is this issue back and can be addressed again?

@evanlucas
Copy link
Contributor

Can you post the output of uname -a and what version are you seeing this on?

@dmitryame
Copy link
Author

Darwin DsMacBookPro 15.3.0 Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64 x86_64

@MylesBorins
Copy link
Contributor

@dmitryame what version of node are you using?

@dmitryame
Copy link
Author

node --version
v5.8.0

@evanlucas
Copy link
Contributor

Can you run with lldb?

$ lldb -- node app.js
$ run
$ bt

and paste the output? Thanks!

@dmitryame
Copy link
Author

lldb -- node app.js
(lldb) target create "node"
Current executable set to 'node' (x86_64).
(lldb) settings set -- target.run-args "app.js"
(lldb) run
Process 75286 launched: '/usr/local/bin/node' (x86_64)
Assertion failed: (handle->type == UV_TCP || handle->type == UV_TTY || handle->type == UV_NAMED_PIPE), function uv___stream_fd, file ../deps/uv/src/unix/stream.c, line 1545.
Process 75286 stopped

  • thread deps: update openssl to 1.0.1j #1: tid = 0x1a31de, 0x00007fff95282002 libsystem_kernel.dylib__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT frame #0: 0x00007fff95282002 libsystem_kernel.dylib__pthread_kill + 10
    libsystem_kernel.dylib`__pthread_kill:
    -> 0x7fff95282002 <+10>: jae 0x7fff9528200c ; <+20>
    0x7fff95282004 <+12>: movq %rax, %rdi
    0x7fff95282007 <+15>: jmp 0x7fff9527cbdd ; cerror_nocancel
    0x7fff9528200c <+20>: retq
    (lldb) bt
  • thread deps: update openssl to 1.0.1j #1: tid = 0x1a31de, 0x00007fff95282002 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    • frame #0: 0x00007fff95282002 libsystem_kernel.dylib__pthread_kill + 10 frame #1: 0x00007fff951be5c5 libsystem_pthread.dylibpthread_kill + 90
      frame test: don't remove empty.txt on win32 #2: 0x00007fff99fa66e7 libsystem_c.dylibabort + 129 frame #3: 0x00007fff99f6ddf8 libsystem_c.dylib__assert_rtn + 321
      frame Feature Request: HTTP2 #4: 0x0000000100637761 nodeuv___stream_fd + 85 frame #5: 0x0000000100636796 nodeuv__stream_io + 1655
      frame punycode: update to v1.3.2 #6: 0x000000010063d9ca nodeuv__io_poll + 1554 frame #7: 0x000000010062f18b nodeuv_run + 321
      frame modules: adding load linked modules feature #8: 0x0000000100508511 nodenode::Start(int, char**) + 593 frame #9: 0x0000000100002434 nodestart + 52
      (lldb)

@evanlucas
Copy link
Contributor

does bt all show anything else?

@dmitryame
Copy link
Author

(lldb) bt all

@evanlucas
Copy link
Contributor

Do you have any code that you could share? It is a little difficult to identify exactly is causing the issue without having a test case

@dmitryame
Copy link
Author

As far as I can tell, it's failing on line 27 of the following code, the line right after the commented out // console.log(this.activation_code); :

'use strict';

var _ = require('lodash');
var massive = require("massive");

var db = require('../consts').DB;

var Employee = function(properties) {
  _.assign(this, properties);
}


// set id to the employee obejct, call load to populate the rest of the properties
Employee.prototype.load = function () {
  var foundEmployee = db.employees.findOneSync({id: this.id});
  if(foundEmployee) {
    _.assign(this, foundEmployee);
    return this;
  } else {
    return null;// this is error
  }
}

// set activation_code to the employee object, call load to populate the rest of the properties
Employee.prototype.loadByActivationCode = function () {
  // console.log(this.activation_code);
  var foundEmployee = db.employees.findOneSync( { "activation_code" : this.activation_code } );
  if(foundEmployee) {
    _.assign(this, foundEmployee);
    return this;
  } else {
    return null;// this is error
  }
}

@evanlucas
Copy link
Contributor

Ok, I'm going to assume this is related to the database driver from looking at this. What package are you using for database connections?

@dmitryame
Copy link
Author

I'm using massive js with postgresql.

@dmitryame
Copy link
Author

well, actually it was hapeening in that spot in the morning, but now it's not happening in that code any more, I added some trace log after the call that I thought was crashing and it now goes through that line but still Abort trap: 6 somewhere else.

@dmitryame
Copy link
Author

And now that I took out the concole.log it's not happnening any more.
I would still like to try to figure out why is it happening?
I'm sure it will come back at some point and I want to be prepared how to tackle it.
Thank you guys for looking into this issue for me. I'm curious, what else would you recommend I should try doing? Should I uninstall some libraries and install fresh version? How should one approach issues like this one?

@dmitryame
Copy link
Author

It's still happening, in totally different use case now, the same output though.
Help!!!!!!

@Fishrock123 Fishrock123 added the c++ Issues and PRs that require attention from people who are familiar with C++. label Mar 10, 2016
@dmitryame
Copy link
Author

I'm pretty sure it's happening on this line of code:
let data = yield parse.json(this);

@evanlucas
Copy link
Contributor

Without having an actual full test case that reproduces this, it is going to be quite difficult for us to help you debug it. This looks like an issue with a native add on though.

@dmitryame
Copy link
Author

parse.json is native add on?

@evanlucas
Copy link
Contributor

I don't even see where that is

@dmitryame
Copy link
Author

Actually, yes, perhaps it's part of koa-router

//update checkin which includes checkout, duration must be passed as a parameter
.put('/employees/:activation_code/checkins/:checkin_id', function *(next) {
  var employee =
    new Employee({ activation_code: this.params.activation_code});
  employee.loadByActivationCode();

  var checkin = new Checkin(
    {
      id: this.params.checkin_id
    }
  );
  checkin.load();

  if(employee == null || employee.email != checkin.email || employee.user_id != checkin.user_id) {
    this.response.status = 404;
    this.body = { "error" : 'checkin not found' };
  } else {
    // console.log(this);
    let data = yield parse.json(this); // and it fails here
    // console.log(data);

@dmitryame
Copy link
Author

Guys,
I'm really new to all this stuff, can you please help me to understand where the parse.json methods comes from so that I can file the bug accordingly?
Thank you

@dmitryame
Copy link
Author

ok never mind, it comes from co-body npm
thank you for helping me out and letting me think out loud.
The issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++.
Projects
None yet
Development

No branches or pull requests

4 participants