Cbc icon indicating copy to clipboard operation
Cbc copied to clipboard

SegFault with SOS constriaints in CBC 2.10.x

Open jsiirola opened this issue 3 years ago • 1 comments

We are seeing segmentation faults when passing SOS constraints to CBC though the AMPL (NL file) interface. I have verified (on CentOS7) that this happens with all versions of CBC 2.10.x from bintray (.3, .4, and .5) as well as the executable distributed by AMPL. Older cbc executables (I had been using CBC 2.9.7) worked fine.

Example NL files are in the zipfile attached to this issue and can be run with, e.g. cbc SOS1_simple.nl -AMPL.

The NL files were generated from the corresponding Pyomo files (also in the zipfile).

SOS_models.zip

jsiirola avatar Apr 22 '21 15:04 jsiirola

John,

It works in master. Difficult to fix in a release, but the change to CbcSolver.cpp is small -

diff --git a/Cbc/src/CbcSolver.cpp b/Cbc/src/CbcSolver.cpp index 4d0e3e3f..320bd12a 100644 --- a/Cbc/src/CbcSolver.cpp +++ b/Cbc/src/CbcSolver.cpp @@ -1518,6 +1518,14 @@ int CbcMain1(int argc, const char *argv[], coinModel = coinModelStart.model; if (returnCode) return returnCode;

  • if (info.numberSos) {
  • numberSOS = info.numberSos;
    
  • sosStart = info.sosStart;
    
  • sosIndices = info.sosIndices;
    
  • sosType = info.sosType;
    
  • sosReference = info.sosReference;
    
  • sosPriority = info.sosPriority;
    
  • } CbcOrClpRead_mode = 2; // so will start with parameters // see if log in list (including environment) for (int i = 1; i < info.numberArguments; i++) {

I attach a modified 2.10.5 CbcSolver.cpp

John Forrest On 22/04/2021 16:42, John Siirola wrote:

We are seeing segmentation faults when passing SOS constraints to CBC though the AMPL (NL file) interface. I have verified (on CentOS7) that this happens with all versions of CBC 2.10.x from bintray (.3, .4, and .5) as well as the executable distributed by AMPL. Older cbc executables (I had been using CBC 2.9.7) worked fine.

Example NL files are in the zipfile attached to this issue and can be run with, e.g. |cbc SOS1_simple.nl -AMPL|.

The NL files were generated from the corresponding Pyomo files (also in the zipfile).

SOS_models.zip https://github.com/coin-or/Cbc/files/6359491/SOS_models.zip

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/coin-or/Cbc/issues/388, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABWJYHCLBCD3OTVN3HOG74TTKA7VTANCNFSM43MXIX7Q.

jjhforrest avatar Apr 23 '21 10:04 jjhforrest