coin-or / Cgl

Cut Generator Library
Other
24 stars 14 forks source link

new release 0.60.7 introduces PulpSolverError (free(): invalid pointer) on previously working code #93

Open savvytruffle opened 1 year ago

savvytruffle commented 1 year ago

Hi.

coin-or-cgl 0.60.7 release introduced PuLPSolverError on previously working code. With msg=True, the underlying error was

free(): invalid pointer

Replicating this error: This fails for me in both linux and mac (Macbook Pro M1 OS12.6) environments. Using Python 3.8 pulp 2.7.0

Download Sudoku2.py from PuLP User Guide sudoku2 example.

conda install pulp coin-or-cgl=0.60.6
python Sudoku2.py

yields a solution without error

conda install pulp coin-or-cgl=0.60.7
python Sudoku2.py

yields

    raise PulpSolverError(
pulp.apis.core.PulpSolverError: Pulp: Error while trying to execute, use msg=True for more detailscbc
svigerske commented 1 year ago

I couldn't say from the diff in the source what would cause this. If conda install downloads a prebuild binary of coin-or-cgl, then I would suggest trying to also update coinutils, osi, clp, and cbc.

tkralphs commented 1 year ago

I could replicate this in a fresh conda environment. It's not necessary to use PuLP or even try to solve a MIP. Just starting cbc causes it to crash.

(cbc) ~ > cbc
free(): invalid pointer
Aborted

But so far, I can't get conda to install coin-or-cgl at 0.60.6. conda install pulp coin-or-cgl=0.60.6 just returns to the command line with no error and no packages installed. Weird.

How did you determine it's CGL that's the issue? Does rolling back CGL also roll back other packages? Or is it really just dropping in a different version of CGL with the newest versions of all other packages? I wouldn't think it would happily do that.

tkralphs commented 1 year ago

Everything looks fine on the builds, but I think what could have happened is that I might have merged pull requests in the wrong order for the update versions and accidentally caused Cbc 2.10.9 to be built with Cgl 0.60.6 (see here). In theory, this shouldn't cause problems, as it should be fine to drop in 0.60.7 in place of 0.60.7, but maybe we somehow introduced a breaking change? I have no idea how to force a re-build, but I'll investigate a bit.

tkralphs commented 1 year ago

OK, now with mamba, I was able to switch versions of CGL and indeed, this allows Cbc to start.

savvytruffle commented 1 year ago

How did you determine it's CGL that's the issue? Does rolling back CGL also roll back other packages? Or is it really just dropping in a different version of CGL with the newest versions of all other packages? I wouldn't think it would happily do that.

@tkralphs So I determined cgl was the root cause by systematically building new conda environment with different versions of dependencies & running the .py file, ie use default resolver (latest release) versions of all dependencies and roll back one dependency.

Here are all the dependencies I tested:

-pulp=2.7.0 (default resolver) -coincbc=2.10.8 vs 2.10.9 (default resolver) made no difference -coin-or-utils=2.11.6 vs 2.11.8 (default resolver) made no difference -coin-or-osi=0.108.7 vs 0.108.8 (default resolver) made no difference -coin-or-clp=1.17.7 vs. 1.17.8 (default resolver) made no difference -coin-or-cgl=0.60.6 OK vs. 0.60.7 caused error

tkralphs commented 1 year ago

@tkralphs So I determined cgl was the root cause by systematically building new conda environment with different versions of dependencies & running the .py file

This is great, thanks for doing that. Let's hope the re-build fixes things.

savvytruffle commented 1 year ago

🤞 thanks for the quick response.

tkralphs commented 1 year ago

It works!

tkralphs commented 1 year ago

And now it breaks when dropping in 0.60.6, so we must have introduced some kind of breaking change :(.