msolve icon indicating copy to clipboard operation
msolve copied to clipboard

Fix segmentation fault with -O0

Open wegank opened this issue 8 months ago • 0 comments

If one compiles msolve on macOS, without OpenMP support and without optimization:

$ export PATH=$PATH:/opt/homebrew/bin
$ ./autogen.sh
$ ./configure LDFLAGS="-L$(brew --prefix)/lib/" CFLAGS="-I$(brew --prefix)/include/"
$ make

One gets a msolve binary that segfaults on almost all inputs.

This is not caught by CI since https://github.com/algebraic-solving/msolve/commit/c710b2b31a6f5b558213f6d31e35ab6c9d34d39c sets CFLAGS=-O2, so the two inline functions are replaced by constant values. Indeed, CFLAGS=-O3 -fno-inline also reproduces the issue.

wegank avatar Apr 03 '25 10:04 wegank