Closed fengmk2 closed 10 years ago
出现了两次 node: ../src/node_zlib.cc:150: static void node::ZCtx::Write(const v8::FunctionCallbackInfo<v8::Value>&) [with bool async = true]: Assertion
!ctx->pendingclose && "close is pending"' failed.`
导致两个worker都挂了, 而且无法捕获异常
node: ../src/node_zlib.cc:150: static void node::ZCtx::Write(const v8::FunctionCallbackInfov8::Value&) [with bool async = true]: Assertion `!ctx->pendingclose && "close is pending"' failed.
again
$ gdb /home/mk2/git/nvm/v0.11.12/bin/node core
GNU gdb (Ubuntu/Linaro 7.4-2012.04-0ubuntu2.1) 7.4-2012.04
Copyright (C) 2012 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".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/mk2/git/nvm/v0.11.12/bin/node...done.
BFD: Warning: /home/mk2/git/cnpmjs.org/core is truncated: expected core file size >= 18374406108501540851, found: 161480704.
[New LWP 23280]
[New LWP 23282]
[New LWP 23286]
[New LWP 23287]
[New LWP 23297]
[New LWP 23299]
[New LWP 23296]
[New LWP 23298]
warning: Can't read pathname for load map: Input/output error.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Cannot find new threads: generic error
Core was generated by `/home/mk2/git/nvm/v0.11.12/bin/node --debug-port=5860 --harmony-generators /hom'.
Program terminated with signal 6, Aborted.
#0 0x00007f33d22c2425 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) where
#0 0x00007f33d22c2425 in raise () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f33d22c5b8b in abort () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007f33d22bb0ee in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#3 0x00007f33d22bb192 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
#4 0x00000000009827b6 in void node::ZCtx::Write<true>(v8::FunctionCallbackInfo<v8::Value> const&) ()
#5 0x00001523f45af7a2 in ?? ()
#6 0x00007fff6737dba0 in ?? ()
#7 0x00007fff6737dc08 in ?? ()
#8 0x0000000000000007 in ?? ()
#9 0x0000000000000000 in ?? ()
(gdb)
重现模拟代码:
var zlib = require('zlib');
var stream = zlib.createGzip();
stream.write('foo');
stream.close();
// Assertion failed: (!ctx->pending_close_ && "close is pending"), function Write, file ../src/node_zlib.cc, line 150.
stream.write('again');
$ cat .tmp/logs/nodejs_stdout.log.20140503171309
[Fri May 02 2014 05:06:15 GMT+0800 (CST)] [worker:26625] new worker start
[Fri May 02 2014 05:06:15 GMT+0800 (CST)] [worker:26627] new worker start
[Fri May 02 2014 05:06:16 GMT+0800 (CST)] [sync_worker:26628] syncing with all mode
[Fri May 02 2014 05:06:16 GMT+0800 (CST)] [worker:26628] mysql ready, got 9 tables
[Fri May 02 2014 05:06:16 GMT+0800 (CST)] [worker:26627] Server started, registry server listen at 127.0.0.1:7001, web listen at 127.0.0.17002, cluster: true
[Fri May 02 2014 05:06:16 GMT+0800 (CST)] [worker:26627] mysql ready, got 9 tables
[Fri May 02 2014 05:06:17 GMT+0800 (CST)] [worker:26625] Server started, registry server listen at 127.0.0.1:7001, web listen at 127.0.0.17002, cluster: true
[Fri May 02 2014 05:06:17 GMT+0800 (CST)] [worker:26625] mysql ready, got 9 tables
node: ../src/node_zlib.cc:150: static void node::ZCtx::Write(const v8::FunctionCallbackInfo<v8::Value>&) [with bool async = true]: Assertion `!ctx->pending_close_ && "close is pending"' failed.
[Fri May 02 2014 14:06:58 GMT+0800 (CST)] [master:26620] wroker:26625 disconnect, suicide: false, state: disconnected. New worker:17744 fork
[Fri May 02 2014 14:06:58 GMT+0800 (CST)] [worker:17744] new worker start
[Fri May 02 2014 14:06:58 GMT+0800 (CST)] [master:26620] wroker exit: Error: worker 26625 died (code: null, signal: SIGABRT, suicide: false, state: dead)
at EventEmitter.<anonymous> (/home/mk2/git/cnpmjs.org/dispatch.js:43:15)
at EventEmitter.emit (events.js:115:17)
at ChildProcess.<anonymous> (cluster.js:294:15)
at ChildProcess.g (events.js:196:16)
at ChildProcess.EventEmitter.emit (events.js:107:17)
at Process.ChildProcess._handle.onexit (child_process.js:1045:12)
[Fri May 02 2014 14:06:59 GMT+0800 (CST)] [worker:17744] Server started, registry server listen at 127.0.0.1:7001, web listen at 127.0.0.17002, cluster: true
[Fri May 02 2014 14:06:59 GMT+0800 (CST)] [worker:17744] mysql ready, got 9 tables
node: ../src/node_zlib.cc:150: static void node::ZCtx::Write(const v8::FunctionCallbackInfo<v8::Value>&) [with bool async = true]: Assertion `!ctx->pending_close_ && "close is pending"' failed.
[Fri May 02 2014 14:39:58 GMT+0800 (CST)] [master:26620] wroker exit: Error: worker 17744 died (code: null, signal: SIGABRT, suicide: false, state: dead)
at EventEmitter.<anonymous> (/home/mk2/git/cnpmjs.org/dispatch.js:43:15)
at EventEmitter.emit (events.js:115:17)
at ChildProcess.<anonymous> (cluster.js:294:15)
at ChildProcess.g (events.js:196:16)
at ChildProcess.EventEmitter.emit (events.js:107:17)
at Process.ChildProcess._handle.onexit (child_process.js:1045:12)
[Fri May 02 2014 14:40:02 GMT+0800 (CST)] [master:26620] Error: channel closed
at ChildProcess.target.send (child_process.js:413:26)
at sendHelper (cluster.js:597:8)
at RoundRobinHandle.handoff (cluster.js:178:3)
at RoundRobinHandle.distribute (cluster.js:164:20)
node: ../src/node_zlib.cc:150: static void node::ZCtx::Write(const v8::FunctionCallbackInfo<v8::Value>&) [with bool async = true]: Assertion `!ctx->pending_close_ && "close is pending"' failed.
[Fri May 02 2014 22:30:13 GMT+0800 (CST)] [master:26620] AssertionError: Resource leak detected.
at EventEmitter.<anonymous> (cluster.js:334:7)
at EventEmitter.emit (events.js:126:20)
at ChildProcess.<anonymous> (cluster.js:301:15)
at ChildProcess.g (events.js:196:16)
at ChildProcess.EventEmitter.emit (events.js:101:17)
at finish (child_process.js:532:14)
at process._tickCallback (node.js:339:11)
[Fri May 02 2014 22:30:13 GMT+0800 (CST)] [master:26620] wroker exit: Error: worker 26627 died (code: null, signal: SIGABRT, suicide: false, state: dead)
at EventEmitter.<anonymous> (/home/mk2/git/cnpmjs.org/dispatch.js:43:15)
at EventEmitter.emit (events.js:115:17)
at ChildProcess.<anonymous> (cluster.js:294:15)
at ChildProcess.g (events.js:196:16)
at ChildProcess.EventEmitter.emit (events.js:107:17)
at Process.ChildProcess._handle.onexit (child_process.js:1045:12)
Let nginx do the gzip job