[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unexplained error in channels



> Date: Tue, 1 May 2001 14:17:24 -0500 (CDT)
> From: Ravi Chamarty <ravi@ittc.ukans.edu>
> To: janos-discuss@fast.cs.utah.edu
> Subject: Unexplained error in channels
> 
> Hi,
> 
>  I am presently using a variation of socktest example(written in C) as
> used in the Moab/OSKit. When the socket based outchannel is being
> destroyed, I see the following error:
> 
> ../nodeos/impl/ani_chan.h: 217
> Failed assertion: 'chan->refs >= 0'
> 
>  I failed to understand the importance of the field 'refs'. I
> understand that this part of the code is being called by the fn.
> 'ani_chan_deinit'(src/channel.c) which in turn is being called when the
> flow is being destroyed using 'ani_flow_destroy_internal'(src/flow.c) .Can
> someone explain what's going wrong here?
> 

The refs field keeps the internal data structure (ani_chan_t) alive; i.e.,
so the memory isn't deallocated while some other internal entity like a
thread still has a pointer to it.

What is happening is that you have probably discovered a race condition in
the termination code.  If you have a simple example that reproduces the
problem, send it to me and I'll take a look.





[ Janos ] [ OSKit ] [ Network Testbed ] [ Flick ] [ Fluke ]
Flux Research Group / Department of Computer Science / University of Utah