[Clp-tickets] [COIN-OR Linear Programming Solver] #36: Application crash in Windows 2008 Server and Windows 7

COIN-OR Linear Programming Solver coin-trac at coin-or.org
Thu Mar 18 13:50:19 EDT 2010


#36: Application crash in Windows 2008 Server and Windows 7
---------------------------------------------------------+------------------
 Reporter:  alexmuad                                     |       Owner:  somebody
     Type:  defect                                       |      Status:  new     
 Priority:  major                                        |   Milestone:          
Component:  component1                                   |     Version:          
 Keywords:  CLP library crash Windows 2008 Server and 7  |  
---------------------------------------------------------+------------------
 == Brief Description ==

 I wrote a driver of my own to use CLP libraries. This was working fine
 with '''Windows XP''' for months.

 Then I needed to move to '''Windows 2008 Server''' and the application
 crashes at the end. After that I ran a test in '''Windows 7''' and it
 fails too.


 == Steps ==

 I ran the driver in Windows 2008 Server, it loads the model and solves it.
 The solution is fine, but the program crashes when it is about to end.

 The problem happens when it calls the destructors to free the memory of
 the variables/objects when the '''main()''' scope ends.

 Debugging the application I found that the problem is the
 '''gutsOfDelete()''' function from '''ClpModel''' class. Specifically, the
 following statements:

 {{{
 delete [] rowActivity_;
 delete [] columnActivity_;
 }}}

 Those are double *.

 In '''debug mode''', the following assertion in the '''operator delete'''
 function fails:

 {{{
 /* get a pointer to memory block header */
 pHead = pHdr(pUserData);

 /* verify block type */
 _ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse));
 }}}

 In '''release mode''', it throws an unhandled exception for access
 violation reading a memory block (see attachment).

 I already tried adding try/catch blocks to the involved statements in the
 gutsOfDelete() function, but still not catching the exception. Tried
 '''CoinError''' and generic exceptions without luck.

 I'm using Visual Studio 2008. Also, when debugging the issue, the watch
 window shows that the '''pHead->nBlockUse''' checked in the assertion, is
 invalid (see attachment).

 This gutsOfDelete() function is called many times during the different
 phases of the solving procedure, but it only fails in the last phase, when
 memory is being freed.

-- 
Ticket URL: <https://projects.coin-or.org/Clp/ticket/36>
COIN-OR Linear Programming Solver <http://projects.coin-or.org/Clp>
A linear programming solver.



More information about the Clp-tickets mailing list