Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: "Ram Viswanadha" <ram@jtcsv.com>
To: <axp-list@redhat.com>
Subject: Re: unaligned traps question
Date: Thu, 17 Oct 2002 15:17:04 -0700	[thread overview]
Message-ID: <01d001c2762a$ecdbffa0$35de2b09@Viswanadha> (raw)
In-Reply-To: 02101511334803.01593@shadowfax.middleearth

Hi Everyone,
Thank you all for you answers and help.

George, thank you for your code, I actually used the code by Sean Hunter
available at http://linux.iol.unh.edu/linux/alpha/faq/iol_faq.html#9

There was only one instance in our tests that caused unaligned trap. The
runtime code, binary data generated did not produce any unaligned traps.
What we had was:

static uint8_t storage[100000]

testUTrie(){
    utrie_serialize(...,storage,sizeof(storage),..)
}
............ source was passed to a library function that cast the uint8_t
to internal structure ...
struct UTrieHeader {
    uint32_t signature;
    uint32_t options;
    int32_t indexLength;
    int32_t dataLength;
};
utrie_serialize(...., uint8_t* data,int32_t  capacity,....)
UTrieHeader* header = (UTrieHeader*) data;
header->signature =0x54726965; /**  this line caused unaligned trap **/
}

so the fix was to change storage to
struct{
    double bogus; /* needed for aligining the storage */
    uint8_t storage[10000000];
} storageHolder;

The expectation of the API is that input param "data" is aligned.

Some of our tools still cause unaligned traps but that is build time issue
and we decided we can live with the performance degradation.

Regards,

Ram
---------------------------------------------------
Ram Viswanadha
International Components For Unicode
GCoC San Jose
IBM
----- Original Message -----
From: "George France" <france@handhelds.org>
To: <axp-list@redhat.com>; "Ram Viswanadha" <ram@jtcsv.com>
Sent: Tuesday, October 15, 2002 8:33 AM
Subject: Re: unaligned traps question


> Hello Ram,
>
> Attached is a program that will help you find the alignment
> problems in ICU.
>
> Best Regards,
>
>
> --George
>
>
> On Monday 14 October 2002 20:50, Ram Viswanadha wrote:
> > Hi everyone,
> > ICU (http://oss.software.ibm.com/icu/) libraries when compiled with
stock
> > RH 6.2 kernel and GCC used to produce unaligned traps in some of the
tools.
> > I upgraded to RH 7.2 (stock kernel and GCC) and now I am not seeing any
> > unaligned trap messages.
> > I read Rich Payne's mails in the archives and they suggest that the
> > problems are in users code not in the kernel.
> > So there are two possibilities, since my code has not changed:
> > a) The kernel has become more lenient and is not producing any unaligned
> > trap messages.
> > b) GCC had a bug which produced unaligned data which has hence been
fixed.
> >
> > Which of the above is true, or is there a better explanation to the
above
> > symptom.
> >
> > Thank you very much for your answer.
> >
> > Regards,
> >
> > Ram
> > ---------------------------------------------------
> > Ram Viswanadha
> > International Components For Unicode
> > GCoC San Jose
> > IBM
> >
> >
> >
> > _______________________________________________
> > Axp-list mailing list
> > Axp-list@redhat.com
> > https://listman.redhat.com/mailman/listinfo/axp-list
>




  reply	other threads:[~2002-10-17 22:17 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-15  0:50 unaligned traps question Ram Viswanadha
2002-10-15  1:38 ` Michal Jaegermann
2002-10-15  2:03 ` Uncle George
2002-10-15 15:39   ` George France
2002-10-15 16:46     ` Michal Jaegermann
2002-10-15 18:24       ` alvin
2002-10-15 19:33         ` George France
2002-10-15 19:40         ` Falk Hueffner
     [not found]         ` <3DAC6EF2.BC962839@voicenet.com>
2002-10-16 18:15           ` alvin
2002-10-16 19:18             ` George France
2002-10-16 19:45               ` Falk Hueffner
2002-10-16 20:08                 ` George France
2002-10-17 18:37                   ` Falk Hueffner
2002-10-16 20:23             ` Michal Jaegermann
2002-10-16 21:30               ` alvin
2002-10-17  1:47             ` Uncle George
2002-10-15 18:08     ` Uncle George
2002-10-15 19:29       ` George France
2002-10-15 20:10         ` Uncle George
2002-10-15 20:46           ` George France
2002-10-15 15:33 ` George France
2002-10-17 22:17   ` Ram Viswanadha [this message]
2002-10-18 15:36     ` Michal Jaegermann
2002-10-18 17:17       ` Ram Viswanadha
2002-10-18 18:47         ` Michal Jaegermann
     [not found] <673E0A4C-E1DF-11D6-AC80-000393768D2C@mcgillsociety.org>
2002-10-17 15:50 ` George France
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox