-
Notifications
You must be signed in to change notification settings - Fork 1.5k
SIGSEGV with --staticbin
#2457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Perhaps related to recent use of lpthread. |
Is there any workaround to statically link z3? I get the same error on Ubuntu 16.04. |
The |
Could you change Line 2634 in a78f899
and add pull request as appropriate? We have utilities;
to get the configuration properties. |
This fixes a SIGSEGV on Ubuntu 16.04 when running z3 compiled with `--staticbin` (issue Z3Prover#2457). It seems that without the --whole-archive option the linker does not statically link all pthread symbols. The fix is described here: https://stackoverflow.com/a/45271521/2491528
This fixes a SIGSEGV on Ubuntu 16.04 when running z3 compiled with `--staticbin` (issue Z3Prover#2457). It seems that without the --whole-archive option the linker does not statically link all pthread symbols. The fix is described here: https://stackoverflow.com/a/45271521/2491528
This fixes a SIGSEGV on Ubuntu 16.04 when running z3 compiled with `--staticbin` (issue Z3Prover#2457). It seems that without the --whole-archive option the linker does not statically link all pthread symbols. The fix is described here: https://stackoverflow.com/a/45271521/2491528
This fixes a SIGSEGV on Ubuntu 16.04 when running z3 compiled with `--staticbin` (issue Z3Prover#2457). It seems that without the --whole-archive option the linker does not statically link all pthread symbols. The fix is described here: https://stackoverflow.com/a/45271521/2491528
I pulled the latest changes and rebuilt z3 on my Debian machine -- works as expected with both Thanks @NikolajBjorner and @fpoli. |
Actually, I just noticed that although the build was successful, the @fpoli: Does Sorry for the confusion! |
@SaswatPadhi on various Ubuntu 16.04 computers that I tried yes, it runs as expected. Before, Have you checked if your |
Hello, Sorry for the delay in getting back -- I had a deadline. I pulled the latest changes and checked again that PREFIX=/usr
CC=gcc
CXX=g++
CXXFLAGS= -D_MP_INTERNAL -DNDEBUG -D_EXTERNAL_RELEASE -D_USE_THREAD_LOCAL -std=c++11 -fvisibility=hidden -c -mfpmath=sse -msse -msse2 -O3 -D_LINUX_ -fPIC
CFLAGS= -D_MP_INTERNAL -DNDEBUG -D_EXTERNAL_RELEASE -D_USE_THREAD_LOCAL -fvisibility=hidden -c -mfpmath=sse -msse -msse2 -O3 -D_LINUX_ -fPIC
EXAMP_DEBUG_FLAG=
CXX_OUT_FLAG=-o
C_OUT_FLAG=-o
OBJ_EXT=.o
LIB_EXT=.a
AR=ar
AR_FLAGS=rcs
AR_OUTFLAG=
EXE_EXT=
LINK=g++
LINK_FLAGS=
LINK_OUT_FLAG=-o
LINK_EXTRA_FLAGS=-Wl,--whole-archive -lpthread -Wl,--no-whole-archive
SO_EXT=.so
SLINK=g++
SLINK_FLAGS=-shared
SLINK_EXTRA_FLAGS=-lpthread -Wl,-soname,libz3.so
SLINK_OUT_FLAG=-o
OS_DEFINES=-D_LINUX_ But I still get: $ ./z3 --version
"./z3 --version" terminated by signal SIGSEGV (Address boundary error) I am running Debian 10.2 with Linux kernel 5.3.9 and glibc version 2.28. |
Could you if possible dig deeper? e.g., modify the SLINK_EXTRA_FLAGS The update worked for my ubuntu 16 VM. |
I tried to modify the
but it did not help. Also, this issue is reproducible on Ubuntu 19.04 as well. |
I can reproduce the issue by using an Ubuntu 19.04 Docker image |
This SO question seems to explain the difference between Ubuntu 16.04 and 19.04, but no solution is provided. On Ubuntu 16.04, indeed, the output of |
@SaswatPadhi Can you try on Debian with |
Fixes issue Z3Prover#2457. The workaround is described here: https://stackoverflow.com/questions/58848694/gcc-whole-archive-recipe-for-static-linking-to-pthread-stopped-working-in-rec
Fixes issue Z3Prover#2457. The workaround is described here: https://stackoverflow.com/questions/58848694/gcc-whole-archive-recipe-for-static-linking-to-pthread-stopped-working-in-rec
Fixes issue #2457. The workaround is described here: https://stackoverflow.com/questions/58848694/gcc-whole-archive-recipe-for-static-linking-to-pthread-stopped-working-in-rec
Awesome! I confirm that z3 compiles and runs as expected on both Debian 10.2 and Ubuntu 19.04. Thanks @fpoli, @NikolajBjorner. |
A statically linked z3 binary compiled from the master branch fails to run and terminates with a segmentation fault (SIGSEGV signal).
Steps to reproduce: (tested on Debian 10)
git checkout master
python scripts/mk_make.py --staticbin
cd build && make
./z3 -v
Without the
--staticbin
flag, the compiled z3 binary runs as expected.The text was updated successfully, but these errors were encountered: