2

当我尝试在 cqlsh 中使用帮助命令时,出现段错误:

Connected to Test Cluster at localhost:9160.
[cqlsh 4.0.1 | Cassandra 2.0.1 | CQL spec 3.1.1 | Thrift protocol 19.37.0]
Use HELP for help.
cqlsh> help
Segmentation fault: 11

Cassandra 是使用自制软件安装的。爪哇版:

java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

我试图在 cassandra-env.sh 中更改每个线程的堆栈大小。

我尝试的值:256k、300k、512k、1024k。

我通过执行命令验证了 cassandra 使用这些值:

cassandra -f

堆栈大小为 300k 的输出:

xss =  -ea -javaagent:/usr/local/Cellar/cassandra/2.0.1/jamm-0.2.5.jar -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms4G -Xmx4G -Xmn800M -XX:+HeapDumpOnOutOfMemoryError -Xss300k

我在 OS X Mavericks 上,如果相关的话,我有 16 GB 的 RAM。

编辑:

我对 cassandra-cli 没有类似的问题。

根据 Nikolai Grigoriev 的建议,我查看了系统日志:

cat system.log | tail -n 20

相关输出:

Oct 29 23:10:12 Andrews-MacBook-Pro.local ReportCrash[5690]: Saved crash report for python[5685] version 0 to /Users/andrew/Library/Logs/DiagnosticReports/python_2013-10-29-231012_Andrews-MacBook-Pro.crash

输出:

cat /Users/andrew/Library/Logs/DiagnosticReports/python_2013-10-29-231012_Andrews-MacBook-Pro.crash

在这儿:

Process:         python [5685]
Path:            /Users/USER/*/python
Identifier:      python
Version:         0
Code Type:       X86-64 (Native)
Parent Process:  bash [1330]
Responsible:     iTerm [1313]
User ID:         501

Date/Time:       2013-10-29 23:10:10.697 +0100
OS Version:      Mac OS X 10.9 (13A603)
Report Version:  11
Anonymous UUID:  xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Sleep/Wake UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000

VM Regions Near 0:
-->
    __TEXT                 0000000109ab3000-0000000109ab4000 [    4K] r-x/rwx SM=COW  /Users/USER/*

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   readline.so                     0x000000010a229f17 call_readline + 599 (readline.c:1087)
1   libpython2.7.dylib              0x0000000109abb354 PyOS_Readline + 244 (myreadline.c:211)
2   libpython2.7.dylib              0x0000000109b50fdd builtin_raw_input + 365 (bltinmodule.c:2046)
3   libpython2.7.dylib              0x0000000109b57e2b PyEval_EvalFrameEx + 18011 (ceval.c:4021)
4   libpython2.7.dylib              0x0000000109b5b0e7 PyEval_EvalCodeEx + 2103 (ceval.c:3253)
5   libpython2.7.dylib              0x0000000109b5b298 fast_function + 296 (ceval.c:4117)
6   libpython2.7.dylib              0x0000000109b57edd PyEval_EvalFrameEx + 18189 (ceval.c:4042)
7   libpython2.7.dylib              0x0000000109b5b0e7 PyEval_EvalCodeEx + 2103 (ceval.c:3253)
8   libpython2.7.dylib              0x0000000109b5b298 fast_function + 296 (ceval.c:4117)
9   libpython2.7.dylib              0x0000000109b57edd PyEval_EvalFrameEx + 18189 (ceval.c:4042)
10  libpython2.7.dylib              0x0000000109b5b0e7 PyEval_EvalCodeEx + 2103 (ceval.c:3253)
11  libpython2.7.dylib              0x0000000109ae83cb function_call + 347 (funcobject.c:526)
12  libpython2.7.dylib              0x0000000109abfa21 PyObject_Call + 97 (abstract.c:2529)
13  libpython2.7.dylib              0x0000000109b5879a PyEval_EvalFrameEx + 20426 (ceval.c:4334)
14  libpython2.7.dylib              0x0000000109b5b0e7 PyEval_EvalCodeEx + 2103 (ceval.c:3253)
15  libpython2.7.dylib              0x0000000109b5b166 PyEval_EvalCode + 54 (ceval.c:665)
16  libpython2.7.dylib              0x0000000109b79934 PyRun_FileExFlags + 164 (pythonrun.c:1354)
17  libpython2.7.dylib              0x0000000109b7abe8 PyRun_SimpleFileExFlags + 392 (pythonrun.c:943)
18  libpython2.7.dylib              0x0000000109b8e3da Py_Main + 2874 (main.c:639)
19  libdyld.dylib                   0x00007fff90eee5fd start + 1

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000000000000  rbx: 0x0000000000000004  rcx: 0x00007fa1f8d00000  rdx: 0x0000000000000000
  rdi: 0x0000000000000000  rsi: 0x00007fa1f8dbbcf0  rbp: 0x00007fff5614b970  rsp: 0x00007fff5614b8a0
   r8: 0x00007fa1f8d00000   r9: 0x0000000000000bbc  r10: 0x000000000020000b  r11: 0x0000000000000001
  r12: 0x00007fff5614b8c0  r13: 0x00007fa1f8d0dc00  r14: 0x0000000000000001  r15: 0x000000010a252960
  rip: 0x000000010a229f17  rfl: 0x0000000000010206  cr2: 0x0000000000000000

Logical CPU:     0
Error Code:      0x00000004
Trap Number:     14


Binary Images:
       0x109ab3000 -        0x109ab3ff7 +python (0) <7A897AB3-9853-3A76-93BE-F864DB4ECC8D> /Users/USER/*/python
       0x109ab6000 -        0x109bf2fff +libpython2.7.dylib (0) <A6E60E14-9E72-34C5-874C-600772A7F298> /Users/USER/*/libpython2.7.dylib
       0x10a0e2000 -        0x10a0e8ff7 +itertools.so (0) <045A60E6-26D8-394A-B37E-F25D54307FED> /Users/USER/*/itertools.so
       0x10a0f3000 -        0x10a0f4fff +_functools.so (0) <765061F4-C740-386C-B0EF-73D9E03AECB2> /Users/USER/*/_functools.so
       0x10a0f7000 -        0x10a10bff7 +_ctypes.so (0) <5406D7E2-2D30-313B-B3B6-46EB46F31F8B> /Users/USER/*/_ctypes.so
       0x10a11c000 -        0x10a120ff7 +_struct.so (0) <374ECB70-B58E-3D8A-9E1D-65A5F4F62D7C> /Users/USER/*/_struct.so
       0x10a128000 -        0x10a12bff7 +strop.so (0) <14A6EEF5-4C55-32D1-B8CF-5EDE2E43B7B2> /Users/USER/*/strop.so
       0x10a130000 -        0x10a132fff +time.so (0) <DA27EF10-D49C-3536-879D-237E5A73EC45> /Users/USER/*/time.so
       0x10a138000 -        0x10a13cfff +operator.so (0) <FECCF5F1-1BE1-316D-BFC0-C3F841DC9DE8> /Users/USER/*/operator.so
       0x10a143000 -        0x10a144ff7 +_locale.so (0) <EE16349A-9907-3DEA-B419-7E39D4C6DCF2> /Users/USER/*/_locale.so
       0x10a148000 -        0x10a14bff7 +_collections.so (0) <F2E4C6A7-C3E8-3AC5-9153-16A76BC0B857> /Users/USER/*/_collections.so
       0x10a151000 -        0x10a151ff7 +_bisect.so (0) <6E1E38C3-D597-356F-9CCF-D077E2030B7B> /Users/USER/*/_bisect.so
       0x10a154000 -        0x10a155ff7 +_heapq.so (0) <B5765696-25FC-36F3-9CD8-B5F02E69DE5F> /Users/USER/*/_heapq.so
       0x10a219000 -        0x10a21cfff +_csv.so (0) <417DF404-51EB-3D9B-9F13-96C971352277> /Users/USER/*/_csv.so
       0x10a222000 -        0x10a223ff7 +cStringIO.so (0) <9ABC813E-BDA3-3129-A31C-564144C1821C> /Users/USER/*/cStringIO.so
       0x10a228000 -        0x10a22afff +readline.so (0) <1DD349FC-7CCC-3D87-98C1-39EE6AFE5226> /Users/USER/*/readline.so
       0x10a231000 -        0x10a24fffb  libedit.3.dylib (39) <1B0596DB-F336-32E7-BB9F-51BF70DB5305> /usr/lib/libedit.3.dylib
       0x10a260000 -        0x10a266fff +math.so (0) <B8D32AA6-1136-3D9B-8F3D-063E373CE751> /Users/USER/*/math.so
       0x10a26d000 -        0x10a274ff7 +_socket.so (0) <9B1A31D6-C635-34F7-A605-82CD7FAAB760> /Users/USER/*/_socket.so
       0x10a27e000 -        0x10a282fff +_ssl.so (0) <C1F761A1-803F-34C0-99D6-61E90020294E> /Users/USER/*/_ssl.so
       0x10a288000 -        0x10a295fff +datetime.so (0) <C0564CBB-516A-385B-8B96-6767B73BEDC3> /Users/USER/*/datetime.so
       0x10a2a1000 -        0x10a2a6fff +_json.so (0) <293437E3-C642-3B8C-85A1-9AB3304B3F05> /Users/USER/*/_json.so
       0x10a2ab000 -        0x10a2adff7 +binascii.so (0) <46D54602-4338-36A3-85BC-4866FAEA6036> /Users/USER/*/binascii.so
       0x10a2b1000 -        0x10a2b4fff +select.so (0) <C84B6BEF-4DE8-3BD1-8B5D-BD8E22295D6E> /Users/USER/*/select.so
       0x10a2ba000 -        0x10a2bbff7 +fcntl.so (0) <B687409B-BF1D-3104-82A5-BF0F642185B6> /Users/USER/*/fcntl.so
       0x10a3bf000 -        0x10a3c2ff7 +zlib.so (0) <E3BB63E5-B4ED-35D2-80CB-C3614CCDAA22> /Users/USER/*/zlib.so
       0x10a447000 -        0x10a449ff7 +fastbinary.so (0) <AAF034FA-51DB-38A0-BF1C-01F5C19B1D46> /Users/USER/*/fastbinary.so
    0x7fff6d77e000 -     0x7fff6d7b1817  dyld (239.3) <D1DFCF3F-0B0C-332A-BCC0-87A851B570FF> /usr/lib/dyld
    0x7fff882c8000 -     0x7fff882caff3  libsystem_configuration.dylib (596.12) <C4F633D9-94C8-35D9-BB2D-84C5122533C7> /usr/lib/system/libsystem_configuration.dylib
    0x7fff88365000 -     0x7fff883eeff7  libsystem_c.dylib (997.1.1) <61833FAA-7281-3FF9-937F-686B6F20427C> /usr/lib/system/libsystem_c.dylib
    0x7fff88488000 -     0x7fff884caff7  libauto.dylib (185.5) <F45C36E8-B606-3886-B5B1-B6745E757CA8> /usr/lib/libauto.dylib
    0x7fff88c80000 -     0x7fff88c87fff  libcompiler_rt.dylib (35) <4CD916B2-1B17-362A-B403-EF24A1DAC141> /usr/lib/system/libcompiler_rt.dylib
    0x7fff88ff2000 -     0x7fff890d1fff  libcrypto.0.9.8.dylib (50) <B95B9DBA-39D3-3EEF-AF43-44608B28894E> /usr/lib/libcrypto.0.9.8.dylib
    0x7fff897c8000 -     0x7fff897c9fff  libunc.dylib (28) <62682455-1862-36FE-8A04-7A6B91256438> /usr/lib/system/libunc.dylib
    0x7fff897e3000 -     0x7fff897e5ff7  libquarantine.dylib (71) <7A1A2BCB-C03D-3A25-BFA4-3E569B2D2C38> /usr/lib/system/libquarantine.dylib
    0x7fff89830000 -     0x7fff8984afff  libdispatch.dylib (339.1.9) <46878A5B-4248-3057-962C-6D4A235EEF31> /usr/lib/system/libdispatch.dylib
    0x7fff89f8d000 -     0x7fff89f8efff  com.apple.TrustEvaluationAgent (2.0 - 25) <334A82F4-4AE4-3719-A511-86D0B0723E2B> /System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/TrustEvaluationAgent
    0x7fff8a3e9000 -     0x7fff8a3f3fff  libcommonCrypto.dylib (60049) <8C4F0CA0-389C-3EDC-B155-E62DD2187E1D> /usr/lib/system/libcommonCrypto.dylib
    0x7fff8a46d000 -     0x7fff8a46effb  libremovefile.dylib (33) <3543F917-928E-3DB2-A2F4-7AB73B4970EF> /usr/lib/system/libremovefile.dylib
    0x7fff8a91f000 -     0x7fff8a925ff7  libsystem_platform.dylib (24.1.4) <331BA4A5-55CE-3B95-99EB-44E0C89D7FB8> /usr/lib/system/libsystem_platform.dylib
    0x7fff8ad08000 -     0x7fff8ad19ff7  libz.1.dylib (53) <42E0C8C6-CA38-3CA4-8619-D24ED5DD492E> /usr/lib/libz.1.dylib
    0x7fff8ad8a000 -     0x7fff8adbefff  libssl.0.9.8.dylib (50) <B15F967C-B002-36C2-9621-3456D8509F50> /usr/lib/libssl.0.9.8.dylib
    0x7fff8aee2000 -     0x7fff8aefeff7  libsystem_kernel.dylib (2422.1.72) <D14913DB-47F1-3591-8DAF-D4B4EF5F8818> /usr/lib/system/libsystem_kernel.dylib
    0x7fff8b98e000 -     0x7fff8b992fff  libsystem_stats.dylib (93.1.26) <B9E26A9E-FBBC-3938-B8B7-6CF7CA8C99AD> /usr/lib/system/libsystem_stats.dylib
    0x7fff8bc70000 -     0x7fff8bc71ff7  libsystem_blocks.dylib (63) <FB856CD1-2AEA-3907-8E9B-1E54B6827F82> /usr/lib/system/libsystem_blocks.dylib
    0x7fff8cb46000 -     0x7fff8cb4bff7  libunwind.dylib (35.3) <78DCC358-2FC1-302E-B395-0155B47CB547> /usr/lib/system/libunwind.dylib
    0x7fff8ccec000 -     0x7fff8ce99f27  libobjc.A.dylib (551.1) <AD7FD984-271E-30F4-A361-6B20319EC73B> /usr/lib/libobjc.A.dylib
    0x7fff8d889000 -     0x7fff8d88aff7  libDiagnosticMessagesClient.dylib (100) <4CDB0F7B-C0AF-3424-BC39-495696F0DB1E> /usr/lib/libDiagnosticMessagesClient.dylib
    0x7fff8dd93000 -     0x7fff8dd93ff7  libkeymgr.dylib (28) <3AA8D85D-CF00-3BD3-A5A0-E28E1A32A6D8> /usr/lib/system/libkeymgr.dylib
    0x7fff8e0cd000 -     0x7fff8e0d2fff  libmacho.dylib (845) <1D2910DF-C036-3A82-A3FD-44FF73B5FF9B> /usr/lib/system/libmacho.dylib
    0x7fff8e511000 -     0x7fff8e518ff7  liblaunch.dylib (842.1.4) <FCBF0A02-0B06-3F97-9248-5062A9DEB32C> /usr/lib/system/liblaunch.dylib
    0x7fff8e5c8000 -     0x7fff8e5efffb  libsystem_info.dylib (449.1.3) <7D41A156-D285-3849-A2C3-C04ADE797D98> /usr/lib/system/libsystem_info.dylib
    0x7fff8e8af000 -     0x7fff8e8b0ff7  libSystem.B.dylib (1197.1.1) <BFC0DC97-46C6-3BE0-9983-54A98734897A> /usr/lib/libSystem.B.dylib
    0x7fff8ee3b000 -     0x7fff8eff3ff3  libicucore.A.dylib (511.25) <3ED7B656-416E-3071-AEC8-E85C90232F78> /usr/lib/libicucore.A.dylib
    0x7fff90c52000 -     0x7fff90c59ff7  libsystem_pthread.dylib (53.1.4) <AB498556-B555-310E-9041-F67EC9E00E2C> /usr/lib/system/libsystem_pthread.dylib
    0x7fff90eeb000 -     0x7fff90eeeff7  libdyld.dylib (239.3) <62F4D752-4089-31A8-8B73-B95A68893B3C> /usr/lib/system/libdyld.dylib
    0x7fff9155e000 -     0x7fff91587ff7  libc++abi.dylib (48) <8C16158F-CBF8-3BD7-BEF4-022704B2A326> /usr/lib/libc++abi.dylib
    0x7fff91634000 -     0x7fff91635ff7  libsystem_sandbox.dylib (278.10) <A47E7E11-3C76-318E-B67D-98972B86F094> /usr/lib/system/libsystem_sandbox.dylib
    0x7fff91777000 -     0x7fff9177ffff  libsystem_dnssd.dylib (522.1.11) <270DCF6C-502D-389A-AA9F-DE4624A36FF7> /usr/lib/system/libsystem_dnssd.dylib
    0x7fff91bec000 -     0x7fff91c1cfff  libncurses.5.4.dylib (42) <BF763D62-9149-37CB-B1D2-F66A2510E6DD> /usr/lib/libncurses.5.4.dylib
    0x7fff91fb6000 -     0x7fff91fc7ff7  libsystem_asl.dylib (217.1.4) <655FB343-52CF-3E2F-B14D-BEBF5AAEF94D> /usr/lib/system/libsystem_asl.dylib
    0x7fff92396000 -     0x7fff923b1ff7  libsystem_malloc.dylib (23.1.10) <FFE5C472-B23A-318A-85BF-77CDE61900D1> /usr/lib/system/libsystem_malloc.dylib
    0x7fff932f1000 -     0x7fff9333ffff  libcorecrypto.dylib (161.1) <F3973C28-14B6-3006-BB2B-00DD7F09ABC7> /usr/lib/system/libcorecrypto.dylib
    0x7fff93530000 -     0x7fff93582fff  libc++.1.dylib (120) <4F68DFC5-2077-39A8-A449-CAC5FDEE7BDE> /usr/lib/libc++.1.dylib
    0x7fff93b66000 -     0x7fff93b6fff3  libsystem_notify.dylib (121) <52571EC3-6894-37E4-946E-064B021ED44E> /usr/lib/system/libsystem_notify.dylib
    0x7fff93b8a000 -     0x7fff93b8eff7  libcache.dylib (62) <BDC1E65B-72A1-3DA3-A57C-B23159CAAD0B> /usr/lib/system/libcache.dylib
    0x7fff941a8000 -     0x7fff941cfff7  libsystem_network.dylib (241.3) <8B1E1F1D-A5CC-3BAE-8B1E-ABC84337A364> /usr/lib/system/libsystem_network.dylib
    0x7fff94515000 -     0x7fff94539fff  libxpc.dylib (300.1.17) <4554927A-9467-365C-91F1-5A116989DD7F> /usr/lib/system/libxpc.dylib
    0x7fff94afa000 -     0x7fff94b01ff3  libcopyfile.dylib (103) <5A881779-D0D6-3029-B371-E3021C2DDA5E> /usr/lib/system/libcopyfile.dylib
    0x7fff94c7e000 -     0x7fff94cadfd2  libsystem_m.dylib (3047.16) <B7F0E2E4-2777-33FC-A787-D6430B630D54> /usr/lib/system/libsystem_m.dylib
    0x7fff95794000 -     0x7fff95979ff7  com.apple.CoreFoundation (6.9 - 855.11) <E22C6A1F-8996-349C-905E-96C3BBE07C2F> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 29978
    thread_create: 2
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=78.0M resident=65.2M(84%) swapped_out_or_unallocated=12.8M(16%)
Writable regions: Total=52.1M written=7924K(15%) resident=9.9M(19%) swapped_out=0K(0%) unallocated=42.2M(81%)

REGION TYPE                      VIRTUAL
===========                      =======
Kernel Alloc Once                     4K
MALLOC                             43.6M
MALLOC (admin)                       16K
STACK GUARD                        56.0M
Stack                              8192K
VM_ALLOCATE                          16K
__DATA                             1784K
__LINKEDIT                         66.2M
__TEXT                             11.8M
__UNICODE                           544K
shared memory                         4K
===========                      =======
TOTAL                             188.0M

我从源代码中获取了 Cassandra 的分布。问题仍然存在。它真的是一个 JVM 错误吗?

如何解决?

解决了

这不是 JVM 错误。我使用 pythonbrew 来管理 python 解释器(忘了提)。当我在全局解释器上安装 cql 时,一切都很顺利。显然python路径存在一些问题。然后在使用 Cassandra 时,我将使用全局 python 解释器。

我将问题缩小到pythonbrew。难怪它被弃用了。使用 pyenv 时没有段错误。

4

2 回答 2

2

在运行 cqlsh 时,我遇到了 Python 在 OS X 10.9.5 上崩溃的类似问题。
解决方案是安装https://www.python.org/ftp/python/2.7.9/python-2.7.9-macosx10.6.pkg

于 2015-03-25T19:39:03.387 回答
0

运行其他工具(cassandra-cli 等)时是否有类似的问题?内核日志中是否有任何提示?这很可能是 JVM 本身的错误。Cassandra 默认不包含任何本机库。我想知道自制软件是否还安装了 JNA 库或带有 Cassandra 的 JEMalloc 之类的东西。

我建议从源代码中获取 Cassandra 的发行版(它将是纯 Java)。如果它以相同的方式崩溃 - 这将是一个 JVM 错误。Maverick 的数千个问题之一;(如果没有,请仔细搜索您使用 Cassandra 的自制软件包获得的其他本机库。

于 2013-10-29T16:23:31.273 回答