scipopt / scip

SCIP - Solving Constraint Integer Programs
Other
392 stars 63 forks source link

`RelWithDebInfo` build is still asserting. #84

Closed otrho closed 7 months ago

otrho commented 8 months ago

I'm using SCIP in a semi-roundabout way -- the Arch Linux package and the Rust crate russcip. It has been assert()ing in my project though:

/usr/src/debug/scip/scip-810/src/scip/var.c:2756: varFree: Assertion `(*var)->probindex == -1' failed.
Aborted (core dumped)

I guess that points to a memory leak or something, but that's beside the point. The library is built with the RelWithDebInfo target which to my understanding should be equivalent to a Release build -- optimised and no debug output/asserts -- but with debugging symbols.

As pointed out to me by the package maintainer, the flags here in the CMakefile are perhaps not quite right? Either way it seems NDEBUG is not set in these builds and it's hampering my use. I'm not sure where the /usr/src/debug/... path is coming from either, but it's a bit telling.

pfetsch commented 7 months ago

Does it work for you if you remove the two lines about CMAKE_C_FLAGS_RELWITHDEBINFO in CMakeLists.txt? These lines have been there since a long time, but I am not sure why there were added originally.

otrho commented 7 months ago

Funnily enough it seems it does.

I fetched the Arch package script, did a makepkg --nobuild, removed those lines from the source, and then a makepkg --noextract --install to build and install the patched package.

And I no longer get the assertion when running my project tests. Perhaps this is the solution.

matbesancon commented 7 months ago

thanks for reporting! We merged the build system fix but it might take some time to arrive downstream to the arch package

pfetsch commented 7 months ago

I am closing the issue - feel free to reopen if it pops up again.