Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Re: Unaligned traps et al
@ 1999-08-18 21:50 Jano Lukac
  1999-08-18 22:10 ` Sean Hunter
  0 siblings, 1 reply; 9+ messages in thread
From: Jano Lukac @ 1999-08-18 21:50 UTC (permalink / raw)
  To: axp-list

Hi,

The programming stuff is way beyond me, so please don't berate for my
ignorance.  

--- Sean Hunter <sean@uncarved.co.uk> wrote:
<snip>
> 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.

So this means for the "regular" user (assuming an alpha linux system) that any
time there was this unaligned trap, the program would core dump?  Therefore a
non-programmer-type person (like me) would be unable to continue using many
programs intended for x86 which were compiled on his/her alpha because of this.
 That seems a little counter-productive to me, but might in fact spur some
programmer-types to finally fix other programs ;)

Good day,

Jano
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: Unaligned traps et al
@ 1999-08-19  9:52 Christian Groessler
  1999-08-19 10:12 ` Sean Hunter
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Groessler @ 1999-08-19  9:52 UTC (permalink / raw)
  To: axp-list; +Cc: Sean Hunter




Hi,


On 8/18/99 10:23:49 PM Sean Hunter wrote:
>
>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.

The following program creates a subshell and all programs
started from therein will SIGBUS on unaligned accesses.

----------------------
/* 28-May-98, chris */


#ifndef __linux__
#include <sys/sysinfo.h>
#else
#include <asm/sysinfo.h>
#include <asm/unistd.h>

static int setsysinfo(unsigned long op, void *buffer, unsigned long size,
                      int *start, void *arg, unsigned long flag)
{
  syscall(__NR_osf_setsysinfo, op, buffer, size, start, arg, flag);
}
#endif

void trap_unaligned(void)
{
  unsigned int buf[2];
  buf[0] = SSIN_UACPROC;
  buf[1] = UAC_SIGBUS | UAC_NOPRINT;
  setsysinfo(SSI_NVPAIRS, buf, 1, 0, 0, 0);
}

int main(int ac)
{
  trap_unaligned();
  printf("creating subshell with SIGBUS setting!\n");
  execl("/bin/bash","/bin/bash",(char *)0);
  return(0); /* not reached */
}
----------------------

regards,
chris



^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: Unaligned traps et al
@ 1999-08-18 16:38 Paul Jakma
  0 siblings, 0 replies; 9+ messages in thread
From: Paul Jakma @ 1999-08-18 16:38 UTC (permalink / raw)
  To: 'axp-list@redhat.com'

> 5)Is milo still under active development?  I can't get it to build
> against new kernels, which is a pain, because the version I use
> doesn't have the best driver for my scsi card.

the latest milo source are at ftp://genie.ucd.ie/pub/alpha

regards,

paul.


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Unaligned traps et al
@ 1999-08-18 13:47 Sean Hunter
  1999-08-18 16:26 ` Dan Morrill
       [not found] ` <199908181556.JAA28448@ellpspace.math.ualberta.ca>
  0 siblings, 2 replies; 9+ messages in thread
From: Sean Hunter @ 1999-08-18 13:47 UTC (permalink / raw)
  To: axp-list

OK, I've had an Alpha for about six months or so, and I'd like to do a
bit more development on it (instead of my intel boxes).  

I've submitted a few kernel patches (some of which have been accepted
8^) ), but I actually think the user-space tools are in a worse state
than the kernel, and would like to help.  I have a few questions for
the alpha gurus:

1)A lot of programs (eg rh6 ping) cause the occasional "unaligned
trap".  I understand that these are caused by instructions that are
not aligned correctly in memory, and that that means the processor has
to do some special magic to run them, which slows stuff down.  How do
I find and eliminate the error?

2)I can't get xemacs to build.  Any hints?

3)Mozilla seems pretty shaky.  Is there a "healthy" milestone build
that works OK on alpha?  I don't use the mail components, but just
want a browser for the odd times when "lynx" doesn't tell all.

4)Any joy with emm-x86 on the 2.2.x series kernels?

5)Is milo still under active development?  I can't get it to build
against new kernels, which is a pain, because the version I use
doesn't have the best driver for my scsi card.

Thanks for any/all replies.

Sean


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

end of thread, other threads:[~1999-08-19 12:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-08-18 21:50 Unaligned traps et al Jano Lukac
1999-08-18 22:10 ` Sean Hunter
  -- strict thread matches above, loose matches on Subject: below --
1999-08-19  9:52 Christian Groessler
1999-08-19 10:12 ` Sean Hunter
1999-08-18 16:38 Paul Jakma
1999-08-18 13:47 Sean Hunter
1999-08-18 16:26 ` Dan Morrill
     [not found] ` <199908181556.JAA28448@ellpspace.math.ualberta.ca>
1999-08-18 21:23   ` Sean Hunter
1999-08-18 23:11     ` Richard Henderson

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