Skip to content
This repository has been archived by the owner on Mar 3, 2019. It is now read-only.

[TRAC] Application crash in Windows 2008 Server and Windows 7 #48

Open
qtothec opened this issue Oct 16, 2018 · 1 comment
Open

[TRAC] Application crash in Windows 2008 Server and Windows 7 #48

qtothec opened this issue Oct 16, 2018 · 1 comment

Comments

@qtothec
Copy link

qtothec commented Oct 16, 2018

Moved from TRAC as part of COIN fORgery: https://projects.coin-or.org/Clp/ticket/36

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.

@bernalde
Copy link

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants