Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: "Sean Hunter" <sean@uncarved.co.uk>
To: Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
Cc: axp-list@redhat.com
Subject: Re: Unaligned traps et al
Date: Wed, 18 Aug 1999 22:23:49 +0100	[thread overview]
Message-ID: <19990818222349.W28508@henry.uncarved.co.uk> (raw)
In-Reply-To: <199908181556.JAA28448@ellpspace.math.ualberta.ca>; from Michal Jaegermann on Wed, Aug 18, 1999 at 09:56:48AM -0600

Thanks for your rousing call to "go buy a clue".  Results follow.

On Wed, Aug 18, 1999 at 09:56:48AM -0600, Michal Jaegermann wrote:
> > 
> > 1)A lot of programs (eg rh6 ping)

[stuff incl useful snippet of code re unaligned snipped]

I had a feeling that this was a FAQ, but searching the FAQ didn't
uncover it.  Perhaps I should submit this to the FAQ...

Anyway, you've got me thing about a possibly useful kernel patch.  I'm
going to send this to the list first to get people's opinions.  I'm
going to have a go at writing this iover the next couple of weeks if
people think it would be a good idea.  (I have done a few similar
things in the past).

For those who don't know, its possible (as Michal told me, and rth's
code snippet demonstrated) to exercise a small degree of control over
what the kernel does when an app encounters an unaligned access.  In
particular, you can turn off the message, tell the kernel not to fix
the access (this sounds like a bad idea), or (more usefully) get the
kernel to send the app a SIGBUS, causing it to dump core.  You can
then plug the coredump into your favourite debugger and fix the
access.

The trouble is, you need to use setsysinfo to get your program to do
this, which is fine for stuff you're writing, but a pain for other
programs.  What I propose is to set up a sysctl so that it will
automatically set this behaviour as desired.  This means that normally 
you just leave this as is, bit if you feel like doing a spot o'
debugging you can echo "some_magic" >> /proc/sys/kernel/uac_control,
and all newly-started process will automatically have the correct
behaviour set in the tss, and will SIGBUS and coredump on encountering 
the unaligned trap.  Similarly, if you attempting to show a prototype
port to your boss, and don't what to be embarrassed by the unaligned
traps you haven't fixed yet, you echo some magic to the same place to
turn the messages off.

Thoughts?

Sean


  parent reply	other threads:[~1999-08-18 21:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-18 13:47 Unaligned traps et al Sean Hunter
1999-08-18 15:29 ` gnome install under RH5.2 on AS200 Peter Howell Jr
1999-08-18 22:23   ` Sean Hunter
1999-08-25 17:45   ` Adam C. Powell, IV
1999-08-18 16:26 ` Unaligned traps et al Dan Morrill
     [not found] ` <199908181556.JAA28448@ellpspace.math.ualberta.ca>
1999-08-18 21:23   ` Sean Hunter [this message]
1999-08-18 23:11     ` Richard Henderson
  -- strict thread matches above, loose matches on Subject: below --
1999-08-18 16:38 Paul Jakma
1999-08-18 21:50 Jano Lukac
1999-08-18 22:10 ` Sean Hunter
1999-08-19  9:52 Christian Groessler
1999-08-19 10:12 ` Sean Hunter
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