public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] cyg_current_time () locking up
@ 2001-08-10  8:39 Trenton D. Adams
  2001-08-10  8:47 ` Trenton D. Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Trenton D. Adams @ 2001-08-10  8:39 UTC (permalink / raw)
  To: 'eCos Disuss'

This is very odd.  I have a program that was working fine yesterday.
Now it locks up when I call cyg_current_time ().  Below is the code that
locks up.  It locks up right on cyg_current_time ().  Any particular
reason why this could happen?  problem in the system code maybe?

        ticks = cyg_current_time ();
        cyg_mutex_lock (&threadData->mutexA1);
        newDataLen = GenerateWave (threadData->channelABuffer1, 
             &lastValue);
        threadData->channelABufLen1 = newDataLen;
        cyg_cond_signal (&threadData->condA1);
        cyg_mutex_unlock (&threadData->mutexA1);

Trenton D. Adams
Extreme Engineering
#17, 6025 - 12 St. SE
Calgary, Alberta, Canada
T2H 2K1

Phone: 403 640 9494 ext-208
Fax: 403 640 9599

http://www.extremeeng.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [ECOS] cyg_current_time () locking up
  2001-08-10  8:39 [ECOS] cyg_current_time () locking up Trenton D. Adams
@ 2001-08-10  8:47 ` Trenton D. Adams
  2001-08-10  8:50   ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: Trenton D. Adams @ 2001-08-10  8:47 UTC (permalink / raw)
  To: 'eCos Disuss'

Nope, that's not what's locking it up.  I get the error below after
fiddling with some of the code.  What does it mean?

ASSERT FAIL: <2>[166]static void Cyg_Scheduler::unlock_inner() Bad next
thread

-----Original Message-----
From: ecos-discuss-owner@sources.redhat.com
[ mailto:ecos-discuss-owner@sources.redhat.com ] On Behalf Of Trenton D.
Adams
Sent: Friday, August 10, 2001 9:40 AM
To: 'eCos Disuss'
Subject: [ECOS] cyg_current_time () locking up


This is very odd.  I have a program that was working fine yesterday.
Now it locks up when I call cyg_current_time ().  Below is the code that
locks up.  It locks up right on cyg_current_time ().  Any particular
reason why this could happen?  problem in the system code maybe?

        ticks = cyg_current_time ();
        cyg_mutex_lock (&threadData->mutexA1);
        newDataLen = GenerateWave (threadData->channelABuffer1, 
             &lastValue);
        threadData->channelABufLen1 = newDataLen;
        cyg_cond_signal (&threadData->condA1);
        cyg_mutex_unlock (&threadData->mutexA1);

Trenton D. Adams
Extreme Engineering
#17, 6025 - 12 St. SE
Calgary, Alberta, Canada
T2H 2K1

Phone: 403 640 9494 ext-208
Fax: 403 640 9599

http://www.extremeeng.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] cyg_current_time () locking up
  2001-08-10  8:47 ` Trenton D. Adams
@ 2001-08-10  8:50   ` Andrew Lunn
  2001-08-10  8:55     ` Trenton D. Adams
  2001-08-10  9:17     ` Grant Edwards
  0 siblings, 2 replies; 8+ messages in thread
From: Andrew Lunn @ 2001-08-10  8:50 UTC (permalink / raw)
  To: Trenton D. Adams; +Cc: 'eCos Disuss'

On Fri, Aug 10, 2001 at 09:47:47AM -0600, Trenton D. Adams wrote:
> Nope, that's not what's locking it up.  I get the error below after
> fiddling with some of the code.  What does it mean?
> 
> ASSERT FAIL: <2>[166]static void Cyg_Scheduler::unlock_inner() Bad next
> thread

At a guess, you have a stack overflow which has corrupted something
important in one of your threads. Try making your stacks bigger.

        Andrew

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [ECOS] cyg_current_time () locking up
  2001-08-10  8:50   ` Andrew Lunn
@ 2001-08-10  8:55     ` Trenton D. Adams
  2001-08-10  9:01       ` Andrew Lunn
  2001-08-10  9:17     ` Grant Edwards
  1 sibling, 1 reply; 8+ messages in thread
From: Trenton D. Adams @ 2001-08-10  8:55 UTC (permalink / raw)
  To: 'Andrew Lunn'; +Cc: 'eCos Disuss'

Thanks! :)

How did you come to that conclusion anyhow?

-----Original Message-----
From: Andrew Lunn [ mailto:andrew.lunn@ascom.ch ] 
Sent: Friday, August 10, 2001 9:51 AM
To: Trenton D. Adams
Cc: 'eCos Disuss'
Subject: Re: [ECOS] cyg_current_time () locking up


On Fri, Aug 10, 2001 at 09:47:47AM -0600, Trenton D. Adams wrote:
> Nope, that's not what's locking it up.  I get the error below after
> fiddling with some of the code.  What does it mean?
> 
> ASSERT FAIL: <2>[166]static void Cyg_Scheduler::unlock_inner() Bad
next
> thread

At a guess, you have a stack overflow which has corrupted something
important in one of your threads. Try making your stacks bigger.

        Andrew

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] cyg_current_time () locking up
  2001-08-10  8:55     ` Trenton D. Adams
@ 2001-08-10  9:01       ` Andrew Lunn
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Lunn @ 2001-08-10  9:01 UTC (permalink / raw)
  To: Trenton D. Adams; +Cc: 'eCos Disuss'

On Fri, Aug 10, 2001 at 09:55:41AM -0600, Trenton D. Adams wrote:
> Thanks! :)
> 
> How did you come to that conclusion anyhow?

It was code that you said worked before, but does not now.
cyg_current_time() is not something i would expect to go wrong. This
makes me think its something else. From experiance, the normal
something else which causes this assertion failure is stack overflow.
Been there, done that, know what to look for now.

        Andrew
 
> -----Original Message-----
> From: Andrew Lunn [ mailto:andrew.lunn@ascom.ch ] 
> Sent: Friday, August 10, 2001 9:51 AM
> To: Trenton D. Adams
> Cc: 'eCos Disuss'
> Subject: Re: [ECOS] cyg_current_time () locking up
> 
> 
> On Fri, Aug 10, 2001 at 09:47:47AM -0600, Trenton D. Adams wrote:
> > Nope, that's not what's locking it up.  I get the error below after
> > fiddling with some of the code.  What does it mean?
> > 
> > ASSERT FAIL: <2>[166]static void Cyg_Scheduler::unlock_inner() Bad
> next
> > thread
> 
> At a guess, you have a stack overflow which has corrupted something
> important in one of your threads. Try making your stacks bigger.
> 
>         Andrew
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] cyg_current_time () locking up
  2001-08-10  8:50   ` Andrew Lunn
  2001-08-10  8:55     ` Trenton D. Adams
@ 2001-08-10  9:17     ` Grant Edwards
  2001-08-10  9:35       ` Hugo Tyson
  1 sibling, 1 reply; 8+ messages in thread
From: Grant Edwards @ 2001-08-10  9:17 UTC (permalink / raw)
  To: Trenton D. Adams, 'eCos Disuss'

On Fri, Aug 10, 2001 at 05:50:46PM +0200, Andrew Lunn wrote:
> On Fri, Aug 10, 2001 at 09:47:47AM -0600, Trenton D. Adams wrote:

> > Nope, that's not what's locking it up.  I get the error below after
> > fiddling with some of the code.  What does it mean?
> > 
> > ASSERT FAIL: <2>[166]static void Cyg_Scheduler::unlock_inner() Bad next
> > thread
> 
> At a guess, you have a stack overflow which has corrupted something
> important in one of your threads. Try making your stacks bigger.

I don't remember seeing the choice, but does eCos have an
option to check for stack overflows (e.g. during context
switches or timer interrupts)?  One of the kernels I wrote
once-upon-a-time would do that (optionally) and it proved
rather handy during development.  IIRC, we usually turned it
off before shipping code since it slowed things down a tiny
bit.

It didn't catch every case of stack overflow since it was still
possible for the program to blow up irreperably before the next
context switch or timer interrupt, but it caught enough
problems to be useful. Perhaps in the days of cheap RAM it's
not as critical. Back then RAM was tight and we ran pretty
close to line on stack sizes, and a minor change could push you
over the edge pretty easily.

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] cyg_current_time () locking up
  2001-08-10  9:17     ` Grant Edwards
@ 2001-08-10  9:35       ` Hugo Tyson
  2001-08-10  9:51         ` Grant Edwards
  0 siblings, 1 reply; 8+ messages in thread
From: Hugo Tyson @ 2001-08-10  9:35 UTC (permalink / raw)
  To: ecos-discuss

Grant Edwards <grante@visi.com> writes:
> On Fri, Aug 10, 2001 at 05:50:46PM +0200, Andrew Lunn wrote:
> > On Fri, Aug 10, 2001 at 09:47:47AM -0600, Trenton D. Adams wrote:
> 
> > > Nope, that's not what's locking it up.  I get the error below after
> > > fiddling with some of the code.  What does it mean?
> > > 
> > > ASSERT FAIL: <2>[166]static void Cyg_Scheduler::unlock_inner() Bad next
> > > thread
> > 
> > At a guess, you have a stack overflow which has corrupted something
> > important in one of your threads. Try making your stacks bigger.
> 
> I don't remember seeing the choice, but does eCos have an
> option to check for stack overflows

See the option CYGFUN_KERNEL_ALL_THREADS_STACK_CHECKING.

> It didn't catch every case of stack overflow since it was still
> possible for the program to blow up irreperably before the next
> context switch or timer interrupt, but it caught enough
> problems to be useful.

Indeed, that's the reality of it.

	- Huge

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ECOS] cyg_current_time () locking up
  2001-08-10  9:35       ` Hugo Tyson
@ 2001-08-10  9:51         ` Grant Edwards
  0 siblings, 0 replies; 8+ messages in thread
From: Grant Edwards @ 2001-08-10  9:51 UTC (permalink / raw)
  To: Hugo Tyson; +Cc: ecos-discuss

On Fri, Aug 10, 2001 at 05:35:48PM +0100, Hugo Tyson wrote:
> Grant Edwards <grante@visi.com> writes:
> > On Fri, Aug 10, 2001 at 05:50:46PM +0200, Andrew Lunn wrote:
> > > On Fri, Aug 10, 2001 at 09:47:47AM -0600, Trenton D. Adams wrote:
> > 
> > > > Nope, that's not what's locking it up.  I get the error below after
> > > > fiddling with some of the code.  What does it mean?
> > > > 
> > > > ASSERT FAIL: <2>[166]static void Cyg_Scheduler::unlock_inner() Bad next
> > > > thread
> > > 
> > > At a guess, you have a stack overflow which has corrupted something
> > > important in one of your threads. Try making your stacks bigger.
> > 
> > I don't remember seeing the choice, but does eCos have an
> > option to check for stack overflows
> 
> See the option CYGFUN_KERNEL_ALL_THREADS_STACK_CHECKING.

Cool!  

One of the disadvantages of editing ecos.ecc rather than using
a GUI is that it's easy to overlook things like that.

-- 
Grant Edwards
grante@visi.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-08-10  9:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-10  8:39 [ECOS] cyg_current_time () locking up Trenton D. Adams
2001-08-10  8:47 ` Trenton D. Adams
2001-08-10  8:50   ` Andrew Lunn
2001-08-10  8:55     ` Trenton D. Adams
2001-08-10  9:01       ` Andrew Lunn
2001-08-10  9:17     ` Grant Edwards
2001-08-10  9:35       ` Hugo Tyson
2001-08-10  9:51         ` Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).