Archived

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

unknown exception in connection monitor

Hi, all! I am writing a server with ice 3.4.1, my os is windows server 2003 and compiler is msvc 9.0. after running for several days, an error says "unknown exception in connection monitor" occurs every 6 seconds, anybody knows why? thanks!

Comments

  • benoit
    benoit Rennes, France
    Hi,

    Could you try with the latest Ice 3.4.2 version and see if it still occurs? Could you also copy/paste the exact error message? Does it print something about this unknown exception for instance?

    Cheers,
    Benoit.
  • benoit wrote: »
    Hi,

    Could you try with the latest Ice 3.4.2 version and see if it still occurs? Could you also copy/paste the exact error message? Does it print something about this unknown exception for instance?

    Cheers,
    Benoit.

    Thanks for your reply! There isn't any further information except for "unknown exception in connection monitor". I will try the new version later.
  • benoit wrote: »
    Hi,

    Could you try with the latest Ice 3.4.2 version and see if it still occurs? Could you also copy/paste the exact error message? Does it print something about this unknown exception for instance?

    Cheers,
    Benoit.

    Hi, Benoit! I have just upgrade my app to ice 3.4.2, the error still occurs after running for about 3 days. The error message is as follows:
    !! 06/28/12 19:54:16.970 jcomm.exe: error: unknown exception in connection monitor
    jcomm is the name of my app, and this message is output every 6 seconds. please help!
  • benoit
    benoit Rennes, France
    Hi,

    Is everything still working fine once this message starts showing up? Is your application perhaps reaching some resource limits which could cause allocation failures? Can you ensure that you don't mix-up debug with release libraries or vice versa (see this FAQ)?

    It isn't clear to me where this exception could come from and it should in theory not occur.

    Unfortunately the exception handler doesn't catch std::exception. You could try modifying the Ice source code to fix this. With the Ice-3.4.2 source distribution, in the cpp/src/Ice/ConnectionMonitor.cpp replace the following at line 131:
            catch(const Exception& ex)
             {   
                 IceUtil::Mutex::Lock sync(*this);
                 if(!_instance)
                       return;
                 }
     
                 Error out(_instance->initializationData().logger);
                 out << "exception in connection monitor:\n" << ex;
             }
    

    with:
            catch(const std::exception& ex)
             {   
                 IceUtil::Mutex::Lock sync(*this);
                 if(!_instance)
                       return;
                 }
     
                 Error out(_instance->initializationData().logger);
                 out << "exception in connection monitor:\n" << ex.what();
             }
    

    Then rebuild Ice and replace the Ice DLL used by your program with the new DLL. If the exception is a standard C++ exception will get a little more information.

    Cheers,
    Benoit.
  • benoit wrote: »
    Hi,

    Is everything still working fine once this message starts showing up? Is your application perhaps reaching some resource limits which could cause allocation failures? Can you ensure that you don't mix-up debug with release libraries or vice versa (see this FAQ)?

    It isn't clear to me where this exception could come from and it should in theory not occur.

    Unfortunately the exception handler doesn't catch std::exception. You could try modifying the Ice source code to fix this. With the Ice-3.4.2 source distribution, in the cpp/src/Ice/ConnectionMonitor.cpp replace the following at line 131:
            catch(const Exception& ex)
             {   
                 IceUtil::Mutex::Lock sync(*this);
                 if(!_instance)
                       return;
                 }
     
                 Error out(_instance->initializationData().logger);
                 out << "exception in connection monitor:\n" << ex;
             }
    

    with:
            catch(const std::exception& ex)
             {   
                 IceUtil::Mutex::Lock sync(*this);
                 if(!_instance)
                       return;
                 }
     
                 Error out(_instance->initializationData().logger);
                 out << "exception in connection monitor:\n" << ex.what();
             }
    

    Then rebuild Ice and replace the Ice DLL used by your program with the new DLL. If the exception is a standard C++ exception will get a little more information.

    Cheers,
    Benoit.

    Hi,Benoit!
    1. my app won't serve clients' request when this error message shows up.
    2. I am 100% sure about my app is a release version.
    3. the standard C++ exception didn't give any information after i modify the ConnectionMonitor.cpp and rebuild.
    4. I monitor the resource utilization when my app is running, and found a wield thing is that virtual memory is always rising up to about 1.9G when error occurs, meanwhile, the physical memory is at first rising and then droping, then rising... Is this related to the smart pointer's memory allocation and deallocation scheme?

    Best Regards!
    Yelo
  • benoit
    benoit Rennes, France
    Hi,

    It sounds like you're catching a Windows structured exception instead of a C++ exception. However, this should in theory not happen if you're using Visual Studio 2008 and the standard Ice build. Did you build Ice yourself and if yes can you confirm that you're using the default build configuration?

    Also, did you try to run a debug build of your program?

    I would also recommend to use some memory checker tool to ensure there's no memory management issue. If the memory allocated by your program constantly grows, it sounds like there's some kind of leak. When your reach the 2GB limit of virtual memory space your program will start running into allocation issues...

    Smart pointers shouldn't cause memory allocation issues. If your Slice classes define cyclic references however, you will need to enable Ice garbage collection to ensure that class graphs are correctly de-allocated when your code doesn't hold any more references to objects from the graph, see here in the Ice manual for more information on this.


    Cheers,
    Benoit.
  • benoit wrote: »
    Hi,

    It sounds like you're catching a Windows structured exception instead of a C++ exception. However, this should in theory not happen if you're using Visual Studio 2008 and the standard Ice build. Did you build Ice yourself and if yes can you confirm that you're using the default build configuration?

    Also, did you try to run a debug build of your program?

    I would also recommend to use some memory checker tool to ensure there's no memory management issue. If the memory allocated by your program constantly grows, it sounds like there's some kind of leak. When your reach the 2GB limit of virtual memory space your program will start running into allocation issues...

    Smart pointers shouldn't cause memory allocation issues. If your Slice classes define cyclic references however, you will need to enable Ice garbage collection to ensure that class graphs are correctly de-allocated when your code doesn't hold any more references to objects from the graph, see here in the Ice manual for more information on this.


    Cheers,
    Benoit.

    Thanks for your help, Benoit. I have found the problem where it is, which is the memory leak. everything is ok now.

    Best Regards
    yelo