Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Segfault in the CPLEX C library

    Posted 08/31/12 09:28 AM

    Originally posted by: hfhc2


    Hello everyone,

    I have the following problem: for an academic problem I need to solve some multi-commodity flow problems in a subroutine of a program. For this I decided to use the CPLEX C library version 12.4.
    I use CPXnewrows/CPXnewcols to add rows and columns to my problem, then I repeatedly call CPXchgcoeflist to add matrix coefficients. In the end I call CPXlpopt to solve the LP. After each call to a CPLEX function I check for errors in the return codes / status flags and everything seems to be in order. However, during the call to CPXlpopt, my program segfaults deep inside the CPLEX library. I attached a stack trace and the output of valgrind.

    As far as I can see, the problem lies within my version of the CPLEX library. I would like to know whether there is some possibility to run self tests on the library. The sha256sum of my library file is

    9404c59a199e9d3eda950defe2568c556e5a7ae73ef35c7f125f1e789335264b libcplex.a

    Is there any possibility that the library file I have has been corrupted in any way?
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Segfault in the CPLEX C library

    Posted 08/31/12 11:36 AM

    Originally posted by: SystemAdmin


    Can you please set the datacheck parameter and try again:
    CPXsetintparam(env, CPX_PARAM_DATACHECK, CPX_ON);
    

    Segfaults can easily happen if inconsistent data is provided to CPLEX. Do you see any errors/warnings if you enable this parameter?
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Segfault in the CPLEX C library

    Posted 08/31/12 01:58 PM

    Originally posted by: hfhc2


    Well, I set the parameter, but it had absolutely no effect. I think that the problem is somewhere in the library itself. I think that when I call CPXnewrows/CPXnewcols or CPXchgcoeflist, then CPLEX copies the values from the given arrays. So if there were some off-by-one error or the like, then the segfault would occur inside those functions or at least valgrind would pick something up. But the segfault occurs in the CPXlpopt function instead...
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Segfault in the CPLEX C library

    Posted 09/03/12 01:13 PM

    Originally posted by: hfhc2


    I also enabled the output and I don't see anything out of the ordinary before the segfault:
    Parallel mode: deterministic, using up to 2 threads for concurrent optimization.
    Tried aggregator 1 time.

    Iteration log . . .
    Iteration: 1 Dual objective = 3312.000000
    Iteration: 534 Dual objective = 826495.288752
    Iteration: 1043 Dual objective = 1307335.750290
    Iteration: 1509 Dual objective = 1635778.593274
    Iteration: 1995 Dual objective = 1922530.593274
    Iteration: 2453 Dual objective = 2173797.208659
    Iteration: 2869 Dual objective = 2380403.977890
    Iteration: 3256 Dual objective = 2558149.926804
    Iteration: 3644 Dual objective = 2724868.045335
    Segmentation fault

    Also, everything works fine if I use CPXdualopt instead of CPXlpopt, so this really seems to be a problem inside the library.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Segfault in the CPLEX C library

    Posted 09/18/12 03:49 AM

    Originally posted by: SystemAdmin


    Could you please upload the .sav file of your problem (but only if you are allowed to share the data in public!)? To do this, just call CPXwriteprob(env, lp, "myprob.sav", 0) before calling CPXlpopt().

    Which operating system are you using? 32 or 64 bit? Did you change any CPLEX parameters?
    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Segfault in the CPLEX C library

    Posted 09/19/12 05:00 PM

    Originally posted by: hfhc2


    Hello Tobias,

    I am using a 64 bit system and I did not change any parameters instead of the recommended CPX_PARAM_DATACHECK. I attached the sav file, however everything seems to work just fine using the cplex program itself.
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Segfault in the CPLEX C library

    Posted 10/15/12 10:03 AM

    Originally posted by: SystemAdmin


    Sorry for answering so late...

    I also cannot reproduce the issue. Can you consistently reproduce the segmentation fault from within your own program?
    Can you please verify that the DATACHECK parameter is really the only one that you did not change, by calling CPXwriteparam(env, "yourparams.prm") directly before the CPXlpsolve() call?
    The resulting parameter file will contain all parameters that are set at non-default values, which should only be the DATACHECK parameter in your case.

    Is this the first CPLEX solve method that you are executing in your program, or is this just one solve in a series of solves?
    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Segfault in the CPLEX C library

    Posted 10/19/12 09:20 AM

    Originally posted by: hfhc2


    The parameter file reads:

    CPLEX Parameter File Version 12.4.0.0
    CPX_PARAM_DATACHECK 1

    so everything seems to be in order there. As I said in my first post, I create the row/cols by calling
    CPXnewrows/CPXnewcols once. After that I change coefficients via CPXchgcoeflist a couple of times,
    then I solve using CPXlpopt (not CPXlpsolve) and the program crashes.
    Did you try to use the CPXhybbaropt() function explicitely for this instance (I don't know if this is possible using the cplex binary)?

    My program crashes every time I call it with the same arguments, so I can reproduce this bug consistently.
    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Segfault in the CPLEX C library

    Posted 10/23/12 05:51 AM

    Originally posted by: SystemAdmin


    Hmm... very strange. Any chance you could run valgrind to check that no memory corruption occurs?

    Would it be possible to attach your source code? Or to send it to me privately at achterberg at de dot ibm dot com?

    Tobias
    #CPLEXOptimizers
    #DecisionOptimization