Results 1 to 2 of 2

Thread: assert false when quiting

  1. #1
    syr
    syr is offline Registered User
    Name: song yanrong
    Organization: QingDao University
    Project: thesis
    Join Date
    Aug 2011
    Posts
    3

    assert false when quiting

    Recently, I had a trouble when using Ice3.4.2. Sometimes, an Ice assert is raised in ConnectionI.h #245 when my application is quiting.
    It happens occasionally, so it puzzles me very much. By the way, only timeout proxy has the problem.

    I have tried to analyze this problem by reviewing the source code of Ice3.4.2. And I guess that it is a bug in Ice3.4.2.
    In ConnectionI::dispatch(ConnectionI.h #1442), the following code is added in Ice3.4.2.


    //
    // Decrease dispatch count.

    //
    if(!sentCBs.empty() || outAsync)

    {

    IceUtil::Monitor<IceUtil::Mutex>::Lock sync(*this);

    if(--_dispatchCount == 0)

    {

    if(_state == StateClosing)

    {

    try

    {

    initiateShutdown();

    }

    catch(const LocalException& ex)

    {

    setState(StateClosed, ex);

    }

    }

    else if(_state == StateFinished)

    {

    _reaper->add(this);

    }

    notifyAll();

    }

    }

    Ice Assert is raised in initiateShutdown function. When a SocketOperationRead is retrieved from IOCP, first,
    _readTimeout timer task is removed from the Timer through unscheduleTimeout(current.operation).
    however _writeTimeout timer task still remains in it. Meanwhile, the application is quiting,
    initiateShutdown is called and the program is trying to push _writeTimeout timer task into the Timer again,

    bool inserted = _tasks.insert(make_pair(task, time)).second;

    if(!inserted)

    {

    throw IllegalArgumentException(__FILE__, __LINE__, "task is already schedulded");

    }

    so the failure of the insert triggers an exception and then an assert is fired.

    I have tried some ways to resolve it but no help, so how can I avoid this problem? and is it a bug in Ice3.4.2?

    Thanks.

  2. #2
    benoit's Avatar
    benoit is online now ZeroC Staff
    Name: Benoit Foucher
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Rennes, France
    Posts
    2,196
    Hi,

    Thanks for the bug report! We have already fixed this bug on our mainline, the fix will be included in the next Ice release.

    Cheers,
    Benoit.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. assert !_changes.empty() on a high load
    By Oleh Babyak in forum Bug Reports
    Replies: 1
    Last Post: 12-10-2007, 12:25 PM
  2. Replies: 0
    Last Post: 04-20-2007, 06:11 AM
  3. Replies: 0
    Last Post: 07-24-2006, 08:44 AM
  4. why return false ?
    By OrNot in forum Help Center
    Replies: 2
    Last Post: 01-04-2006, 01:50 AM
  5. assert() in slice2java generated code?
    By SteveWampler in forum Help Center
    Replies: 2
    Last Post: 04-13-2004, 01:38 PM

Posting Permissions

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