Re: bzip2 unaligned trap

2005-08-25 Thread Uwe Schindler

Hello Norbert,

At 08:00 25.08.2005, you wrote:

With this kernel I get permanent unaligned trap errors from bzip2:
bzip2(10013): unaligned trap at 020c3074: 00020c5100020c3d 28 1

Does anyone know wether this is a hardware or software problem?


This is a software problem that lies in the ALPHA RISC processor 
architecture. The processor cannot access memory that is not aligned 
at boundaries conforming to the datatype to be read/written. The 
kernel fixes this by doing separate reads/writes that are aligned.

The only drawback with this is that it is a performance problem.
To fix this write a bug report for BZIP or the software that 
generates the problem. But do not exspect that they fix this because 
alpha is not the main platform and most developers do not have such a 
processor.


Greetings,

-
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de - http://www.schindlers-software.de
eMails: [EMAIL PROTECTED] (private); [EMAIL PROTECTED] (company)
Tel./Fax: +49 700 PCLATEIN (+49 700 72528346)

Schindlers Software - Home of Schindlers PC-LATEIN 3.20
DIE Software zum Lateinlernen!  



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: bzip2 unaligned trap

2005-08-25 Thread Steve Langasek
On Thu, Aug 25, 2005 at 09:04:06AM +0200, Uwe Schindler wrote:
> Hello Norbert,

> At 08:00 25.08.2005, you wrote:
> >With this kernel I get permanent unaligned trap errors from bzip2:
> >bzip2(10013): unaligned trap at 020c3074: 00020c5100020c3d 28 1

> >Does anyone know wether this is a hardware or software problem?

> This is a software problem that lies in the ALPHA RISC processor 
> architecture. The processor cannot access memory that is not aligned 
> at boundaries conforming to the datatype to be read/written. The 
> kernel fixes this by doing separate reads/writes that are aligned.
> The only drawback with this is that it is a performance problem.
> To fix this write a bug report for BZIP or the software that 
> generates the problem. But do not exspect that they fix this because 
> alpha is not the main platform and most developers do not have such a 
> processor.

Rather, do not expect this to be fixed unless you can convert the
kernel-level trap into a userspace backtrace that the developers can act on.

Somewhere in the list archive, there are recipes to get a userspace trap for
these...

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
[EMAIL PROTECTED]   http://www.debian.org/


signature.asc
Description: Digital signature


Re: bzip2 unaligned trap

2005-08-25 Thread Falk Hueffner
Steve Langasek <[EMAIL PROTECTED]> writes:

> On Thu, Aug 25, 2005 at 09:04:06AM +0200, Uwe Schindler wrote:
>> At 08:00 25.08.2005, you wrote:
>> >With this kernel I get permanent unaligned trap errors from bzip2:
>> >bzip2(10013): unaligned trap at 020c3074: 00020c5100020c3d 28 1
>
>> >Does anyone know wether this is a hardware or software problem?
>
>> [...] But do not exspect that they fix this because alpha is not
>> the main platform and most developers do not have such a processor.
>
> Rather, do not expect this to be fixed unless you can convert the
> kernel-level trap into a userspace backtrace that the developers can
> act on.

I'd say that's the maintainer's job, not the bug reporter's. So please
report it :-)

-- 
Falk


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: bzip2 unaligned trap

2005-08-25 Thread Helge Kreutzmann
Hello,
On Thu, Aug 25, 2005 at 10:26:21AM +0200, Falk Hueffner wrote:
> Steve Langasek <[EMAIL PROTECTED]> writes:
> > Rather, do not expect this to be fixed unless you can convert the
> > kernel-level trap into a userspace backtrace that the developers can
> > act on.
> 
> I'd say that's the maintainer's job, not the bug reporter's. So please
> report it :-)

Well, if the submitter can produce such a backtrace, chances are much
higher to get it fixed and not simply ignored. 

For reference, I attached the programm I used in the past and which I got
from this (or the Red Hat) list.

Greetings

Helge
-- 
Dr. Helge Kreutzmann, Dipl.-Phys.   [EMAIL PROTECTED]
   gpg signed mail preferred 
64bit GNU powered  http://www.itp.uni-hannover.de/~kreutzm
  Help keep free software "libre": http://www.ffii.de/
#include 
#include 

#ifndef __linux__
#include 
#else
#include 
#include 

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


static void usage(void)
{
fprintf(stderr,
"usage: unaligned   [command-args...]\n\n"
"  This program is designed to assist debugging of\n"
"  unaligned traps by running the program in gdb\n"
"  and causing it to get SIGBUS when it encounters\n"
"  an unaligned trap.\n\n"
"  It is free software written by Sean Hunter <[EMAIL 
PROTECTED]>\n"
"  based on code by Richard Henderson and Andrew Morgan.  It is 
provided\n"
"  under the gnu public license without warrantees of any 
kind.\n\n");

exit(1);
}


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 argc, char **argv)
{
char* tmp_filename;
char* my_debugger = "/usr/bin/gdb";
FILE* tmp_file;
int curr_arg;

/* check that we have at least 1 argument */
if (argc < 2) {
usage();
}

trap_unaligned();

if (argc > 2) {
/* add the extra args to a file to pass to gdb */
tmp_filename = tmpnam(NULL);
tmp_file = fopen(tmp_filename, "w+");
if (!tmp_file) {
fprintf(stderr, "Unable to create temp file %s reason: %s\n", 
tmp_filename,
strerror(errno));
}

fprintf(tmp_file, "file %s\n", argv[1]);
fprintf(tmp_file, "set args");
for(curr_arg = 2; curr_arg < argc; curr_arg++) {
fprintf(tmp_file, " %s", argv[curr_arg]);
}
fprintf(tmp_file, "\n");
#ifndef NOAUTORUN
fprintf(tmp_file, "run\n");
#endif
fclose(tmp_file);

printf("Extra arguments passed to gdb in file %s.\n"
   "Be sure to delete it when you're done.\n\n",
   tmp_filename);

execlp(my_debugger, argv[1], "-x", tmp_filename, NULL);

}
else {
execlp(my_debugger, argv[1], NULL);
}   

/* if we fall through to here, our exec failed -- announce the fact */
fprintf(stderr, "Unable to execute command: %s\n", strerror(errno));

usage();

}

/* use gcc unaligned.c -o unaliged to compile.  Add -DNOAUTORUN if you
don't want gdb to automatically run the program */


pgpAF1yb7hM1N.pgp
Description: PGP signature