symbol

Fixed : 當準備query時若是發生error時的error handling有問題,cass_prepare_free不能傳入Null
之前沒事而現在有事是因為動到node0上的table所以prepare query會失敗

如果跑test時能夠顯示error log其實可以很快發現

從這篇的以下回應得到靈感
https://github.com/akheron/jansson/issues/451

This segmentation fault is occurring inside the libc malloc. I've only ever seen this happen after memory corruption. I'd suggest testing your program from valgrind to try finding the origin of this memory corruption.

PR253

Can reproduce in node0/node10. Passed in node1.

bazel test //tests:test_scylla

external/bazel_tools/tools/test/test-setup.sh: line 310:    14 Segmentation fault      (core dumped) "${TEST_PATH}" "$@" 2>&1

run scylla_test with gdb

bazel build //tests:test_scylla -c dbg

gdb bazel-bin/tests/test_scylla

(gdb) r
Starting program: /home/yinghan/.cache/bazel/_bazel_yinghan/50d71f58acbd0cc0439ca7ef46f5648e/execroot/__main__/bazel-out/k8-dbg/bin/storage/main_storage 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff5a3b700 (LWP 32356)]
[New Thread 0x7ffff520b700 (LWP 32357)]
[New Thread 0x7ffff4a0a700 (LWP 32358)]
[New Thread 0x7fffeffff700 (LWP 32359)]
[New Thread 0x7fffef7fe700 (LWP 32360)]
[New Thread 0x7fffee9c9700 (LWP 32361)]

Thread 1 "main_storage" received signal SIGSEGV, Segmentation fault.
cass_prepared_free (prepared=0x0) at ./src/prepared.cpp:29
29	./src/prepared.cpp: No such file or directory.
(gdb) bt
#0  cass_prepared_free (prepared=0x0) at ./src/prepared.cpp:29
#1  0x0000555555558506 in insert_transaction_into_edgeTable (session=0x5555555b9e70, transaction=0x7fffffffdb40, trans_num=6)
    at storage/scylla_api.c:373
#2  0x00005555555576c8 in main () at storage/scylla_main.c:43
(gdb) p cass_prepared_free
$1 = {void (const CassPrepared *)} 0x7ffff7143970 <cass_prepared_free(CassPrepared const*)>
(gdb) info symbol 0x7ffff7143970
cass_prepared_free in section .text of /usr/lib/x86_64-linux-gnu/libcassandra.so.2

lookup shared library

LD_DEBUG=libs bazel-bin/tests/test_scylla

calling init: /usr/lib/x86_64-linux-gnu/libcassandra.so.2

lookup symbol

nm -D /usr/lib/x86_64-linux-gnu/libcassandra.so.2


0000000000151ae0 T cass_prepared_bind
0000000000151970 T cass_prepared_free

Select a repo