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

leveldown::Database::Close: Program terminated with signal SIGSEGV, Segmentation fault. #1355

Closed
huan opened this issue Jun 17, 2018 · 2 comments
Labels

Comments

@huan
Copy link
Member

huan commented Jun 17, 2018

This will happen when PuppetPadchat run for a while and the bot log out.

That's because we are using FlashStoreSync, which use LevelUp/LevelDown as it's backend.

Currently, LevelDown is v2.0(with FlashStore). Try to upgrade it to v4 and hope this issue will not happen again.

Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f8d2b6be38b in leveldown::Database::Close(Nan::FunctionCallbackInfo<v8::Value> const&) () from /home/zixia/chatie/wechaty/node_modules/leveldown/build/Release/leveldown.node
00:30:10 INFO Io on(logout): from chatie app
00:30:10 VERB Wechaty logout()
00:30:10 VERB PuppetPadchat logout()
00:30:10 VERB PuppetPadchatManager logout()
00:30:10 VERB PuppetPadchatManager releaseCache()
00:30:10 INFO Bot 李卓桓 logouted
00:30:10 INFO IoClient 李卓桓 logouted
Segmentation fault (core dumped)

zixia@sg:~/chatie/wechaty$ gdb /usr/bin/node core
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 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 /usr/bin/node...(no debugging symbols found)...done.
[New LWP 114425]
[New LWP 114430]
[New LWP 114427]
[New LWP 114435]
[New LWP 115887]
[New LWP 114428]
[New LWP 114429]
[New LWP 114434]
[New LWP 114432]
[New LWP 114426]
[New LWP 114433]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `node ./node_modules/.bin/ts-node examples/busy-bot.ts'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f8d2b6be38b in leveldown::Database::Close(Nan::FunctionCallbackInfo<v8::Value> const&) () from /home/zixia/chatie/wechaty/node_modules/leveldown/build/Release/leveldown.node
[Current thread is 1 (Thread 0x7f8d2f013740 (LWP 114425))]
(gdb) bt
#0  0x00007f8d2b6be38b in leveldown::Database::Close(Nan::FunctionCallbackInfo<v8::Value> const&) () from /home/zixia/chatie/wechaty/node_modules/leveldown/build/Release/leveldown.node
#1  0x00007f8d2b6be137 in Nan::imp::FunctionCallbackWrapper () from /home/zixia/chatie/wechaty/node_modules/leveldown/build/Release/leveldown.node
#2  0x0000000000b00989 in ?? ()
#3  0x0000000000b014f9 in v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) ()
#4  0x0000263daa6041bd in ?? ()
@huan
Copy link
Member Author

huan commented Jun 19, 2018

With LevelDown v4, the problem still exists:

05:36:16 WARN Io initWebSocket() close event[1006: ]
05:36:16 WARN Io reconnect() will reconnect after 0 s
05:52:03 WARN PadchatRpc initWebSocket() ws.on(close) 1006
05:52:03 WARN PuppetPadchat startManager() manager.on(reset) for ws.on(close, 1006. Restarting PuppetPadchat ... 
05:52:03 INFO Bot 李卓桓 logouted
05:52:03 INFO IoClient 李卓桓 logouted
Segmentation fault (core dumped)

$ grep level node_modules/flash-store/package.json                                          
    "leveldown": "^4.0.1",

$ gdb /usr/bin/node core
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 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 /usr/bin/node...(no debugging symbols found)...done.
[New LWP 45622]
[New LWP 45627]
[New LWP 45645]
[New LWP 45646]
[New LWP 45626]
[New LWP 45647]
[New LWP 45625]
[New LWP 45650]
[New LWP 45624]
[New LWP 45644]
[New LWP 45623]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `node ./node_modules/.bin/ts-node examples/busy-bot.ts'.
Program terminated with signal SIGSEGV, Segmentation fault.

(gdb) bt
#0  0x00007fee059bee4c in leveldown::Database::Close(Nan::FunctionCallbackInfo<v8::Value> const&) ()
   from /home/zixia/chatie/wechaty/node_modules/flash-store/node_modules/leveldown/build/Release/leveldown.node
#1  0x00007fee059bd1c7 in Nan::imp::FunctionCallbackWrapper ()
   from /home/zixia/chatie/wechaty/node_modules/flash-store/node_modules/leveldown/build/Release/leveldown.node
#2  0x0000000000b00989 in ?? ()
#3  0x0000000000b014f9 in v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*)
    ()

@huan
Copy link
Member Author

huan commented Jul 3, 2018

After switching to nosql-leveldb, it seems this issue was solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant