cnpm / cnpmjs.org

‼️ ‼️ ‼️ ‼️ DEPRECATED, please use https://github.com/cnpm/cnpmcore ‼️ ‼️ ‼️ ‼️
https://npmmirror.com
Other
3.55k stars 749 forks source link

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. #335

Closed fengmk2 closed 10 years ago

fengmk2 commented 10 years ago
SyntaxError: Unexpected token <
    at Object.parse (native)
    at Object.request (/home/mk2/git/cnpmjs.org/node_modules/co-urllib/lib/urllib.js:341:21)
    at GeneratorFunctionPrototype.next (native)
    at request (/home/mk2/git/cnpmjs.org/proxy/npm.js:33:23)
    at GeneratorFunctionPrototype.next (native)
    at Object.exports.get (/home/mk2/git/cnpmjs.org/proxy/npm.js:57:18)
    at GeneratorFunctionPrototype.next (native)
    at Object.next (/home/mk2/git/cnpmjs.org/node_modules/co/index.js:77:21)
    at Object.<anonymous> (/home/mk2/git/cnpmjs.org/node_modules/co/index.js:96:18)
    at /home/mk2/git/cnpmjs.org/node_modules/co-urllib/node_modules/co-assert-timeout/index.js:30:12
SyntaxError: Unexpected token <
    at Object.parse (native)
    at Object.request (/home/mk2/git/cnpmjs.org/node_modules/co-urllib/lib/urllib.js:341:21)
    at GeneratorFunctionPrototype.next (native)
    at request (/home/mk2/git/cnpmjs.org/proxy/npm.js:33:23)
    at GeneratorFunctionPrototype.next (native)
    at Object.exports.get (/home/mk2/git/cnpmjs.org/proxy/npm.js:57:18)
    at GeneratorFunctionPrototype.next (native)
    at Object.next (/home/mk2/git/cnpmjs.org/node_modules/co/index.js:77:21)
    at Object.<anonymous> (/home/mk2/git/cnpmjs.org/node_modules/co/index.js:96:18)
    at /home/mk2/git/cnpmjs.org/node_modules/co-urllib/node_modules/co-assert-timeout/index.js:30:12
SyntaxError: Unexpected token <
    at Object.parse (native)
    at Object.request (/home/mk2/git/cnpmjs.org/node_modules/co-urllib/lib/urllib.js:341:21)
    at GeneratorFunctionPrototype.next (native)
    at request (/home/mk2/git/cnpmjs.org/proxy/npm.js:33:23)
    at GeneratorFunctionPrototype.next (native)
    at Object.exports.get (/home/mk2/git/cnpmjs.org/proxy/npm.js:57:18)
    at GeneratorFunctionPrototype.next (native)
    at Object.next (/home/mk2/git/cnpmjs.org/node_modules/co/index.js:77:21)
    at Object.<anonymous> (/home/mk2/git/cnpmjs.org/node_modules/co/index.js:96:18)
    at /home/mk2/git/cnpmjs.org/node_modules/co-urllib/node_modules/co-assert-timeout/index.js:30:12
SyntaxError: Unexpected token <
    at Object.parse (native)
    at Object.request (/home/mk2/git/cnpmjs.org/node_modules/co-urllib/lib/urllib.js:341:21)
    at GeneratorFunctionPrototype.next (native)
    at request (/home/mk2/git/cnpmjs.org/proxy/npm.js:33:23)
    at GeneratorFunctionPrototype.next (native)
    at Object.exports.get (/home/mk2/git/cnpmjs.org/proxy/npm.js:57:18)
    at GeneratorFunctionPrototype.next (native)
    at Object.next (/home/mk2/git/cnpmjs.org/node_modules/co/index.js:77:21)
    at Object.<anonymous> (/home/mk2/git/cnpmjs.org/node_modules/co/index.js:96:18)
    at /home/mk2/git/cnpmjs.org/node_modules/co-urllib/node_modules/co-assert-timeout/index.js:30:12
SyntaxError: Unexpected token <
    at Object.parse (native)
    at Object.request (/home/mk2/git/cnpmjs.org/node_modules/co-urllib/lib/urllib.js:341:21)
    at GeneratorFunctionPrototype.next (native)
    at request (/home/mk2/git/cnpmjs.org/proxy/npm.js:33:23)
    at GeneratorFunctionPrototype.next (native)
    at Object.exports.get (/home/mk2/git/cnpmjs.org/proxy/npm.js:57:18)
    at GeneratorFunctionPrototype.next (native)
    at Object.next (/home/mk2/git/cnpmjs.org/node_modules/co/index.js:77:21)
    at Object.<anonymous> (/home/mk2/git/cnpmjs.org/node_modules/co/index.js:96:18)
    at /home/mk2/git/cnpmjs.org/node_modules/co-urllib/node_modules/co-assert-timeout/index.js:30:12
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.
[Tue Apr 22 2014 21:51:46 GMT+0800 (CST)] [master:5958] wroker:5963 disconnect, suicide: false, state: disconnected. New worker:15212 fork
[Tue Apr 22 2014 21:51:46 GMT+0800 (CST)] [worker:15212] new worker start
[Tue Apr 22 2014 21:51:46 GMT+0800 (CST)] [master:5958] wroker exit: Error: worker 5963 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)
[Tue Apr 22 2014 21:51:47 GMT+0800 (CST)] [worker:15212] Server started, registry server listen at 127.0.0.1:7001, web listen at 127.0.0.17002, cluster: true
[Tue Apr 22 2014 21:51:47 GMT+0800 (CST)] [worker:15212] mysql ready, got 9 tables
SyntaxError: Unexpected token <
    at Object.parse (native)
    at Object.request (/home/mk2/git/cnpmjs.org/node_modules/co-urllib/lib/urllib.js:341:21)
    at GeneratorFunctionPrototype.next (native)
    at request (/home/mk2/git/cnpmjs.org/proxy/npm.js:33:23)
    at GeneratorFunctionPrototype.next (native)
    at Object.exports.get (/home/mk2/git/cnpmjs.org/proxy/npm.js:57:18)
    at GeneratorFunctionPrototype.next (native)
    at Object.next (/home/mk2/git/cnpmjs.org/node_modules/co/index.js:77:21)
    at Object.<anonymous> (/home/mk2/git/cnpmjs.org/node_modules/co/index.js:96:18)
    at /home/mk2/git/cnpmjs.org/node_modules/co-urllib/node_modules/co-assert-timeout/index.js:30:12
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 Apr 25 2014 04:08:12 GMT+0800 (CST)] [master:5958] wroker exit: Error: worker 15212 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)
events.js:82
      throw er; // Unhandled 'error' event
            ^
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)
fengmk2 commented 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都挂了, 而且无法捕获异常

fengmk2 commented 10 years ago

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

fengmk2 commented 10 years ago
$ 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) 
fengmk2 commented 10 years ago

重现模拟代码:

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');
fengmk2 commented 10 years ago
$ 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)
fengmk2 commented 10 years ago

Let nginx do the gzip job