This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: need debugging help
- From: "harmon" <lharmon at neo dot rr dot com>
- To: "'Andrew Lunn'" <andrew at lunn dot ch>
- Cc: <ecos-discuss at sources dot redhat dot com>
- Date: Thu, 5 Aug 2004 13:20:11 -0400
- Subject: RE: [ECOS] need debugging help
Thanks again!
I did as you suggested, breaking at the assert. A thread's callback
function, called at DSR level, called printf which eventually tried to
lock a mutex. I removed the printf and now all appears to work well!!
:)
Larry
-----Original Message-----
From: ecos-discuss-owner@ecos.sourceware.org
[mailto:ecos-discuss-owner@ecos.sourceware.org] On Behalf Of Andrew Lunn
Sent: Thursday, August 05, 2004 12:22 PM
To: harmon
Cc: 'Andrew Lunn'; ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] need debugging help
On Thu, Aug 05, 2004 at 11:29:23AM -0400, harmon wrote:
> Thanks for the advice. I figured out how to enable asserts, enabled
> them, ran my application and asserted where I was having a problem:
>
> The message is:
> ASSERT FAIL: <6>mutex.cxx[249]cyg_bool Cyg_Mutex::lock() Locking mutex
I
> already own
> ASSERT FAIL: <6>mutex.cxx [249] cyg_bool Cyg_Mutex::lock()
>
>
> This problem occurs where I call
> cyg_flag_setbits(&UsbRspStateFlag,
> (1<<USB_STATE_IN_MESSAGE_DONE));
> from a DSR.
>
> I believe this might be a point where my DSR calls cyg_flag_setbits
> twice, once for each thread, and the second call results in problems.
No, that does not sound right. cyg_flash_setbits should not be doing
anything with mutex's. Also, you should not be using mutex's inside a
DSR. I think the mutex problem is being triggered from some other
location. You should be able to put a breakpoint in cyg_assert_failed
and then get a backtrace from gdb.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss