When I link statically or dynamically with LexFloat client, I am getting a segmentation fault in my normal code. I have not even invoked any Cryptlex API call, just the linking is causing my code to seg fault. If I remove it I am not seeing any issue.
Want to know if anyone has seen anything similar.
Hi,
Which OS are you using? What is the LexFloatClient version? Can you replicate the issue with the samples available on Github:
I am on CentOs.
cat /etc/os-release
NAME=“CentOS Linux”
VERSION=“7 (Core)”
ID=“centos”
ID_LIKE=“rhel fedora”
VERSION_ID=“7”
PRETTY_NAME=“CentOS Linux 7 (Core)”
I tried a couple of examples on github and was not able to reproduce the issue. I am guessing it has something to do some other library my real application is linking to.
Can you share the list of libs your binary depends on?
ldd ./exe_bin
linux-vdso.so.1 => (0x00007ffe127ea000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4307df7000)
libssl3.so => /lib64/libssl3.so (0x00007f4307b9e000)
libnss3.so => /lib64/libnss3.so (0x00007f430786f000)
libnspr4.so => /lib64/libnspr4.so (0x00007f4307631000)
libtbb.so.2 => /usr/lib/tbb/2019U8/cmake/…/lib/libtbb.so.2 (0x00007f43073f2000)
libtbbmalloc_proxy.so.2 => /usr/lib/tbb/2019U8/cmake/…/lib/libtbbmalloc_proxy.so.2 (0x00007f43071ee000)
libtbbmalloc.so.2 => /usr/lib/tbb/2019U8/cmake/…/lib/libtbbmalloc.so.2 (0x00007f4306fb1000)
libboost_system.so.1.71.0 => /usr/lib/boost/1_71_0p/lib/libboost_system.so.1.71.0 (0x00007f4306daf000)
libboost_thread.so.1.71.0 => /usr/lib/boost/1_71_0p/lib/libboost_thread.so.1.71.0 (0x00007f4306b85000)
libboost_filesystem.so.1.71.0 => /usr/lib/boost/1_71_0p/lib/libboost_filesystem.so.1.71.0 (0x00007f430696a000)
libglog.so.0 => /usr/lib/glog/0.3.5/lib/libglog.so.0 (0x00007f430673b000)
libgflags.so.2.2 => /usr/lib/gflags/2.2.2/lib/libgflags.so.2.2 (0x00007f430651a000)
libhdf5_hl.so.100 => /usr/lib/hdf5/1.10.4/lib/libhdf5_hl.so.100 (0x00007f43062f7000)
libhdf5.so.103 => /usr/lib/hdf5/1.10.4/lib/libhdf5.so.103 (0x00007f4305d26000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f4305b22000)
liblmdb.so => /usr/lib/lmdb/0.9.23/lib/liblmdb.so (0x00007f430590d000)
libopencv_highgui.so.2.4 => /usr/lib/opencv/2.4.13.6/lib/libopencv_highgui.so.2.4 (0x00007f43054a1000)
libopencv_imgproc.so.2.4 => /usr/lib/opencv/2.4.13.6/lib/libopencv_imgproc.so.2.4 (0x00007f4304fb2000)
libopencv_core.so.2.4 => /usr/lib/opencv/2.4.13.6/lib/libopencv_core.so.2.4 (0x00007f4304b1a000)
libopenblas.so.0 => /usr/lib/openblas/0.2.20/lib/libopenblas.so.0 (0x00007f430451a000)
libpython3.7m.so.1.0 => /usr/lib/python/3.7.5/lib/libpython3.7m.so.1.0 (0x00007f4303fcf000)
libboost_python37.so.1.71.0 => /usr/lib/boost/1_71_0p/lib/libboost_python37.so.1.71.0 (0x00007f4303d93000)
libstdc++.so.6 => /usr/lib/gcc/9.1.0/lib64/libstdc++.so.6 (0x00007f43039ba000)
libm.so.6 => /lib64/libm.so.6 (0x00007f43036b8000)
libgcc_s.so.1 => /usr/lib/gcc/9.1.0/lib64/libgcc_s.so.1 (0x00007f43034a0000)
libc.so.6 => /lib64/libc.so.6 (0x00007f43030d2000)
/lib64/ld-linux-x86-64.so.2 (0x00007f4308013000)
libnssutil3.so => /lib64/libnssutil3.so (0x00007f4302ea2000)
libplc4.so => /lib64/libplc4.so (0x00007f4302c9d000)
libplds4.so => /lib64/libplds4.so (0x00007f4302a99000)
librt.so.1 => /lib64/librt.so.1 (0x00007f4302891000)
libz.so.1 => /usr/lib/hdf5/1.10.4/lib/libz.so.1 (0x00007f4302677000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f4302440000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007f430223d000)
libfreebl3.so => /lib64/libfreebl3.so (0x00007f430203a000)
I can see you haven’t updated your makefile to remove the libnss dependency. Please refer to the following:
This may not be the cause of the issue, but you can see if it resolves the issue.
I removed these dependency but still get a seg-fault. I am using CMake to create the binary.
target_link_libraries(bin_name LexActivator pthread ssl3 )
Can you try linking dynamically? Or try running your binary using gdb.