[ECOS] system ASSERT problem

Tomasz Kutyla tkutyla@marp.pl
Wed Mar 21 16:00:00 GMT 2007


> On Wed, Mar 21, 2007 at 11:32:02AM +0100, Tomasz Kuty??a wrote:
>   
>>>> I got strange problem with my application. When I compile system with 
>>>> global compiler flags
>>>>
>>>> -ml -m4 -O2 -Wall -Wpointer-arith -Wstrict-prototypes -Winline -Wundef 
>>>> -Woverloaded-virtual -ggdb -ffunction-sections -fdata-sections -fno-rtti 
>>>> -fno-exceptions -fvtable-gc -finit-priority -save-temps
>>>>
>>>> I got info on terminal:
>>>>
>>>> ASSERT FAIL: <3>mcard.c[193]int mcard_write_bmask() Valid card handler 
>>>> required
>>>> ASSERT FAIL: mcard.c             [ 193] int 
>>>> mcard_write_bmask()                                                       
>>>> Valid card handler required
>>>>
>>>> But when I remove '-O2' flag the problems doesn't occur. What can be the 
>>>> problem???
>>>>    
>>>>         
>>> There is no mcard.c in the repository, so i guess it is something you
>>> have added. Without the code it is hard to guess what is happening.
>>>       
>> Below is the code that generates the ASSERT:
>>
>> int mcard_write_bmask(mcard_t *card)
>> {
>>   CYG_CHECK_DATA_PTR(card, "valid card pointer required");
>>   CYG_CHECK_DATA_PTR(card->bmask, "valid mask pointer required");
>>   CYG_ASSERT(card->mcard_hdl,"Valid card handler required");
>>
>>   if( !card->mcard_hdl ) return -EINVAL;
>>   if( !card->bmask ) return -EINVAL;
>>     
>
> Well the asserts are wrong anyway. The code correctly handle the cases
> which the asserts are testing for, so the asserts are not needed. 
>
> As to why this happens now, are you really sure the asserts were
> enabled in your old configuration without -O2? Is it really
> reproducible? 
>   
I use Cofig Tool for windows. And only thing I did was to delete -O2 
flag from global compiler flags. I didn't change any ASSERTS flags.
Besides I can see that all actions on card were done without any error.
> If it is reproducible the way forward is to see the assembly language
> the compiler produces for both the working and none working case.
>   
Where can I find assembly language after compilation?

Tomasz

-- 
Tomasz Kutyla, Design Engineer
MARP Electronic Sp. z o.o., ul. Pachonskiego 9, 31-223 Krakow
tel. +48 12 415-87-29 (ext. 35), mob.: +48 693 112 191
fax +48 12 415-86-80

e-mail: tkutyla@marp.pl; http://www.marp.pl


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list