Closed l4l closed 7 years ago
I can correct peer_service_with_json_test segmentation fault. could you wait me.
pull request: peer-service branch
I downgrade the grpc to 1.0.x from 1.1.x and now it's fine (just this cause compile error) Are we considering support of newer grpc branch?
Reopen plz if occur again
Just got this problem again on my fix/peer-service-config branch (it is exactly the same as develop, only few tests were added for now). It happens not every time so if all tests are OK on your system just try to run them again.
What's about master?
Add a compiling flag -fsanitize=address
(or smth similar to your
compiler) and if crash happens again report the trace
On 03/10/17 02:58, Konstantin Munichev wrote:
Just got this problem again on my fix/peer-service-config branch (it is exactly the same as develop, only few tests were added for now). It happens not every time so if all tests are OK on your system just try to run them again.
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/hyperledger/iroha/issues/190#issuecomment-285524972, or mute the thread https://github.com/notifications/unsubscribe-auth/AFZW43KBPDVSoKQl1I69KL3rJWVtbMSeks5rkJI2gaJpZM4MTDsO.
@l4l Master is not affected. Log with -fsanitize=address:
/home/luckychess/src/C++/iroha/iroha/cmake-build-debug/test_bin/connection_grpc_test --gtest_filter=* --gtest_color=no
Testing started at 4:03 PM ...
E0310 16:03:19.150921803 32664 server.c:1036] duplicate registration for /Api.Sumeragi/Torii@*
ASAN:SIGSEGV
=================================================================
==32653==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000038 (pc 0x7f557d2a9a34 bp 0x7f5573266b90 sp 0x7f5573266aa0 T11)
#0 0x7f557d2a9a33 in pthread_mutex_lock (/lib64/libpthread.so.0+0x9a33)
#1 0x7f557db751d3 in grpc::Server::Wait() (/usr/local/lib64/libgrpc++.so.1+0x381d3)
#2 0x5bdba2 in connection::run() /home/luckychess/src/C++/iroha/iroha/core/infra/connection/connection_with_grpc.cpp:599
#3 0x5b358e in ConnectionWithGrpcTorii_Transaction_Add_Peer_Test::TestBody()::{lambda()#1}::operator()() const (/home/luckychess/src/C++/iroha/iroha/cmake-build-debug/test_bin/connection_grpc_test+0x5b358e)
#4 0x5b713d in _M_invoke<> /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/functional:1531
#5 0x5b6f95 in operator() /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/functional:1520
#6 0x5b6ec5 in _M_run /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/g++-v5/thread:115
#7 0x7f557cb763e1 (/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libstdc++.so.6+0xdc3e1)
#8 0x7f557d2a7443 (/lib64/libpthread.so.0+0x7443)
#9 0x7f557c2d5abc in clone (/lib64/libc.so.6+0xe7abc)
AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV ??:0 pthread_mutex_lock
Thread T11 created by T0 here:
#0 0x7f557ddf8603 in pthread_create (/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libasan.so.2+0x36603)
#1 0x7f557cb76542 in std::thread::_M_start_thread(std::shared_ptr<std::thread::_Impl_base>, void (*)()) (/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/libstdc++.so.6+0xdc542)
==32653==ABORTING
Running main() from gtest_main.cc1489150999 DEBUG [config] load json is {
"database_path":"/tmp/iroha_ledger",
"java_class_path":"java_tests",
"java_class_path_local":"smart_contract/java_tests",
"java_library_path":"lib",
"java_library_path_local":"build/lib",
"java_policy_path":"jvm/java.policy.txt",
"concurrency": 0,
"max_faulty_peers" : 1,
"pool_worker_queue_size": 1024,
"http_port": 1204,
"grpc_port": 50051
}
1489150999 DEBUG [config] load json is {
"group": [
{
"ip": "127.0.0.1",
"name": "da77880a3da4",
"publicKey": "u7X/zQ/Dq21WW7YH4rbkpiCYJXjPxk5t3qNDKiVwBx8="
}
],
"me": {
"ip": "127.0.0.1",
"name": "da77880a3da4",
"privateKey": "cPY84e0BXGUHBjT4QdlPI0LI3BPIfUfSZjB8jdWURkNQ+pEagT/ysrewbt2YUo/Qbfd5vczW5oDooGSNUBTj9g==",
"publicKey": "u7X/zQ/Dq21WW7YH4rbkpiCYJXjPxk5t3qNDKiVwBx8="
}
}
1489150999 INFO [connection] Operation
1489150999 INFO [connection] size: 0
1489150999 INFO [connection] name:
1489150999 INFO [connection] size: 0
type: "Add"
senderPubkey: "karin"
domain {
ownerPublicKey: "pubkey1"
name: "name"
}
1489150999 INFO [connection] response: OK
Process finished with exit code 1
I think I got it finally: connection_grpc_test starts thread for grpc server for both test cases but after the first test case finished thread still remains alive. This usually leads to problems when the second test case starts. Unfortunately std::thread has no way to terminate it so I found a workaround: move second test case to another file to make it run in another process. https://github.com/hyperledger/iroha/pull/210 @l4l Please check (or somebody else). May be better solutions exist.
fixed in #210
cmake 3.7.2, clang 3.9.1, libprotoc 3.0.0 (old version from AUR), archlinux build command:
valgrind log # 1 valgrind log # 2