Archived

This forum has been archived. Please start a new discussion on GitHub.

Ice+Qt application runs fine but exits when debugging

I created a remotely accessible Qt GUI with Ice. The application runs fine, but when I try to debug it (Platform: Windows XP 64 bit, Compiler & debugger: SDK 7.1 (32 bit), IDE: Qt Creator (32 bit)) the following C++ exception is reported by the debugger (cdb):
(133c.880): C++ EH exception - code e06d7363 (first chance)

 *** WARNING: Unable to verify checksum for C:\Program Files (x86)\ZeroC\Ice-3.5.1\bin\ice35d.dll
 *** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Program Files (x86)\ZeroC\Ice-3.5.1\bin\ice35d.dll - 
s
sException at 0x7d4e237e, code: 0xe06d7363: C++ exception, flags=0x1 (execution cannot be continued) (first chance) in ice35d!Ice::PropertiesAdminI::removeUpdateCallback
 
 Exception at 0x7d4e237e, code: 0xe06d7363: C++ exception, flags=0x1 (execution cannot be continued) (first chance) in ice35d!Ice::PropertiesAdminI::removeUpdateCallback

sProcess exited (1)

If I understand this correctly, a C++ exception is thrown somewhere in PropertiesAdminI::removeUpdateCallback and gets handled (by exiting the process). Any idea what could cause this?

Comments

  • xdm
    xdm La Coruña, Spain
    What compiler version are you using?

    Have you implemented a custom PropertiesAdminUpdateCallback?

    Note that Ice debug symbols are in a separate installer, Ice-PDBs-3.5.1.msi
  • As for the compiler: the one shipped with Windows SDK 7.1 (MSVC2010, cl.exe file version: 16.0.30319.1)

    Installing the debug symbols fails with the message "Ice 3.5.1 must be installed first". I installed Ice 3.5.1 in its default directory.

    I did not implement a custom PropertiesAdminUpdateCallback. In fact it's a very straightforward application. Here are some relevant bits:
    class RinzlerSimplePlotter_iceapp : virtual public Ice::Application
    {
    public:
        int run(int argc, char* argv[])
    {
        // Create an object adapter.
        //
        Ice::CommunicatorPtr ic = communicator();
        Ice::ObjectAdapterPtr adapter = ic->createObjectAdapter("RinzlerSimplePlotter_adapter");
    
        // Create GUI
        //
        QApplication a(argc, argv);
        RinzlerSimplePlotter w;
    
        // Create a servant for receiving invocations
        //
        SimplePlotterIPtr o = new SimplePlotterI();
    
        // Add ICE object to adapter
        //
        adapter->addWithUUID(o);
    
        // Realize GUI
        //
        w.show();
    
        // All objects are created, allow client requests now
        //
        adapter->activate();
    
        // Start the event loop
        //
        return a.exec();
    }
    };
    
    
    int main(int argc, char *argv[])
    {
        RinzlerSimplePlotter_iceapp app;
        return app.main(argc,argv);
    }
    

    As I said, everything runs fine, it's just when I want to debug it I get that C++ exception followed by an exit.
  • xdm
    xdm La Coruña, Spain
    The PDBs installer failure is a bit odd, the installer checks the registry keyword know where Ice was installed.

    Ice-3.5.1.msi writes this installation path to this keyword:
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ZeroC\Ice 3.5.1
    

    Isn't that keyword present in your system?

    We build Ice with VS2010 SP1, seems that you don't have the SP1 installed, you must use VS 2010 SP1 to build Ice applications.

    Download Microsoft Visual C++ 2010 Service Pack 1 Compiler Update for the Windows SDK 7.1 from Official Microsoft Download Center

    Are you building your application with Qt creator ?
    You need to check your build flags, for debug builds you must use /MDd and /MD for release builds. You must also ensure that C++ exception are enabled /EHsc

    See How do I create a C++ Visual Studio project for Ice? - ZeroC Documentation - ZeroC

    Have you try to debug with Visual Studio directly?

    Also note that we don't support Windows XP 64 bit, just Windows XP SP3 x86, see here for a list of supported platforms
  • I'm using Visual Studio 2010 express for non-qt applications (I know you don't support express, but compiling & debugging works fine). For Qt application I use Qt Creator (compiler flags are set as you described). I also install the VS2010 SP1 for SDK7.1 and for VS2010.

    As for the symbols, the registry keyword was
    HKEY_LOCAL_MACHINE\SOFTWARE\ZeroC\Ice 3.5.1
    
    I copied it to Wow6432Node and managed to install the symbols. The debugger gives this output now:
    (ee8.53c): C++ EH exception - code e06d7363 (first chance)
     *** WARNING: Unable to verify checksum for C:\Program Files (x86)\ZeroC\Ice-3.5.1\bin\ice35d.dll
    s
    sException at 0x7d4e237e, code: 0xe06d7363: C++ exception, flags=0x1 (execution cannot be continued) (first chance) at c:\users\jose\desktop\rc3\build-x86-vc100-debug\ice-3.5.1-src\cpp\src\ice\propertiesi.cpp:411
     
     Exception at 0x7d4e237e, code: 0xe06d7363: C++ exception, flags=0x1 (execution cannot be continued) (first chance) at c:\users\jose\desktop\rc3\build-x86-vc100-debug\ice-3.5.1-src\cpp\src\ice\propertiesi.cpp:411
    

    So this exception is thrown in propertiesi.cpp:
    Ice::PropertiesI::load(const std::string& file)
    {
    ...
            IceUtilInternal::ifstream in(Ice::nativeToUTF8(_converter, file));
            if(!in)
            {
                FileException ex(__FILE__, __LINE__);
                ex.path = file;
                ex.error = getSystemErrno();
                throw ex;
            }
    ...
    }
    

    These are the debug flags:
    C:\Program Files (x86)\Debugging Tools for Windows (x86)\cdb.exe -aqtcreatorcdbext.dll -lines -G -c .idle_cmd !qtcreatorcdbext.idle -y cache*C:\Documents and Settings\Administrator\Local Settings\Temp\symbolcache;srv*http://msdl.microsoft.com/download/symbols C:\projects\rinzler\GUI\RinzlerSimplePlotter\debug\RinzlerSimplePlotter.exe
    
    and these are the compile flags:
    cl -c -nologo -Zm200 -Zc:wchar_t -Zi -MDd -GR -W3 -w34100 -w34189 -EHsc -DUNICODE -DWIN32
    
  • xdm
    xdm La Coruña, Spain
    Hi,

    The only reason for this code to throw an exception is that a configuration file isn't being found. Are you using --Ice.Config argument, or ICE_CONFIG environment variable to load a configuration file? if that is the case you should check why the file isn't found.

    It is a bit odd that the debugger doesn't let you continue, this exception is handled by Ice::Application and should print an error message before it exists, similar to this.
    ./server --Ice.Config=config.a
    !! 12/16/13 14:06:55.971 ./server: error: PropertiesI.cpp:407: Ice::FileException:
       file exception: No such file or directory
       path: config.a
    

    You could try to surround the call to main with a try catch block to see if the exception is catch there.
    int main(int argc, char *argv[])
    {
        RinzlerSimplePlotter_iceapp app;
        try
        {
            return app.main(argc,argv);
        }
        catch(const std::exception& ex)
        {
            std::cerr << ex << std::endl;
        }
    }
    

    You need to check why the debugger doesn't found the debug symbols.
    I know you don't support express,

    We support Visual Studio Express for C++ development, Microsoft doesn't support custom Add-ins with Visual Studio Express so you cannot use the Ice Visual Studio Add-In with Visual Studio Express. We do not support Windows XP 64, just Windows XP SP3 X86.

    You can also try to debug you application from Visual Studio Express maybe you have better look with this debugger.
  • I tested it without configuration files, but I forgot that ICE_CONFIG was set (and not valid anymore). Now I can start debugging, thanks!

    It remains strange that the debugger exits on a C++ exception in ice35d.dll but not on the C++ exceptions I throw myself. But anyway, that's probably not an Ice thing, so thanks again for helping me out.