[xpkey] Segmentation fault
Not sure if this is related to #22.
Compilation:
cd build/ && cmake ../ && make
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.a (found version "1.1.1f")
-- Downloading CPM.cmake to /media/ext3-data/git/UMSKT/build/cmake/CPM_0.38.1.cmake
-- CPM: Adding package [email protected] (v3.11.2)
-- Using the multi-header code from /media/ext3-data/git/UMSKT/build/_deps/nlohmann_json-src/include/
-- CPM: Adding package [email protected] (7.1.3)
-- Version: 7.1.3
-- Build type:
-- CXX_STANDARD: 17
-- Performing Test has_std_17_flag
-- Performing Test has_std_17_flag - Success
-- Performing Test has_std_1z_flag
-- Performing Test has_std_1z_flag - Success
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS
-- Performing Test SUPPORTS_USER_DEFINED_LITERALS - Success
-- Performing Test FMT_HAS_VARIANT
-- Performing Test FMT_HAS_VARIANT - Success
-- Required features: cxx_variadic_templates
-- Looking for strtod_l
-- Looking for strtod_l - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /media/ext3-data/git/UMSKT/build
Scanning dependencies of target fmt
[ 7%] Building CXX object _deps/fmt-build/CMakeFiles/fmt.dir/src/format.cc.o
[ 14%] Building CXX object _deps/fmt-build/CMakeFiles/fmt.dir/src/os.cc.o
[ 21%] Linking CXX static library libfmt.a
[ 21%] Built target fmt
Scanning dependencies of target BINK1998
[ 28%] Building CXX object CMakeFiles/BINK1998.dir/src/BINK1998.cpp.o
[ 35%] Linking CXX static library libBINK1998.a
[ 35%] Built target BINK1998
Scanning dependencies of target CONFID
[ 42%] Building CXX object CMakeFiles/CONFID.dir/src/confid.cpp.o
[ 50%] Linking CXX static library libCONFID.a
[ 50%] Built target CONFID
Scanning dependencies of target BINK2002
[ 57%] Building CXX object CMakeFiles/BINK2002.dir/src/BINK2002.cpp.o
[ 64%] Linking CXX static library libBINK2002.a
[ 64%] Built target BINK2002
Scanning dependencies of target xpkey
[ 71%] Building CXX object CMakeFiles/xpkey.dir/src/main.cpp.o
[ 78%] Building CXX object CMakeFiles/xpkey.dir/src/key.cpp.o
[ 85%] Building CXX object CMakeFiles/xpkey.dir/src/util.cpp.o
[ 92%] Building CXX object CMakeFiles/xpkey.dir/src/cli.cpp.o
[100%] Linking CXX executable xpkey
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): in function `dlfcn_globallookup':
(.text+0x17): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libcrypto.a(b_addr.o): in function `BIO_lookup_ex':
(.text+0xd02): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libcrypto.a(b_sock.o): in function `BIO_gethostbyname':
(.text+0x75): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
[100%] Built target xpkey
Running ./xpkey:
Segmentatiefout (geheugendump gemaakt)
From kern.log:
Jun 18 06:10:56 nico-desktop kernel: [ 3664.900106] xpkey[13100]: segfault at 0 ip 0000000000000000 sp 00007ffee0d5e818 error 14 in xpkey[400000+1000]
Jun 18 06:10:56 nico-desktop kernel: [ 3664.900115] Code: Bad RIP value.
Jun 18 06:16:16 nico-desktop kernel: [ 3984.949079] xpkey[13901]: segfault at 0 ip 0000000000000000 sp 00007fffc2e62678 error 14 in xpkey[400000+1000]
Jun 18 06:16:16 nico-desktop kernel: [ 3984.949088] Code: Bad RIP value.
Use OpenSSL 3.0.2 and see if it works.
I don't know if it's wise to compile OpenSSL (which is rather complicated) and replace 1.1.1f.
(a process I'll have to repeat after each update...)
If OpenSSL 3.0.2 is really required, I'm afraid this will be a showstopper for me.
what distro and version are you using?
you can also give the static build via docker a go:
The dockerfile I've provided in this comment does appear to work: https://github.com/UMSKT/UMSKT/issues/29#issuecomment-1596034575
what distro and version are you using?
Linux Mint 20.3
I'll go ahead and close this ticket for now, I think we worked out all the bugs around this issue
If the problem still persists, feel free to comment here and we will look into it further
Issue persists...
cd build/ && cmake ../ && make
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.a (found version "1.1.1f")
-- [UMSKT] Detected Static Library version of OpenSSL
-- Downloading CPM.cmake to /media/ext3-data/git/UMSKT/build/cmake/CPM_0.38.1.cmake
-- CPM: Adding package [email protected] (v3.11.2)
-- Using the multi-header code from /media/ext3-data/git/UMSKT/build/_deps/nlohmann_json-src/include/
-- CPM: Adding package [email protected] (10.0.0)
-- Version: 10.0.0
-- Build type:
-- CPM: Adding package [email protected] (2.0.1)
-- Configuring done
-- Generating done
-- Build files have been written to: /media/ext3-data/git/UMSKT/build
Scanning dependencies of target fmt
[ 5%] Building CXX object _deps/fmt-build/CMakeFiles/fmt.dir/src/format.cc.o
[ 10%] Building CXX object _deps/fmt-build/CMakeFiles/fmt.dir/src/os.cc.o
[ 15%] Linking CXX static library libfmt.a
[ 15%] Built target fmt
Scanning dependencies of target _umskt
[ 20%] Building CXX object CMakeFiles/_umskt.dir/src/libumskt/libumskt.cpp.o
[ 25%] Building CXX object CMakeFiles/_umskt.dir/src/libumskt/pidgen3/BINK1998.cpp.o
[ 30%] Building CXX object CMakeFiles/_umskt.dir/src/libumskt/pidgen3/BINK2002.cpp.o
[ 35%] Building CXX object CMakeFiles/_umskt.dir/src/libumskt/pidgen3/key.cpp.o
[ 40%] Building CXX object CMakeFiles/_umskt.dir/src/libumskt/pidgen3/util.cpp.o
[ 45%] Building CXX object CMakeFiles/_umskt.dir/src/libumskt/confid/confid.cpp.o
[ 50%] Building CXX object CMakeFiles/_umskt.dir/src/libumskt/pidgen2/PIDGEN2.cpp.o
[ 55%] Building CXX object CMakeFiles/_umskt.dir/src/libumskt/debugoutput.cpp.o
[ 60%] Linking CXX static library lib_umskt.a
[ 60%] Built target _umskt
[ 65%] Generating intermediate file for /media/ext3-data/git/UMSKT/keys.json
[ 70%] Generating umskt-rc resource loader
Scanning dependencies of target umskt-rc
[ 75%] Building CXX object CMakeFiles/umskt-rc.dir/__cmrc_umskt-rc/lib.cpp.o
[ 80%] Building CXX object CMakeFiles/umskt-rc.dir/__cmrc_umskt-rc/intermediate/keys.json.cpp.o
[ 85%] Linking CXX static library libumskt-rc.a
[ 85%] Built target umskt-rc
Scanning dependencies of target umskt
[ 90%] Building CXX object CMakeFiles/umskt.dir/src/main.cpp.o
[ 95%] Building CXX object CMakeFiles/umskt.dir/src/cli.cpp.o
[100%] Linking CXX executable umskt
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libcrypto.a(dso_dlfcn.o): in function `dlfcn_globallookup':
(.text+0x17): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libcrypto.a(b_addr.o): in function `BIO_lookup_ex':
(.text+0xd02): warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libcrypto.a(b_sock.o): in function `BIO_gethostbyname':
(.text+0x75): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
[100%] Built target umskt
And then:
./umskt
Segmentatiefout (geheugendump gemaakt)
However, the artifact build from here worked.
ah perfect, yeah I was going to suggest trying the pre-compiled static release
I feel like the problem with your build environment is that OpenSSL 1.1.1f is a bit too old for the codebase.
In the future we will likely be using a different library, without OpenSSL
I feel like the problem with your build environment is that OpenSSL 1.1.1f is a bit too old for the codebase.
Indeed, I should upgrade my system in the near future, since more compatibility problems arise as time goes on. Like Ungoogled Chromium not working any more. 🙁