Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Error ending CPLEX Environment in C++

    Posted 02/05/09 05:50 PM

    Originally posted by: SystemAdmin


    [smest001 said:]

    Hello all,
    I am implementing a column generation algorithm in VC++ using Concert Tech.
    When I try to end the environment (after I am done with col. gen routine),
    I get an access violation error.
    Till last week the same program was running fine. So I am not sure what is the problem.
    Also, if I use Cplex Callable lib. I can close the CPLEX env.
    Can someone help with this issue.
    Thanks in advance

    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Error ending CPLEX Environment in C++

    Posted 02/09/09 07:25 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    I'm not sure, but I think that one way this could happen would be if something ended the environment before you did.  Try preceding the call to the end() method with a check whether the environment pointer is null or zero.  If so, you need to figure out what in your code is zapping it (or else just trust it to be zapped and skip the call to end).
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Error ending CPLEX Environment in C++

    Posted 02/27/09 06:38 PM

    Originally posted by: SystemAdmin


    [smest001 said:]

    Thank you for your response. But the problem is that it is not just my apllication that is giving me problem. I tried the example src file from ILOG, and they too are giving me the same problem.
    I use callable Libraries and there is not problem ending the environment.
    This is really confusing because, all this was working fine, previously. Also i treid running my application all the example files on different computers.
    You are right that i f i don end the env then I can close the applicationw othout problem, but I have to run a set of experiments automatically and collect stats. I do not want memory leaks which might be the case if i do not end the eviornment.
    Please let me know what you think of this.
    Thanks a lot once again. Appreciate it
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Error ending CPLEX Environment in C++

    Posted 03/01/09 07:25 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    [quote author=smest001 link=topic=910.msg2831#msg2831 date=1235749074]
    I tried the example src file from ILOG, and they too are giving me the same problem.


    The ILOG sample files throw access violation exceptions [i]without modification[/i]?  Or did you hack the examples to end objects/environments early?
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Error ending CPLEX Environment in C++

    Posted 03/01/09 10:52 PM

    Originally posted by: SystemAdmin


    [smest001 said:]

    No, I ran the example without any modifications. I also tried a small example, by just initializing the ILO env and closing it without adding any objects to the env;Just for seeing what happens, Even then i got the access violation error.
    When I try to debug I go to the ios.cpp file which gives me an error in the following code:
    ios_base::~ios_base()
    { // destroy the object
    if (0 < _Stdstr && 0 < --stdopens&#91;_Stdstr&#93;)<br /> return;
    _Tidy();
    _DELETE_CRT(_Ploc);
    }

    Again, The CPLEX callable library env closes fine without any problems (I tried lpex1.c for callable library and ilolpex1.cpp for Concert Tech).
    Thanks for the interest you are showing in trying to figure out what might be wrong with this.
    Thank you

    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Error ending CPLEX Environment in C++

    Posted 03/13/09 07:22 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    You may have to take this up with CPLEX tech support.  CPLEX can be a bit finicky about which C++ compiler you use, but every problem I can recall reading about (or tripping over myself) involved compilation errors, not runtime errors.  If the included examples, unmodified, don't run correctly, I'd be inclined to suspect something is off with the compiler or one of the (non-CPLEX) libraries.

    /Paul
    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Error ending CPLEX Environment in C++

    Posted 03/27/09 08:06 PM

    Originally posted by: SystemAdmin


    [MMorin01 said:]

    Hi smest001,
    Did you find any solution to the mentionned problem? I get the same problem with my application:

    Since I need to run a set of experiments, I created a C++ class called CplexAlgo which contains an IloEnv object (and some the other models objects such as IloArrays). The environment is created and initialized in the constructor of my class and the memory is freed by invoking IloEnv:end() in the destructor of the CplexAlgo class.

    The access violation never occurs on the first iteration of my experimentation. It occurs only on later iterations. As an example, when I create and then delete a first instance of CplexAlgo everything is ok, but I get an access violation (sometimes) if I create and then delete a second instance of CplexAlgo in the same program.

    Maybe the memory is not freed correctly by IloEnv:end()... maybe it is my own application that have memory leaks... I don't know.
    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Error ending CPLEX Environment in C++

    Posted 04/09/09 07:18 PM

    Originally posted by: SystemAdmin


    [MMorin01 said:]

    Hi again,
    I tried different modifications to my application to fix the problem, but since the problem occurs after several hours of optimization the debugging process is very slow. However, I got some new information about the current problem:

    I added some lines to end different components separately before the call to IloEnv:end() and the problem occurs on IloObj:end() as well as on IloEnv:end().

    Looking deeper in the code, I found that the access violation occurs in a call to the operator "<<" of the "ostream" library, i.e. at the following line:
    "streamsize _Count = (streamsize)_Traits::length(_Val); // may overflow"

    Here's pertinent lines of the call stack:
    ***
    app.exe!std::operator<<<std::char_traits<char> >(std::basic_ostream<char,std::char_traits<char> > & _Ostr={...}, const char * _Val=0x0012f5ac)  Line 750 + 0x9 bytes
    app.exe!CpxGoalICallbackI::main()  + 0x2a9 bytes
    [...]
    app.exe!IloCplexI::setObj()  + 0x96 bytes
    app.exe!IloDefaultLPExtractor::doremoveObj()  + 0x79 bytes
    app.exe!IloDefaultLPExtractor::removeObj()  + 0x14 bytes
    app.exe!IloLPExtractorManager::doRemove()  + 0x123 bytes
    app.exe!IloLPExtractorManager::remove()  + 0x4a bytes
    app.exe!IloDefaultLPExtractor::applyRemoveFromAll()  + 0x198 bytes
    app.exe!IloLPExtractorManager::change()  + 0x6a bytes
    app.exe!IloLPExtractorManager::apply()  + 0x4c bytes
    app.exe!IloCplexI::apply()  + 0x77 bytes
    app.exe!IloEnvI::change()  + 0x63 bytes
    app.exe!IloRecycleBinI::removeFromAll()  + 0xe2 bytes
    app.exe!IloEnvI::removeFromAllAndDestroy()  + 0xd1 bytes
    app.exe!IloExtractableI::end()  + 0x11 bytes
    ***

    I will notify you if I find something new. It appears to be something like a bad pointer somewhere in the application.

    Thanks

    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Error ending CPLEX Environment in C++

    Posted 04/16/09 06:37 AM

    Originally posted by: SystemAdmin


    [smest001 said:]

    thanks for your info MMorin. I think we are having tow different problems. Although i could not solve my problem, I have just stopped using end() to free the memory; and i am lucky not to have any memory issues. When i am done with thi project I will look deeper into the problem. Will let you know if I find anything.
    Anyways thanks for your comments.
    #CPLEXOptimizers
    #DecisionOptimization