Results 1 to 5 of 5

Thread: Crash on startup with Visual C++ 2008 Express

  1. #1
    JohnB is offline Registered User
    Name: John Basrai
    Organization: Northrop Grumman
    Project: Airborne Payload Command Control Interface
    Join Date
    Feb 2005
    Posts
    49

    Crash on startup with Visual C++ 2008 Express

    My program is crashing during startup in generated code before main is called.

    Dialog box says: "The application failed to initialize properly (0x80000003). Click OK to terminate the application"

    This appears to be a bug in the compiler. The code is included below. It breaks at closing brace of the constructor when calls the destructor the temporary string that was passed to addExceptionFactory as the first arg.

    Code:
    class __F__xml__XmlParseException__Init
    {
    public:
    
        __F__xml__XmlParseException__Init()
        {
            ::IceInternal::factoryTable->addExceptionFactory("::xml::XmlParseException", ::xml::XmlParseException::ice_factory());
        } // <-- Crash here destroying tmp string!!
    
        ~__F__xml__XmlParseException__Init()
        {
            ::IceInternal::factoryTable->removeExceptionFactory("::xml::XmlParseException");
        }
    };
    
    static __F__xml__XmlParseException__Init __F__xml__XmlParseException__i;
    Ice version 3.3.1

    Compiler version: Visual C++ 2008 express edition.
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
    Copyright (C) Microsoft Corporation. All rights reserved.

    Compiler command line args:-nologo -W3 -WX -GR -EHa -FD -D_CONSOLE -GL /RTCu /MP2 -GF -Gm -O2 -MD

    Debug version: -nologo -W3 -WX -GR -EHa -FD -D_CONSOLE -GL /RTCu /MP2 -Zi -D_DEBUG -Od -MDd
    Last edited by JohnB; 03-16-2010 at 02:51 PM.

  2. #2
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,270
    Hi John,

    If it is a Visual Studio 2008 compiler bug, I am afraid there is not much we can do.

    Do you see the same problem with any of the C++ demos we provide?

    Did you try your code with Ice 3.4.0? (Note that the Ice 3.4.0 binary distribution for Windows was built with Visual Studio 2008 SP1, so you would need to apply SP1 to your installation).

    Best regards,
    Bernard
    Bernard Normier
    ZeroC, Inc.

  3. #3
    JohnB is offline Registered User
    Name: John Basrai
    Organization: Northrop Grumman
    Project: Airborne Payload Command Control Interface
    Join Date
    Feb 2005
    Posts
    49
    This was working before and is now not working. I think it stopped working after my PC auto installed some updates to SP1 because when I checked more closely it says that I have express SP1 but I'm not sure when it was installed. What is interesting is that it was working on my PC for a sometime now and other folks at my work would install the 2008 express but could not run the Ice application that I built even though it ran on my PC just fine. My current theory is that when they installed VC++ on their PCs it would pull down the SP1 patch at the same. I installed my copy a year ago so maybe I was running without SP1?

    As for Ice version 3.4.0 I have installed it on my PC but I'm not set up to run the slice2cpp compilers on the PC yet. My current build process runs them on Solaris 10 and then completes the build on my PC from the same NFS mounted directory. When I tried to upgrade on Sol10 it failed with a strange shared object error in slice2cpp. I will try running slice2cpp on the PC next.

    Your web site says you support 2008 express SP1 so I expect the samples will run so I will try that too.

    Quote Originally Posted by bernard View Post
    Hi John,

    If it is a Visual Studio 2008 compiler bug, I am afraid there is not much we can do.

    Do you see the same problem with any of the C++ demos we provide?

    Did you try your code with Ice 3.4.0? (Note that the Ice 3.4.0 binary distribution for Windows was built with Visual Studio 2008 SP1, so you would need to apply SP1 to your installation).

    Best regards,
    Bernard

  4. #4
    JohnB is offline Registered User
    Name: John Basrai
    Organization: Northrop Grumman
    Project: Airborne Payload Command Control Interface
    Join Date
    Feb 2005
    Posts
    49

    Demo worked so now what?

    I tried the "value" demo and it worked. I picked this demo because the generated code has the same call to 'factoryTable->addExceptionFactory' that was failing for my code but the demo is working. So does this mean it may not be a bug in Visual C++ 2008 after all? I ran this with Ice 3.4.0 so I guess now I need to go back and run the demos in Ice 3.3.1. The generated code in this area looks exactly the same so I don't expect it to change at all. If it works I'm still at loss as to why my original code doesn't work.

    It may be because of a complex linking/loading issue which could still be a complier bug. I still think the C++ run time library was not initialized soon enough in my case. Things are unpredicitable in the time before main is called and the Ice generated code is expecting a lot of things to be working during this program start up period. Larger programs just may link differently.

  5. #5
    JohnB is offline Registered User
    Name: John Basrai
    Organization: Northrop Grumman
    Project: Airborne Payload Command Control Interface
    Join Date
    Feb 2005
    Posts
    49

    I found the problem.

    I had a bug in the makefile and the manifest was not being embedded in the exe as part of the build step. It's strange the exe didn't refuse to run with a meaningful error message instead it just crashed.

    If the exe is run from the source dir and the manifest is available then it will find it and run just fine. But when it is deployed without it does not work at all. Deploying with the manifest will also work but I think that is not a good option if it can be folded into the exe.

    Thanks for your demos so I had something to compare my code and Makefiles with!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Visual Studio 2008 crash!
    By kizzie in forum Bug Reports
    Replies: 3
    Last Post: 11-15-2010, 11:28 AM
  2. Replies: 2
    Last Post: 06-29-2009, 10:00 AM
  3. Visual Studio 2008 Express and C#
    By tcorvin in forum Help Center
    Replies: 1
    Last Post: 03-27-2009, 05:36 PM
  4. visual c++ 2008 express
    By moshehak in forum Help Center
    Replies: 10
    Last Post: 09-24-2008, 02:24 PM
  5. Visual Studio Express 2005 C++ compiler error
    By blonder in forum Help Center
    Replies: 6
    Last Post: 05-22-2007, 11:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •