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

Segmentation fault when setting ReplicaSet with Node.js 0.8.0 #987

Closed
murvinlai opened this issue Jun 28, 2012 · 14 comments
Closed

Segmentation fault when setting ReplicaSet with Node.js 0.8.0 #987

murvinlai opened this issue Jun 28, 2012 · 14 comments

Comments

@murvinlai
Copy link

When I set the mongoose connection using replicaSet (e.g mongoose.connectSet( )) it will return segmentation fault or this: ../deps/uv/src/uv-common.h:101: uv__req_unregister: Assertion `uv__has_active_reqs(loop)' failed. And kill the program.

but when I just connect to single mongo, then that's ok.

I'm running on Node0.8.0, ubuntu, Mongo is 2.0.2

Here is the bt :

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7001ed8 in ?? () from /lib/libc.so.6
(gdb) ^CQuit
(gdb) bt
#0 0x00007ffff7001ed8 in ?? () from /lib/libc.so.6
#1 0x00000000005fbdc3 in uvstream_destroy (stream=0xed7ac0) at ../deps/uv/src/unix/stream.c:124
#2 0x00000000005e96b6 in uvfinishclose (loop=0xe7b520) at ../deps/uv/src/unix/core.c:151
#3 uvrun_closing_handles (loop=0xe7b520) at ../deps/uv/src/unix/core.c:181
#4 uv_run (loop=0xe7b520) at ../deps/uv/src/unix/core.c:259
#5 0x00000000005e97f0 in uv_run (loop=0xe7b520) at ../deps/uv/src/unix/core.c:265
#6 0x000000000059e6c5 in node::Start(int, char**) ()
#7 0x00007ffff6ca1c4d in __libc_start_main () from /lib/libc.so.6
#8 0x00000000005949fd in _start ()

@aheckmann
Copy link
Collaborator

This is either a bug in node or the mongo driver. Please provide mongoose and Ubuntu versions as well.

cc @christkv

On Jun 27, 2012, at 5:30 PM, Murvin Laireply@reply.github.com wrote:

When I set the mongoose connection using replicaSet (e.g mongoose.connectSet( )) it will return segmentation fault or this: ../deps/uv/src/uv-common.h:101: uv__req_unregister: Assertion `uv__has_active_reqs(loop)' failed. And kill the program.

but when I just connect to single mongo, then that's ok.

I'm running on Node0.8.0, ubuntu, Mongo is 2.0.2

Here is the bt :

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7001ed8 in ?? () from /lib/libc.so.6
(gdb) ^CQuit
(gdb) bt
#0 0x00007ffff7001ed8 in ?? () from /lib/libc.so.6
#1 0x00000000005fbdc3 in uvstream_destroy (stream=0xed7ac0) at ../deps/uv/src/unix/stream.c:124
#2 0x00000000005e96b6 in uvfinishclose (loop=0xe7b520) at ../deps/uv/src/unix/core.c:151
#3 uvrun_closing_handles (loop=0xe7b520) at ../deps/uv/src/unix/core.c:181
#4 uv_run (loop=0xe7b520) at ../deps/uv/src/unix/core.c:259
#5 0x00000000005e97f0 in uv_run (loop=0xe7b520) at ../deps/uv/src/unix/core.c:265
#6 0x000000000059e6c5 in node::Start(int, char**) ()
#7 0x00007ffff6ca1c4d in __libc_start_main () from /lib/libc.so.6
#8 0x00000000005949fd in _start ()


Reply to this email directly or view it on GitHub:
#987

@aheckmann
Copy link
Collaborator

or libuv

On Jun 27, 2012, at 5:30 PM, Murvin Laireply@reply.github.com wrote:

When I set the mongoose connection using replicaSet (e.g mongoose.connectSet( )) it will return segmentation fault or this: ../deps/uv/src/uv-common.h:101: uv__req_unregister: Assertion `uv__has_active_reqs(loop)' failed. And kill the program.

but when I just connect to single mongo, then that's ok.

I'm running on Node0.8.0, ubuntu, Mongo is 2.0.2

Here is the bt :

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7001ed8 in ?? () from /lib/libc.so.6
(gdb) ^CQuit
(gdb) bt
#0 0x00007ffff7001ed8 in ?? () from /lib/libc.so.6
#1 0x00000000005fbdc3 in uvstream_destroy (stream=0xed7ac0) at ../deps/uv/src/unix/stream.c:124
#2 0x00000000005e96b6 in uvfinishclose (loop=0xe7b520) at ../deps/uv/src/unix/core.c:151
#3 uvrun_closing_handles (loop=0xe7b520) at ../deps/uv/src/unix/core.c:181
#4 uv_run (loop=0xe7b520) at ../deps/uv/src/unix/core.c:259
#5 0x00000000005e97f0 in uv_run (loop=0xe7b520) at ../deps/uv/src/unix/core.c:265
#6 0x000000000059e6c5 in node::Start(int, char**) ()
#7 0x00007ffff6ca1c4d in __libc_start_main () from /lib/libc.so.6
#8 0x00000000005949fd in _start ()


Reply to this email directly or view it on GitHub:
#987

@christkv
Copy link

this happening using the pure js bson driver then it's definitively a possible case for a 0.8 bug.

@christkv
Copy link

I'm also not seeing this while running the test suite for replicasets.

@aheckmann
Copy link
Collaborator

yeah unable to repro on my Mac. will try Ubuntu today.

On Jun 27, 2012, at 5:30 PM, Murvin Laireply@reply.github.com wrote:

When I set the mongoose connection using replicaSet (e.g mongoose.connectSet( )) it will return segmentation fault or this: ../deps/uv/src/uv-common.h:101: uv__req_unregister: Assertion `uv__has_active_reqs(loop)' failed. And kill the program.

but when I just connect to single mongo, then that's ok.

I'm running on Node0.8.0, ubuntu, Mongo is 2.0.2

Here is the bt :

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7001ed8 in ?? () from /lib/libc.so.6
(gdb) ^CQuit
(gdb) bt
#0 0x00007ffff7001ed8 in ?? () from /lib/libc.so.6
#1 0x00000000005fbdc3 in uvstream_destroy (stream=0xed7ac0) at ../deps/uv/src/unix/stream.c:124
#2 0x00000000005e96b6 in uvfinishclose (loop=0xe7b520) at ../deps/uv/src/unix/core.c:151
#3 uvrun_closing_handles (loop=0xe7b520) at ../deps/uv/src/unix/core.c:181
#4 uv_run (loop=0xe7b520) at ../deps/uv/src/unix/core.c:259
#5 0x00000000005e97f0 in uv_run (loop=0xe7b520) at ../deps/uv/src/unix/core.c:265
#6 0x000000000059e6c5 in node::Start(int, char**) ()
#7 0x00007ffff6ca1c4d in __libc_start_main () from /lib/libc.so.6
#8 0x00000000005949fd in _start ()


Reply to this email directly or view it on GitHub:
#987

@murvinlai
Copy link
Author

mongoose@2.7.1
and
Ubuntu 10.04.4

@murvinlai
Copy link
Author

Sample program:

var mongoose = require('mongoose');
var express = require('express');
var db_replica_set_path = 'mongodb://10.100.10.190:27017/mydatabase,10.100.10.190:27018/mydatabase';
mongoose.connectSet(db_replica_set_path);

var app = express.createServer();

app.get('/test', function (req, res) {
res.send("OK");
});

app.listen(3445);

------------- RESULT------------------

$ sudo node test-mongoose.js
node: ../src/tcp_wrap.cc:353: static void node::TCPWrap::AfterConnect(uv_connect_t*, int): Assertion `req_wrap->object_.IsEmpty() == false' failed.
Aborted


or just:
var mongoose = require('mongoose');
var db_replica_set_path = 'mongodb://10.100.10.190:27017/mydatabase,10.100.10.190:27018/mydatabase';
mongoose.connectSet(db_replica_set_path);

will return the same thing.

@aheckmann
Copy link
Collaborator

did this work on node 0.6.19?

@aheckmann
Copy link
Collaborator

reproduced it on ubuntu 12.04.

the fix: prefix your hosts with "mongodb://"

var db_replica_set_path = 'mongodb://10.100.10.190:27017/mydatabase,mongodb://10.100.10.190:27018/mydatabase';
mongoose.connectSet(db_replica_set_path);

@aheckmann aheckmann reopened this Jun 28, 2012
@aheckmann
Copy link
Collaborator

need to put a check in place for this.

@aheckmann
Copy link
Collaborator

works fine on node 0.6.19. node 0.8 bug.

@murvinlai
Copy link
Author

It worked on Node 0.6.19 but not 0.8.0

@murvinlai
Copy link
Author

yes.. the fix works. has to put mongodb:// for every ip/ url.
thanks. :)

@aheckmann
Copy link
Collaborator

mongoose was broken and passing through invalid host/ports.

vedmalex pushed a commit to vedmalex/mongoose that referenced this issue Jul 5, 2012
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

3 participants