lsds / Teechain

Teechain: A Secure Payment Network with Asynchronous Blockchain Access
https://www.teechain.network/
Other
51 stars 16 forks source link

Segmentation fault #1

Closed teecrypt closed 6 years ago

teecrypt commented 6 years ago

Thank you for your work on Teechain, it looks very interesting. I downloaded the binary package, but unfortunately it crashes with a segmentation fault.

My system: Linux 4.15.0-36-generic #39~16.04.1-Ubuntu SGX version: 2.1.103.44322

The sample code in SGX SDK works fine. Here are the steps I did with Teechain:

./prepare_sim_mode.sh
./teechain_send.sh

It then fails with segmentation faults as follows:

Starting two ghost teechan enclaves...
Spawning enclave ALICE listening on port 10001 in test_scripts/testnet/test/alice.txt 
./teechain_send.sh: line 34:  2279 Segmentation fault      (core dumped) ./teechan ghost -d -p $ALICE_PORT > $ALICE_LOG 2>&1
Spawning enclave BOB listening on port 10002 in test_scripts/testnet/test/bob.txt 
./teechain_send.sh: line 38:  2282 Segmentation fault      (core dumped) ./teechan ghost -d -p $BOB_PORT > $BOB_LOG 2>&1

When I run it with valgrind, this is the error logged:

Error: Out of memory.
Error something went wrong: initialize_enclave
To prevent fund loss, we are shutting down your enclave, returning your unused deposits, and terminating all your channels. Check your log for the transactions.

Here's valgrind -v dump:

==2373== Memcheck, a memory error detector
==2373== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==2373== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==2373== Command: ./teechan ghost
==2373== 
--2373-- Valgrind options:
--2373--    -v
--2373-- Contents of /proc/version:
--2373--   Linux version 4.15.0-36-generic (buildd@lcy01-amd64-017) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10)) #39~16.04.1-Ubuntu SMP Tue Sep 25 08:59:23 UTC 2018
--2373-- 
--2373-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2
--2373-- Page sizes: currently 4096, max supported 4096
--2373-- Valgrind library directory: /usr/lib/valgrind
--2373-- Reading syms from /home/sgx/Downloads/Teechain/teechan
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /lib/x86_64-linux-gnu/ld-2.23.so
--2373--   Considering /lib/x86_64-linux-gnu/ld-2.23.so ..
--2373--   .. CRC mismatch (computed aa979a42 wanted 9019bbb7)
--2373--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.23.so ..
--2373--   .. CRC is valid
--2373-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
--2373--   Considering /usr/lib/valgrind/memcheck-amd64-linux ..
--2373--   .. CRC mismatch (computed eea41ea9 wanted 2009db78)
--2373--    object doesn't have a symbol table
--2373--    object doesn't have a dynamic symbol table
--2373-- Scheduler: using generic scheduler lock implementation.
--2373-- Reading suppressions file: /usr/lib/valgrind/default.supp
==2373== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-2373-by-sgx-on-???
==2373== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-2373-by-sgx-on-???
==2373== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-2373-by-sgx-on-???
==2373== 
==2373== TO CONTROL THIS PROCESS USING vgdb (which you probably
==2373== don't want to do, unless you know exactly what you're doing,
==2373== or are doing some strange experiment):
==2373==   /usr/lib/valgrind/../../bin/vgdb --pid=2373 ...command...
==2373== 
==2373== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==2373==   /path/to/gdb ./teechan
==2373== and then give GDB the following command
==2373==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=2373
==2373== --pid is optional if only one valgrind process is running
==2373== 
--2373-- REDIR: 0x401cfd0 (ld-linux-x86-64.so.2:strlen) redirected to 0x3809e181 (???)
--2373-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
--2373--   Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
--2373--   .. CRC mismatch (computed 2567ccf6 wanted 49420590)
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
--2373--   Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
--2373--   .. CRC mismatch (computed 0e27c9a8 wanted ac585421)
--2373--    object doesn't have a symbol table
==2373== WARNING: new redirection conflicts with existing -- ignoring it
--2373--     old: 0x0401cfd0 (strlen              ) R-> (0000.0) 0x3809e181 ???
--2373--     new: 0x0401cfd0 (strlen              ) R-> (2007.0) 0x04c31020 strlen
--2373-- REDIR: 0x401b920 (ld-linux-x86-64.so.2:index) redirected to 0x4c30bc0 (index)
--2373-- REDIR: 0x401bb40 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4c320d0 (strcmp)
--2373-- REDIR: 0x401dd30 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4c35270 (mempcpy)
--2373-- Reading syms from /opt/intel/sgxsdk/lib64/libsgx_urts_sim.so
--2373-- Reading syms from /lib/x86_64-linux-gnu/libpthread-2.23.so
--2373--   Considering /usr/lib/debug/.build-id/ce/17e023542265fc11d9bc8f534bb4f070493d30.debug ..
--2373--   .. build-id is valid
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libcurl.so.4.4.0
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /lib/x86_64-linux-gnu/libcrypto.so.1.0.0
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /opt/intel/sgxsdk/lib64/libsgx_uae_service_sim.so
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
--2373--   Considering /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 ..
--2373--   .. CRC mismatch (computed 3d999b0e wanted 70646140)
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /lib/x86_64-linux-gnu/libm-2.23.so
--2373--   Considering /lib/x86_64-linux-gnu/libm-2.23.so ..
--2373--   .. CRC mismatch (computed e8c3647b wanted c3efddac)
--2373--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libm-2.23.so ..
--2373--   .. CRC is valid
--2373-- Reading syms from /lib/x86_64-linux-gnu/libgcc_s.so.1
--2373--   Considering /lib/x86_64-linux-gnu/libgcc_s.so.1 ..
--2373--   .. CRC mismatch (computed b9a68419 wanted 29d51b00)
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /lib/x86_64-linux-gnu/libc-2.23.so
--2373--   Considering /lib/x86_64-linux-gnu/libc-2.23.so ..
--2373--   .. CRC mismatch (computed 7a8ee3e4 wanted a5190ac4)
--2373--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.23.so ..
--2373--   .. CRC is valid
--2373-- Reading syms from /lib/x86_64-linux-gnu/libdl-2.23.so
--2373--   Considering /lib/x86_64-linux-gnu/libdl-2.23.so ..
--2373--   .. CRC mismatch (computed 39227170 wanted ab6e2c22)
--2373--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libdl-2.23.so ..
--2373--   .. CRC is valid
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libidn.so.11.6.15
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/librtmp.so.1
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /lib/x86_64-linux-gnu/libssl.so.1.0.0
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2
--2373--   Considering /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2.2 ..
--2373--   .. CRC mismatch (computed aaa76ada wanted c917fc4c)
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/liblber-2.4.so.2.10.5
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libldap_r-2.4.so.2.10.5
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /lib/x86_64-linux-gnu/libz.so.1.2.8
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libgnutls.so.30.6.2
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libhogweed.so.4.2
--2373--   Considering /usr/lib/x86_64-linux-gnu/libhogweed.so.4.2 ..
--2373--   .. CRC mismatch (computed 22df53ec wanted 0378f506)
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libnettle.so.6.2
--2373--   Considering /usr/lib/x86_64-linux-gnu/libnettle.so.6.2 ..
--2373--   .. CRC mismatch (computed 3240267d wanted d7683e48)
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libgmp.so.10.3.0
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3
--2373--   Considering /usr/lib/x86_64-linux-gnu/libkrb5.so.3.3 ..
--2373--   .. CRC mismatch (computed 08b63e02 wanted e7500392)
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1
--2373--   Considering /usr/lib/x86_64-linux-gnu/libk5crypto.so.3.1 ..
--2373--   .. CRC mismatch (computed e09d9def wanted 35352cbb)
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /lib/x86_64-linux-gnu/libcom_err.so.2.1
--2373--   Considering /lib/x86_64-linux-gnu/libcom_err.so.2.1 ..
--2373--   .. CRC mismatch (computed 0c5846b0 wanted 1b47dcd1)
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1
--2373--   Considering /usr/lib/x86_64-linux-gnu/libkrb5support.so.0.1 ..
--2373--   .. CRC mismatch (computed 32ab1672 wanted 9aafae3a)
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /lib/x86_64-linux-gnu/libresolv-2.23.so
--2373--   Considering /lib/x86_64-linux-gnu/libresolv-2.23.so ..
--2373--   .. CRC mismatch (computed 6c85719f wanted 0ecf24a3)
--2373--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libresolv-2.23.so ..
--2373--   .. CRC is valid
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libsasl2.so.2.0.25
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libgssapi.so.3.0.0
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libp11-kit.so.0.1.0
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libtasn1.so.6.5.1
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /lib/x86_64-linux-gnu/libkeyutils.so.1.5
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libheimntlm.so.0.1.0
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libkrb5.so.26.0.0
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libasn1.so.8.0.0
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libhcrypto.so.4.1.0
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libroken.so.18.1.0
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libwind.so.0.0.0
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libheimbase.so.1.0.0
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libhx509.so.5.0.0
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /usr/lib/x86_64-linux-gnu/libsqlite3.so.0.8.6
--2373--    object doesn't have a symbol table
--2373-- Reading syms from /lib/x86_64-linux-gnu/libcrypt-2.23.so
--2373--   Considering /lib/x86_64-linux-gnu/libcrypt-2.23.so ..
--2373--   .. CRC mismatch (computed 5219d836 wanted 507c1b6b)
--2373--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libcrypt-2.23.so ..
--2373--   .. CRC is valid
--2373-- REDIR: 0x6465a00 (libc.so.6:strcasecmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x6461280 (libc.so.6:strcspn) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x6467cf0 (libc.so.6:strncasecmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x64636f0 (libc.so.6:strpbrk) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x6463a80 (libc.so.6:strspn) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x646514b (libc.so.6:memcpy@GLIBC_2.2.5) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x6461b20 (libc.so.6:strncmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x64651b0 (libc.so.6:memset) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x6464bb0 (libc.so.6:bcmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x645fcd0 (libc.so.6:strcmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x64ec210 (libc.so.6:__memcpy_chk) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x646a3f0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x645fa80 (libc.so.6:index) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x64633c0 (libc.so.6:strncpy) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x6461160 (libc.so.6:strcpy) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x6461ae0 (libc.so.6:strncat) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x645f880 (libc.so.6:strcat) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x64ec2a0 (libc.so.6:__memmove_chk) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x6464630 (libc.so.6:strstr) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--2373-- REDIR: 0x6463400 (libc.so.6:rindex) redirected to 0x4c308a0 (rindex)
--2373-- REDIR: 0x6461720 (libc.so.6:strlen) redirected to 0x4c30f60 (strlen)
--2373-- REDIR: 0x6461b70 (libc.so.6:__GI_strncmp) redirected to 0x4c31710 (__GI_strncmp)
--2373-- REDIR: 0x645a130 (libc.so.6:malloc) redirected to 0x4c2db20 (malloc)
--2373-- REDIR: 0x646a470 (libc.so.6:__GI_memcpy) redirected to 0x4c32b00 (__GI_memcpy)
--2373-- REDIR: 0x645fd10 (libc.so.6:__GI_strcmp) redirected to 0x4c31fe0 (__GI_strcmp)
--2373-- REDIR: 0x645ad10 (libc.so.6:calloc) redirected to 0x4c2faa0 (calloc)
--2373-- REDIR: 0x6523ea0 (libc.so.6:__memcpy_avx_unaligned) redirected to 0x4c324a0 (memcpy@@GLIBC_2.14)
--2373-- REDIR: 0x645fab0 (libc.so.6:__GI_strchr) redirected to 0x4c30a00 (__GI_strchr)
--2373-- REDIR: 0x6523e90 (libc.so.6:__memcpy_chk_avx_unaligned) redirected to 0x4c35360 (__memcpy_chk)
--2373-- REDIR: 0x6475570 (libc.so.6:__strcmp_sse2_unaligned) redirected to 0x4c31f90 (strcmp)
--2373-- REDIR: 0x645a4f0 (libc.so.6:free) redirected to 0x4c2ed80 (free)
--2373-- REDIR: 0x6548970 (libc.so.6:__memset_avx2) redirected to 0x4c344c0 (memset)
--2373-- REDIR: 0x645a6c0 (libc.so.6:realloc) redirected to 0x4c2fce0 (realloc)
--2373-- REDIR: 0x6544430 (libc.so.6:__memcmp_sse4_1) redirected to 0x4c33cd0 (__memcmp_sse4_1)
--2373-- REDIR: 0x6465890 (libc.so.6:__GI_stpcpy) redirected to 0x4c33f80 (__GI_stpcpy)
--2373-- REDIR: 0x64653b0 (libc.so.6:__GI_mempcpy) redirected to 0x4c34fa0 (__GI_mempcpy)
--2373-- REDIR: 0x647c000 (libc.so.6:__strncpy_sse2_unaligned) redirected to 0x4c31570 (__strncpy_sse2_unaligned)
--2373-- REDIR: 0x5bc2e60 (libstdc++.so.6:operator new(unsigned long)) redirected to 0x4c2e080 (operator new(unsigned long))
--2373-- REDIR: 0x6464bf0 (libc.so.6:__GI_memcmp) redirected to 0x4c33b90 (__GI_memcmp)
--2373-- REDIR: 0x651ba90 (libc.so.6:__strncmp_sse42) redirected to 0x4c317f0 (__strncmp_sse42)
--2373-- REDIR: 0x6464060 (libc.so.6:__GI_strstr) redirected to 0x4c354d0 (__strstr_sse2)
--2373-- REDIR: 0x6464860 (libc.so.6:memchr) redirected to 0x4c32170 (memchr)
--2373-- REDIR: 0x646c760 (libc.so.6:strchrnul) redirected to 0x4c34da0 (strchrnul)
--2373-- REDIR: 0x6521ff0 (libc.so.6:__strncasecmp_avx) redirected to 0x4c31940 (strncasecmp)
--2373-- Reading syms from /lib/x86_64-linux-gnu/libnss_compat-2.23.so
--2373--   Considering /lib/x86_64-linux-gnu/libnss_compat-2.23.so ..
--2373--   .. CRC mismatch (computed 45e1d383 wanted 584dcc9d)
--2373--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libnss_compat-2.23.so ..
--2373--   .. CRC is valid
--2373-- Reading syms from /lib/x86_64-linux-gnu/libnsl-2.23.so
--2373--   Considering /lib/x86_64-linux-gnu/libnsl-2.23.so ..
--2373--   .. CRC mismatch (computed 824f4d52 wanted 959e8ba1)
--2373--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libnsl-2.23.so ..
--2373--   .. CRC is valid
--2373-- REDIR: 0x64611a0 (libc.so.6:__GI_strcpy) redirected to 0x4c31110 (__GI_strcpy)
--2373-- Reading syms from /lib/x86_64-linux-gnu/libnss_nis-2.23.so
--2373--   Considering /lib/x86_64-linux-gnu/libnss_nis-2.23.so ..
--2373--   .. CRC mismatch (computed 97375782 wanted 3001fa61)
--2373--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libnss_nis-2.23.so ..
--2373--   .. CRC is valid
--2373-- Reading syms from /lib/x86_64-linux-gnu/libnss_files-2.23.so
--2373--   Considering /lib/x86_64-linux-gnu/libnss_files-2.23.so ..
--2373--   .. CRC mismatch (computed bbddf769 wanted cc29886c)
--2373--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libnss_files-2.23.so ..
--2373--   .. CRC is valid
--2373-- REDIR: 0x647f0e0 (libc.so.6:__strncat_sse2_unaligned) redirected to 0x4c30dc0 (strncat)
--2373-- REDIR: 0x646c550 (libc.so.6:rawmemchr) redirected to 0x4c34dd0 (rawmemchr)
--2373-- REDIR: 0x5bc0f10 (libstdc++.so.6:operator delete(void*)) redirected to 0x4c2f1e0 (operator delete(void*))
--2373-- REDIR: 0x65239b0 (libc.so.6:__memmove_avx_unaligned) redirected to 0x4c32230 (memcpy@GLIBC_2.2.5)
--2373-- REDIR: 0x5bc2f10 (libstdc++.so.6:operator new[](unsigned long)) redirected to 0x4c2e7a0 (operator new[](unsigned long))
--2373-- REDIR: 0x5bc0f40 (libstdc++.so.6:operator delete[](void*)) redirected to 0x4c2f6e0 (operator delete[](void*))
==2373== Warning: client syscall munmap tried to modify addresses 0x0-0x1ffffffff
==2373==    at 0x64D7747: munmap (syscall-template.S:84)
==2373==    by 0x4E4FEC8: se_virtual_free (in /opt/intel/sgxsdk/lib64/libsgx_urts_sim.so)
==2373==    by 0x4E4AE78: CEnclaveSim::~CEnclaveSim() (in /opt/intel/sgxsdk/lib64/libsgx_urts_sim.so)
==2373==    by 0x4E4A844: _ECREATE(_page_info_t*) (in /opt/intel/sgxsdk/lib64/libsgx_urts_sim.so)
==2373==    by 0x4E4ADB2: _SE0 (in /opt/intel/sgxsdk/lib64/libsgx_urts_sim.so)
==2373==    by 0x4E4A42F: ??? (in /opt/intel/sgxsdk/lib64/libsgx_urts_sim.so)
==2373==    by 0xFFEFFBEDF: ???
Error: Out of memory.
Error something went wrong: initialize_enclave
To prevent fund loss, we are shutting down your enclave, returning your unused deposits, and terminating all your channels. Check your log for the transactions.
--2373-- Discarding syms at 0xb6522d0-0xb657bf1 in /lib/x86_64-linux-gnu/libnss_compat-2.23.so due to munmap()
--2373-- Discarding syms at 0xba750b0-0xba7b8aa in /lib/x86_64-linux-gnu/libnss_nis-2.23.so due to munmap()
--2373-- Discarding syms at 0xb85dff0-0xb86b1e1 in /lib/x86_64-linux-gnu/libnsl-2.23.so due to munmap()
--2373-- Discarding syms at 0xbc811b0-0xbc872a1 in /lib/x86_64-linux-gnu/libnss_files-2.23.so due to munmap()
==2373== 
==2373== HEAP SUMMARY:
==2373==     in use at exit: 72,731 bytes in 3 blocks
==2373==   total heap usage: 4,056 allocs, 4,053 frees, 17,098,557 bytes allocated
==2373== 
==2373== Searching for pointers to 3 not-freed blocks
==2373== Checked 1,127,744 bytes
==2373== 
==2373== LEAK SUMMARY:
==2373==    definitely lost: 0 bytes in 0 blocks
==2373==    indirectly lost: 0 bytes in 0 blocks
==2373==      possibly lost: 0 bytes in 0 blocks
==2373==    still reachable: 72,731 bytes in 3 blocks
==2373==         suppressed: 0 bytes in 0 blocks
==2373== Rerun with --leak-check=full to see details of leaked memory
==2373== 
==2373== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==2373== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
JoshLind commented 6 years ago

Hi,

Can I check how much system ram you're operating on? An out of memory error seems to suggest the process can't allocate enough memory on enclave initialization. The teechain binaries tend to allocate a lot of memory on startup (several Gigabytes each).

teecrypt commented 6 years ago

It has 8GB RAM -- I tried increasing the swap size and it went through fine. Thanks a lot!