[Dip] Memory Access Error

Matthew Galati Matthew.Galati at sas.com
Sun Oct 17 19:43:55 EDT 2010


Hi Kipp,

Thanks for reporting this. The "solveRelaxed" function is actually called before the master problem is created - in the default call to generate initial variables. When it called getMasterObjValue, it tried to access a NULL pointer (since the master OSI was not yet created). I added a check for this and committed the change (to DecompAlgo.h).

Thanks,
Matt

> -----Original Message-----
> From: dip-bounces at list.coin-or.org [mailto:dip-bounces at list.coin-
> or.org] On Behalf Of Kipp Martin
> Sent: Saturday, October 16, 2010 4:24 PM
> To: Matthew Galati
> Cc: dip at list.coin-or.org
> Subject: Re: [Dip] Memory Access Error
> 
> Hi Matt:
> 
> If you want you can duplicate the error in SmallIP_DecompApp2. It
> exhibits the same behavior. I attach the code. I took your code and
> added
> 
> #include "DecompAlgo.h"
> 
> to the start and then in sovleRelaxed() added
> 
> 	DecompAlgo* algo = getDecompAlgo();
> 
> 	const double * masterDualSol    = algo->getMasterDualSolution();
> 	const double * masterPrimalSol = algo->getMasterPrimalSolution();
> 	double masterObjValue = algo->getMasterObjValue();
> 
> Cheers
> 
> >> Then, use the access methods in there, e.g.:
> >>    const double * masterDualSol    = algo->getMasterDualSolution();
> >>    const double * masterPrimalSol = algo->getMasterPrimalSolution();
> >>    double masterObjValue = algo->getMasterObjValue();
> >>
> >
> > I spoke too soon saying thins worked. When I try the above it
> crashes:
> >
> > Program received signal EXC_BAD_ACCESS, Could not access memory.
> > Reason: KERN_PROTECTION_FAILURE at address: 0x00000000 0x006f8ef0 in
> > DecompAlgo::getMasterObjValue (this=0x6039200) at
> > /Users/kmartin/coin/dip-trunk/vpath-
> debug/include/coin/DecompAlgo.h:662
> > 662           const double * objCoef = m_masterSI-
> >getObjCoefficients();
> > (gdb) backtrace
> > #0  0x006f8ef0 in DecompAlgo::getMasterObjValue (this=0x6039200) at
> > /Users/kmartin/coin/dip-trunk/vpath-
> debug/include/coin/DecompAlgo.h:66
> > 2
> > #1  0x0000842f in OSDipApp::solveRelaxed (this=0xbfffeab4,
> > whichBlock=0, redCostX=0x6050200, convexDual=9000000000000000,
> > vars=@0xbfffe968) at
> > OSDipApp.cpp:609
> > #2  0x0001c802 in DecompAlgo::solveRelaxed (this=0x6039200,
> > redCostX=0x6050200, origCost=0x6013e00, alpha=9000000000000000,
> > n_origCols=1640, isNested=false, algoModel=@0x59a5b04,
> > solveResult=0xbfffe2b8, vars=@0xbfffe968) at
> > ../../../Dip/src/DecompAlgo.cpp:6181
> > #3  0x00029df7 in DecompAlgo::generateInitVars (this=0x6039200,
> > initVars=@0xbfffe968) at ../../../Dip/src/DecompAlgo.cpp:2586
> > #4  0x000286a8 in DecompAlgo::initSetup (this=0x6039200,
> > utilParam=0xbfffee1c, sectionParam=@0xbfffea28) at
> > ../../../Dip/src/DecompAlgo.cpp:280
> > #5  0x006effc5 in DecompAlgoPC::DecompAlgoPC (this=0x6039200,
> > app=0xbfffeab4, utilParam=0xbfffee1c, doSetup=true) at
> > /Users/kmartin/coin/dip-trunk/vpath-
> debug/include/coin/DecompAlgoPC.h:
> > 242
> > #6  0x00002cb0 in main (argc=1, argv=0xbfffef00) at OSDip_Main.cpp:80
> >
> >
> > Thanks
> >
> >
> >
> 
> 
> --
> Kipp Martin
> Professor of Operations Research
> and Computing Technology
> Booth School of Business
> University of Chicago
> 5807 South Woodlawn Avenue
> Chicago, IL 60637
> 773-702-7456
> kmartin at chicagobooth.edu
> http://www.chicagobooth.edu/faculty/bio.aspx?person_id=12825325568
> http://projects.coin-or.org/OS




More information about the Dip mailing list