cchost : Segmentation fault during load test of 20 puts/s
To Reproduce
Run cchost with worker_threads = 7
Command
./cchost --enclave-file=./libjs_generic.enclave.so.debuggable --enclave-type=debug --node-address=127.0.0.1:0 --node-address-file=0.node_address --rpc-address=127.0.0.1:8000 --rpc-address-file=0.rpc_address --public-rpc-address=127.0.0.1:8000 --ledger-dir=0.ledger --snapshot-dir=0.snapshots --node-cert-file=0.pem --host-log-level=info --raft-election-timeout-ms=4000 --consensus=cft --worker-threads=7 --sig-tx-interval=5000 --sig-ms-interval=1000 --ledger-chunk-bytes=5MB --snapshot-tx-interval=10000 start --network-cert-file=networkcert.pem --constitution=actions.js --constitution=validate.js --constitution=resolve.js --constitution=apply.js --member-info=member0_cert.pem,member0_enc_pubk.pem
Performed load test with 20 simple puts/s to the app.
Node crashed with following logs
2021-07-14T13:17:05.416590Z 100 [fatal] ../src/ds/stacktrace_utils.h:53 | Handled fatal signal 11
#31 Object "/lib/x86_64-linux-gnu/libpthread.so.0", at 0x7f26d55e397f, in
#30 Object "/usr/lib/x86_64-linux-gnu/libsgx_urts.so", at 0x7f26d67b3942, in
#29 Object "./cchost", at 0x4e230c, in
#28 Object "./cchost", at 0x41e3d9, in
#27 Object "./cchost", at 0x4575fb, in
#26 Object "./cchost", at 0x457824, in
#25 Object "/lib/x86_64-linux-gnu/libgcc_s.so.1", at 0x7f26d502c097, in _Unwind_Backtrace
#24 Object "/lib/x86_64-linux-gnu/libgcc_s.so.1", at 0x7f26d502a53f, in
#23 Object "/lib/x86_64-linux-gnu/libpthread.so.0", at 0x7f26d55e397f, in
#22 Object "/usr/lib/x86_64-linux-gnu/libsgx_urts.so", at 0x7f26d67b3942, in
#21 Object "./cchost", at 0x4e230c, in
#20 Object "./cchost", at 0x41e3d9, in
#19 Object "./cchost", at 0x4575fb, in
#18 Object "./cchost", at 0x457824, in
#17 Object "/lib/x86_64-linux-gnu/libgcc_s.so.1", at 0x7f26d502c097, in _Unwind_Backtrace
#16 Object "/lib/x86_64-linux-gnu/libgcc_s.so.1", at 0x7f26d502a53f, in
#15 Object "/lib/x86_64-linux-gnu/libpthread.so.0", at 0x7f26d55e397f, in
#14 Object "/usr/lib/x86_64-linux-gnu/libsgx_urts.so", at 0x7f26d67b3942, in
#13 Object "./cchost", at 0x4e230c, in
#12 Object "./cchost", at 0x41e3d9, in
#11 Object "./cchost", at 0x4575fb, in
#10 Object "./cchost", at 0x457824, in
#9 Object "/lib/x86_64-linux-gnu/libgcc_s.so.1", at 0x7f26d502c097, in _Unwind_Backtrace
#8 Object "/lib/x86_64-linux-gnu/libgcc_s.so.1", at 0x7f26d502a53f, in
#7 Object "/lib/x86_64-linux-gnu/libpthread.so.0", at 0x7f26d55e397f, in
#6 Object "/usr/lib/x86_64-linux-gnu/libsgx_urts.so", at 0x7f26d67b3942, in
#5 Object "./cchost", at 0x4e230c, in
#4 Object "./cchost", at 0x41e3d9, in
#3 Object "./cchost", at 0x4575fb, in
#2 Object "./cchost", at 0x457824, in
#1 Object "/lib/x86_64-linux-gnu/libgcc_s.so.1", at 0x7f26d502c097, in _Unwind_Backtrace
#0 Object "/lib/x86_64-linux-gnu/libgcc_s.so.1", at 0x7f26d502a53f, in
Segmentation fault (Address not mapped to object [0x202])
Expected behavior Puts should succeed
Environment information
vm: DC8
application : TS based app (Daphne PoC)
single node: cchost is run with worker_threads=7
connection pool size: 1000
Additional context
With 10 puts/s,. request are successful
Full logs
2021-07-14T13:09:33.094281Z 100 [info ] ../src/host/main.cpp:460 | Version: ccf-1.0.5
2021-07-14T13:09:33.094320Z 100 [info ] ../src/host/main.cpp:461 | Run with following options:
version=false
enclave-file="./libjs_generic.enclave.so.debuggable"
enclave-type=1
consensus=0
worker-threads=7
node-address="127.0.0.1:0"
node-address-file="0.node_address"
rpc-address="127.0.0.1:8000"
rpc-address-file="0.rpc_address"
public-rpc-address="127.0.0.1:8000"
ledger-dir="0.ledger"
snapshot-dir="0.snapshots"
ledger-chunk-bytes=5000000
snapshot-tx-interval=10000
max-open-sessions=1000
host-log-level=0
log-format-json=false
node-cert-file="0.pem"
node-pid-file="./cchost.pid"
sig-tx-interval=5000
sig-ms-interval=1000
circuit-size-shift=22
raft-timeout-ms=100
raft-election-timeout-ms=4000
bft-view-change-timeout-ms=5000
bft-status-interval-ms=100
max-msg-size=24
max-fragment-size=16
tick-period-ms=10
sn="CN=CCF Node"
jwt-key-refresh-interval-s=1800
memory-reserve-startup=0
curve-id=1
[start]
network-cert-file="networkcert.pem"
constitution="actions.js" "validate.js" "resolve.js" "apply.js"
member-info="member0_cert.pem,member0_enc_pubk.pem"
join.network-cert-file="networkcert.pem"
join.join-timer=1000
recover.network-cert-file="networkcert.pem"
2021-07-14T13:09:33.094336Z 100 [info ] ../src/host/main.cpp:506 | Recovery threshold unset. Defaulting to number of initial consortium members with a public encryption key (1).
2021-07-14T13:09:34.216395Z 100 [info ] ../src/host/ledger.h:787 | Recovered ledger entries up to 0, committed to 0
2021-07-14T13:09:34.216475Z 100 [info ] ../src/host/node_connections.h:179 | Listening for node-to-node on 127.0.0.1:37541
2021-07-14T13:09:34.216519Z 100 [info ] ../src/host/rpc_connections.h:75 | Listening for RPCs on 127.0.0.1:8000
2021-07-14T13:09:34.216696Z 100 [info ] ../src/host/main.cpp:738 | Creating new node: new network (with 1 initial member(s) and 1 member(s) required for recovery)
Azure Quote Provider: libdcap_quoteprov.so [ERROR]: Could not retrieve environment variable for 'AZDCAP_DEBUG_LOG_LEVEL'
2021-07-14T13:09:34.467782Z 100 [info ] ../src/host/main.cpp:817 | Created new node
2021-07-14T13:09:34.468746Z -0.252 0 [info ] ../src/enclave/rpc_sessions.h:55 | Setting max open sessions to 1000
2021-07-14T13:09:34.468755Z -0.252 0 [info ] ../src/consensus/aft/raft.h:2357 | Becoming leader 992f4ebfe82af245128f34bc2093278a9f93905fc001ad202a78b1a76e56a134: 2
2021-07-14T13:09:34.468759Z -0.252 0 [info ] ./src/node/rpc/member_frontend.h:826 | Created service
2021-07-14T13:09:34.468816Z -0.252 0 [info ] ../src/node/node_state.h:1574 | Network TLS connections now accepted
2021-07-14T13:09:34.468820Z -0.252 0 [info ] ../src/node/node_state.h:422 | Created new node 992f4ebfe82af245128f34bc2093278a9f93905fc001ad202a78b1a76e56a134
2021-07-14T13:09:34.468823Z -0.252 0 [info ] ../src/enclave/main.cpp:171 | Starting thread: 0
2021-07-14T13:09:34.468826Z -0.252 1 [info ] ../src/enclave/main.cpp:171 | Starting thread: 1
2021-07-14T13:09:34.468828Z -0.252 2 [info ] ../src/enclave/main.cpp:171 | Starting thread: 2
2021-07-14T13:09:34.468831Z -0.252 3 [info ] ../src/enclave/main.cpp:171 | Starting thread: 3
2021-07-14T13:09:34.468833Z -0.252 4 [info ] ../src/enclave/main.cpp:171 | Starting thread: 4
2021-07-14T13:09:34.468835Z -0.252 5 [info ] ../src/enclave/main.cpp:171 | Starting thread: 5
2021-07-14T13:09:34.468838Z -0.252 6 [info ] ../src/enclave/main.cpp:171 | Starting thread: 6
2021-07-14T13:09:34.475233Z -0.258 4 [info ] ../src/enclave/main.cpp:178 | All threads are ready!
2021-07-14T13:09:34.475244Z -0.258 1 [info ] ../src/enclave/main.cpp:178 | All threads are ready!
2021-07-14T13:09:34.475248Z -0.258 6 [info ] ../src/enclave/main.cpp:178 | All threads are ready!
2021-07-14T13:09:34.475250Z -0.258 5 [info ] ../src/enclave/main.cpp:178 | All threads are ready!
2021-07-14T13:09:34.475256Z -0.258 0 [info ] ../src/enclave/main.cpp:178 | All threads are ready!
2021-07-14T13:09:34.475259Z -0.258 2 [info ] ../src/enclave/main.cpp:178 | All threads are ready!
2021-07-14T13:09:34.475261Z -0.258 3 [info ] ../src/enclave/main.cpp:178 | All threads are ready!
2021-07-14T13:09:34.475264Z -0.258 7 [info ] ../src/enclave/main.cpp:171 | Starting thread: 7
2021-07-14T13:09:34.475266Z -0.258 7 [info ] ../src/enclave/main.cpp:178 | All threads are ready!
2021-07-14T13:09:40.919713Z -0.015 1 [info ] ../src/node/jwt.h:257 | Proposal <js>: Storing JWT signing key with kid nOo3ZDrODXEK1jKWhXslHR_KXEg
2021-07-14T13:09:40.919737Z -0.015 1 [info ] ../src/node/jwt.h:257 | Proposal <js>: Storing JWT signing key with kid l3sQ-50cCH4xBVZLHTGwnSR7680
2021-07-14T13:09:40.919741Z -0.015 1 [info ] ../src/node/jwt.h:257 | Proposal <js>: Storing JWT signing key with kid DqUu8gf-nAgcyjP3-SuplNAXAnc
2021-07-14T13:09:40.920817Z -0.016 1 [info ] ../src/node/jwt.h:257 | Proposal <js>: Storing JWT signing key with kid OzZ5Dbmcso9Qzt2ModGmihg30Bo
2021-07-14T13:09:40.920828Z -0.016 1 [info ] ../src/node/jwt.h:257 | Proposal <js>: Storing JWT signing key with kid 1LTMzakihiRla_8z2BEJVXeWMqo
2021-07-14T13:09:40.920831Z -0.016 1 [info ] ../src/node/jwt.h:257 | Proposal <js>: Storing JWT signing key with kid bW8ZcMjBCnJZS-ibX5UQDNStvx4
2021-07-14T13:09:43.088925Z -0.014 6 [info ] ../src/node/jwt.h:257 | Proposal <js>: Storing JWT signing key with kid daphne-key
Hi @iqsarv. We're aware of some issues with multi-threaded execution, they still arise in our Threading CI with only 2 worker threads. Multi-threaded execution is not yet fully supported, and you should only run CCF nodes with the default worker threads (0).
thanks @eddyashton ! will set worker threads to zero