[MsVisualStudio] OsiClpSolverInterface crash in VS2008 x64

Chris Bielow bielow at pcpool.mi.fu-berlin.de
Fri May 22 02:51:39 EDT 2009


Hi again,

I meanwhile solved the problem and thought I let the curious reader know 
whats going on:

First of all: CoinMP-1.3.3 is fine for the x64 Windows compiler as it is 
(just derive solution files as usual).

The problem that led to the crash (strangely only in Release mode) were 
inconsistent compiler flags:
I used "/D_SECURE_SCL=0" in my library which links against the core 
COIN-OR libs. COIN-OR on the other hand uses the implicit default 
"/D_SECURE_SCL=1". Somehow this leads to very nasty stack corruptions.
The MSDN docu does not mention this might happen 
(http://msdn.microsoft.com/en-us/library/aa985965(VS.80).aspx).

greetings
Chris

Chris Bielow wrote:
> Hi,
> 
> I'm trying to compile&run that really great ILP solver of yours using
> Visual Studio 2008 in 64bit mode.
> My ILP runs fine in debug mode, but when switching to release mode I get
> a nasty stack corruption which I have been unable to trace. The culprit
> seems to be the "OsiClpSolverInterface" class. When I create an object
> with "new" the program crashes when calling "delete" on it as the next
> command (I don't do anything in between).
> In a simple test program which just uses the coin-or libs and nothing
> else, I can instanciate "OsiClpSolverInterface" in release mode and
> delete it without a crash. However, in my big project with lots of other
> libs it will crash in release mode.
> The exact crash happens in the base class
> OsiSolverInterface::setInitialData() in the line: delete handler_;
> Being a stack corruption though, I'm not sure this is really where the
> mess starts.
> This just happens on with x64 Visual Studio. Everything seems fine on
> Linux x64.
> 
> 
> So long story short:
> Has someone ever attempted to use any of the above libs for VS2008 x64?!
> Is a problem like this known?!
> 
> Would someone be willing to help tackle the issue?! I'd be happy to
> provide detailed information on how to reproduce the bug. Probalby
> though the proper way is to have a closer look at all the compile
> warnings. I think some of them might be the key to the solution, but to
> fix them all would take me days or weeks. Most of the warnings stem from
> the fact that M$ decided to
> have size_t!=unsigned int on x64 platforms.
> As there seems to be a discussion going on about refactorisation, maybe 
> this is the perfect chance of making the code run on win x64...
> 
> Platform Information:
> - Codebase: CoinMP-1.3.3.tar.gz
> - IDE: VS2008
> - changed compiler flags: /MT(d) flags to /MD(d)
> - x64 configuration (directly derived from win32)
> 
> I only need the six core libs: Cbc, cgl, clp, osi, osiclp and coinutils.
> It compiles with some type conversion warnings and created the six .lib 
> files.
> 
> Already posted something very similar on the VS mailing list, but no 
> reply within a week :(
> 
> Best,
> Chris
> 

-- 
Freie Universität Berlin
Institut für Informatik               phone: +49 30 838 75137
AG Algorithmische Bioinformatik       room 020
Takustr. 9
D-14195 Berlin



More information about the MSVisualStudio mailing list