Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
* Unaligned trap
@ 1999-12-01  5:00 Idar Tollefsen
  1999-12-01  5:00 ` Sashka Nochkin
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Idar Tollefsen @ 1999-12-01  5:00 UTC (permalink / raw)


I keep getting messages like this:
[program name (PID)]: unaligned trap at [some address]: [some other address]
What is this? A memory problem? A HDD problem?



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

* Re: Unaligned trap
  1999-12-01  5:00 Unaligned trap Idar Tollefsen
@ 1999-12-01  5:00 ` Sashka Nochkin
  1999-12-01  5:00   ` Idar Tollefsen
  1999-12-01  5:00 ` Pierre Asselin
  1999-12-02  5:00 ` Michal Jaegermann
  2 siblings, 1 reply; 18+ messages in thread
From: Sashka Nochkin @ 1999-12-01  5:00 UTC (permalink / raw)


as i remmebr correctly this is happening when you work with some x86
systems.
it's not a problem, it's just an unaligned trap. it's normal. it should be
fixed soon.

Idar Tollefsen <idar@kdc.no> wrote in article <38453EE6.3553935A@kdc.no>...
> I keep getting messages like this:
> [program name (PID)]: unaligned trap at [some address]: [some other
address]
> What is this? A memory problem? A HDD problem?
> 



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

* Re: Unaligned trap
  1999-12-01  5:00 ` Sashka Nochkin
@ 1999-12-01  5:00   ` Idar Tollefsen
  1999-12-02  5:00     ` Sashka Nochkin
  0 siblings, 1 reply; 18+ messages in thread
From: Idar Tollefsen @ 1999-12-01  5:00 UTC (permalink / raw)


Sashka Nochkin wrote:
 
> as i remmebr correctly this is happening when you work with some x86
> systems. it's not a problem, it's just an unaligned trap. it's normal. 
> it should be fixed soon.

What do you mean "work with some x86 system"? 
This is an Alpha, not an x86.

Besides beeing very annoying, I was afraid it might be potenially
damageing to my system?



- Idar Tollefsen



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

* Re: Unaligned trap
  1999-12-01  5:00 Unaligned trap Idar Tollefsen
  1999-12-01  5:00 ` Sashka Nochkin
@ 1999-12-01  5:00 ` Pierre Asselin
  1999-12-02  5:00   ` Idar Tollefsen
  1999-12-02  5:00 ` Michal Jaegermann
  2 siblings, 1 reply; 18+ messages in thread
From: Pierre Asselin @ 1999-12-01  5:00 UTC (permalink / raw)


Idar Tollefsen <idar@kdc.no> writes:

>I keep getting messages like this:
>[program name (PID)]: unaligned trap at [some address]: [some other address]
>What is this? A memory problem? A HDD problem?

The program tried to load or store a word from/to a memory address that
is not a multiple of the word size.  The hardware trapped, the OS kicked
in and performed the memory access byte by byte on behalf of the program,
logged the event in syslog, and marked the process as runnable again to
resume after the trapped instruction.  It's harmless, it just slows down
the running program.

This is more common on alphas because long integers must be aligned
on 8-byte boundaries.  Programs developed on x86's often assume that
4-byte alignment is enough.

--
--Pierre Asselin, Westminster, Colorado
  lpa@netcom.com



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

* Re: Unaligned trap
  1999-12-01  5:00 Unaligned trap Idar Tollefsen
  1999-12-01  5:00 ` Sashka Nochkin
  1999-12-01  5:00 ` Pierre Asselin
@ 1999-12-02  5:00 ` Michal Jaegermann
  1999-12-02  5:00   ` Idar Tollefsen
  2 siblings, 1 reply; 18+ messages in thread
From: Michal Jaegermann @ 1999-12-02  5:00 UTC (permalink / raw)


Idar Tollefsen (idar@kdc.no) wrote:
: I keep getting messages like this:
: [program name (PID)]: unaligned trap at [some address]: [some other address]
: What is this? A memory problem? A HDD problem?

No.  It is FAQ.  http://www.alphalinux.org/faq/FAQ-1.html#ss1.2

  --mj



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

* Re: Unaligned trap
  1999-12-01  5:00 ` Pierre Asselin
@ 1999-12-02  5:00   ` Idar Tollefsen
  1999-12-02  5:00     ` Alex Rhomberg
  0 siblings, 1 reply; 18+ messages in thread
From: Idar Tollefsen @ 1999-12-02  5:00 UTC (permalink / raw)


Pierre Asselin wrote:

> The program tried to load or store a word from/to a memory address that
> is not a multiple of the word size.  The hardware trapped, the OS kicked
> in and performed the memory access byte by byte on behalf of the program,
> logged the event in syslog, and marked the process as runnable again to
> resume after the trapped instruction.  It's harmless, it just slows down
> the running program.
 
> This is more common on alphas because long integers must be aligned
> on 8-byte boundaries.  Programs developed on x86's often assume that
> 4-byte alignment is enough.

Thank you. This cleared things up. And it's good to know it's not damaging
to the system.

A logical follow up question: Can anything be done about this?



- Idar Tollefsen



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

* Re: Unaligned trap
  1999-12-01  5:00   ` Idar Tollefsen
@ 1999-12-02  5:00     ` Sashka Nochkin
  0 siblings, 0 replies; 18+ messages in thread
From: Sashka Nochkin @ 1999-12-02  5:00 UTC (permalink / raw)


"Idar Tollefsen" <idar@kdc.no> wrote in message
news:38457166.F45D2537@kdc.no...
> Sashka Nochkin wrote:
>
> > as i remmebr correctly this is happening when you work with some x86
> > systems. it's not a problem, it's just an unaligned trap. it's normal.
> > it should be fixed soon.
>
> What do you mean "work with some x86 system"?
> This is an Alpha, not an x86.
i meant when you work with x86 systems. for example, i was getting this
warning when i was trying to ftp from my Alpha to x86 system

> Besides beeing very annoying, I was afraid it might be potenially
> damageing to my system?
no, no damage for hardware and no damage for software. it's only a warning
which
has been handled somehow.






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

* Re: Unaligned trap
  1999-12-02  5:00   ` Idar Tollefsen
@ 1999-12-02  5:00     ` Alex Rhomberg
  1999-12-02  5:00       ` Idar Tollefsen
  0 siblings, 1 reply; 18+ messages in thread
From: Alex Rhomberg @ 1999-12-02  5:00 UTC (permalink / raw)


Idar Tollefsen wrote:
> 
> Pierre Asselin wrote:
> 
> > The program tried to load or store a word from/to a memory address that
> > is not a multiple of the word size.  The hardware trapped, the OS kicked
> > in and performed the memory access byte by byte on behalf of the program,
> > logged the event in syslog, and marked the process as runnable again to
> > resume after the trapped instruction.  It's harmless, it just slows down
> > the running program.
> 
> > This is more common on alphas because long integers must be aligned
> > on 8-byte boundaries.  Programs developed on x86's often assume that
> > 4-byte alignment is enough.
> 
> Thank you. This cleared things up. And it's good to know it's not damaging
> to the system.
> 
> A logical follow up question: Can anything be done about this?

Additional clarification:
Many of the unaligned traps appeared when time_t switched from int to
long with (internally with kernel 2.1, the API switched with glibc 2.1)

The funniest was when ping stopped working...

What you can do is: patch the software. Go into a debugger and look at
the address given in the console message. Check for bad memory accesses.
The easy way to change it is to memcpy the information from an unaligned
location to an aligned one.

- Alex



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

* Re: Unaligned trap
  1999-12-02  5:00     ` Alex Rhomberg
@ 1999-12-02  5:00       ` Idar Tollefsen
  1999-12-03  5:00         ` Alex Rhomberg
  0 siblings, 1 reply; 18+ messages in thread
From: Idar Tollefsen @ 1999-12-02  5:00 UTC (permalink / raw)


Alex Rhomberg wrote:
 
> Additional clarification:
> Many of the unaligned traps appeared when time_t switched from int to
> long with (internally with kernel 2.1, the API switched with glibc 2.1)

Yes, this makes sence to me. I first started seeing this problem back
when I was still on RedHat 4.2. I used the 2.0.30 and 2.0.35 kernels,
but needed to start using the 2.1.x kernels for some reason I have 
long since forgotten. The problem only got worse when I upgraded to 
RH 5.2, and if memory serves, RH 5.2 shipped with glibc 2.x.

> The funniest was when ping stopped working...

Annyoing, wasn't it? Glad that's fixed at least :)

Thanks, you've been a real help here.



- Idar Tollefsen



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

* Re: Unaligned trap
  1999-12-02  5:00 ` Michal Jaegermann
@ 1999-12-02  5:00   ` Idar Tollefsen
  0 siblings, 0 replies; 18+ messages in thread
From: Idar Tollefsen @ 1999-12-02  5:00 UTC (permalink / raw)


Michal Jaegermann wrote:

>> I keep getting messages like this:
>> [program name (PID)]: unaligned trap at [some address]: [some other address]
>> What is this? A memory problem? A HDD problem?
 
> No.  It is FAQ.  http://www.alphalinux.org/faq/FAQ-1.html#ss1.2

Sorry. I thought I had search trough it, but obviously not good enough.
Thanks for setinng me straight.



- Idar Tollefsen



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

* Re: Unaligned trap
  1999-12-02  5:00       ` Idar Tollefsen
@ 1999-12-03  5:00         ` Alex Rhomberg
  0 siblings, 0 replies; 18+ messages in thread
From: Alex Rhomberg @ 1999-12-03  5:00 UTC (permalink / raw)


Idar Tollefsen wrote:
> 
> Alex Rhomberg wrote:
> 
> > Additional clarification:
> > Many of the unaligned traps appeared when time_t switched from int to
> > long with (internally with kernel 2.1, the API switched with glibc 2.1)
> 
> Yes, this makes sence to me. I first started seeing this problem back
> when I was still on RedHat 4.2. I used the 2.0.30 and 2.0.35 kernels,
> but needed to start using the 2.1.x kernels for some reason I have
> long since forgotten. The problem only got worse when I upgraded to
> RH 5.2, and if memory serves, RH 5.2 shipped with glibc 2.x.

If memory serves correctly, time_t got bigger somewhere in the 2.1.x
kernels, but was still 2x32 in glibc 2.0 shipped with RH5.2

The main problem after switching to 2.2 was when gdb refused to load
core dumps. Three days poking around in mailing list archives and gdb
sources and a three line hack fixed that :-)

Redhat 6.0 had glibc 2.1 which introduces some 'issues'

> > The funniest was when ping stopped working...
> 
> Annyoing, wasn't it? Glad that's fixed at least :)

Yes, the pleas for help: My network doesn't network! ping reports
errors!

- Alex



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

* unaligned trap
@ 2001-01-28 18:55 klimadmin
  2001-01-28 21:25 ` Hartmann Schaffer
  2001-01-29 16:56 ` michal
  0 siblings, 2 replies; 18+ messages in thread
From: klimadmin @ 2001-01-28 18:55 UTC (permalink / raw)


Hi!

I have a problem with SuSe linux, that I cannot solve myself and SuSe
Support group seems to be overloaded.

The problem is that a number of applications is giving me an
'unaligned trap' error and I have no idea, what is the problem.
Although giving 'unaligned trap' message in a log, applications
seems to work pretty well. We are using now SuSe 7.0 AXP. Before
there ws an identical problem with SuSe 6.4 and pretty much the same
applictions:

kdm
kcontrol
kpanel
... (most of KDE1 applications traps)
+
groff
mksuseconf (or smth like this)

I can surely post lines from the log if it
will help.

Alex


Sent via Deja.com
http://www.deja.com/


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

* Re: unaligned trap
  2001-01-28 18:55 unaligned trap klimadmin
@ 2001-01-28 21:25 ` Hartmann Schaffer
  2001-01-28 23:56   ` klimadmin
  2001-01-29 17:05   ` michal
  2001-01-29 16:56 ` michal
  1 sibling, 2 replies; 18+ messages in thread
From: Hartmann Schaffer @ 2001-01-28 21:25 UTC (permalink / raw)


you probably have a first generation alpha (21064?):  they have only full
word load and store instructions.  halfword and byte instructions were added
with later generations.  if the application is compiled for one of the late
cpu generations, they will issue traps that call a system routine which
emulates the offending instructions, but also reports the trap.  if you
recompile those applications with the correct cpu setting the messages will
go away

hs

In article <951puk$4go$1@nnrp1.deja.com>, klimadmin@altavista.com wrote:
>Hi!
>
>I have a problem with SuSe linux, that I cannot solve myself and SuSe
>Support group seems to be overloaded.
>
>The problem is that a number of applications is giving me an
>'unaligned trap' error and I have no idea, what is the problem.
>Although giving 'unaligned trap' message in a log, applications
>seems to work pretty well. We are using now SuSe 7.0 AXP. Before
>there ws an identical problem with SuSe 6.4 and pretty much the same
>applictions:
>
>kdm
>kcontrol
>kpanel
>... (most of KDE1 applications traps)
>+
>groff
>mksuseconf (or smth like this)
>
>I can surely post lines from the log if it
>will help.
>
>Alex
>
>
>Sent via Deja.com
>http://www.deja.com/


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

* Re: unaligned trap
  2001-01-28 21:25 ` Hartmann Schaffer
@ 2001-01-28 23:56   ` klimadmin
  2001-01-29  2:13     ` JJ
  2001-01-29 17:05   ` michal
  1 sibling, 1 reply; 18+ messages in thread
From: klimadmin @ 2001-01-28 23:56 UTC (permalink / raw)


We have two machines: DP264 and AS500.
I believe the first one, that is dual-CPU and
was purchase about a year ago does already possess
212... (i might not be right) processor.

Do you think it is worth trying to recompile
applcations from the source?

If so, what compiler is better to use?
Native Compaq or GNU?

ak

In article <slrn978v1p.hf5.hs@paradise.nirvananet>,
  hs@paradise.nirvananet (Hartmann Schaffer) wrote:
> you probably have a first generation alpha (21064?):  they have only
full
> word load and store instructions.  halfword and byte instructions
were added
> with later generations.  if the application is compiled for one of
the late
> cpu generations, they will issue traps that call a system routine
which
> emulates the offending instructions, but also reports the trap.  if
you
> recompile those applications with the correct cpu setting the
messages will
> go away
>
> hs
>


Sent via Deja.com
http://www.deja.com/


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

* Re: unaligned trap
  2001-01-28 23:56   ` klimadmin
@ 2001-01-29  2:13     ` JJ
  0 siblings, 0 replies; 18+ messages in thread
From: JJ @ 2001-01-29  2:13 UTC (permalink / raw)


Recompile may not fix it...

Alpha is a RISC machine and expects all the data it processes to be on word
boundary's.

When Data is accessed which is not on a word boundary, (a piece of byte data
in a structure), it performs a trap, and processes the data using firmware
emulation of byte instructions, to let the programmer know what is going on,
a informational/warning  message is printed to the console device "unaligned
trap".  This is not an error, but simply letting you know the program is
wasting time executing emulated byte instructions, and yes, newer CPU's have
the byte instructions but they still waste time and the messages are still
generated.

If you do a search on the redhat axp-list  mailing list, the procedure for
identifying the piece of code causing the trap is explained in some of the
message threads.

JJ

<klimadmin@altavista.com> wrote in message
news:952bjo$iri$1@nnrp1.deja.com...
> We have two machines: DP264 and AS500.
> I believe the first one, that is dual-CPU and
> was purchase about a year ago does already possess
> 212... (i might not be right) processor.
>
> Do you think it is worth trying to recompile
> applcations from the source?
>
> If so, what compiler is better to use?
> Native Compaq or GNU?
>
> ak
>
> In article <slrn978v1p.hf5.hs@paradise.nirvananet>,
>   hs@paradise.nirvananet (Hartmann Schaffer) wrote:
> > you probably have a first generation alpha (21064?):  they have only
> full
> > word load and store instructions.  halfword and byte instructions
> were added
> > with later generations.  if the application is compiled for one of
> the late
> > cpu generations, they will issue traps that call a system routine
> which
> > emulates the offending instructions, but also reports the trap.  if
> you
> > recompile those applications with the correct cpu setting the
> messages will
> > go away
> >
> > hs
> >
>
>
> Sent via Deja.com
> http://www.deja.com/




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

* Re: unaligned trap
  2001-01-28 18:55 unaligned trap klimadmin
  2001-01-28 21:25 ` Hartmann Schaffer
@ 2001-01-29 16:56 ` michal
  1 sibling, 0 replies; 18+ messages in thread
From: michal @ 2001-01-29 16:56 UTC (permalink / raw)


klimadmin@altavista.com wrote:

> The problem is that a number of applications is giving me an
> 'unaligned trap' error and I have no idea, what is the problem.

See FAQ on http://www.alphalinux.org


> Although giving 'unaligned trap' message in a log, applications
> seems to work pretty well.

'Unaligned traps' are signs of a faulty programming loose with types.
It happens from time to time that they are indicators of other bugs but
one cannot be sure of that without careful analysis on a case by case
basis.  Although Linux kernel traps them and "fixes" each of those
traps, even if just a real "unaligned", is a performance hit.  Double
brownie points if you can fish them out and fix in C++ code.

If you are annoyed and do not care about performance and fixing you can
recompile your kernel and turn that particular 'printk' off.  It is
trivial application of 'grep'. :-)  The main reason for this printk was
to induce people to fix bugs - becase all these points are real bugs;
maybe not of a killer sort but still bugs.  BTW - they have a negative
performance impact on x86 processors as well but costs, due to a
different architecture, are considerably smaller.

> kdm
> kcontrol
> kpanel
> ... (most of KDE1 applications traps)

Figures.  Every time I tried to look inside of various KDE sources
I thought that I will puke.

  Michal


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

* Re: unaligned trap
  2001-01-28 21:25 ` Hartmann Schaffer
  2001-01-28 23:56   ` klimadmin
@ 2001-01-29 17:05   ` michal
  2001-01-30 12:49     ` Paul Repacholi
  1 sibling, 1 reply; 18+ messages in thread
From: michal @ 2001-01-29 17:05 UTC (permalink / raw)


Hartmann Schaffer <hs@paradise.nirvananet> wrote:
> you probably have a first generation alpha (21064?):  they have only
> full word load and store instructions.  halfword and byte instructions
> were added with later generations.

Nope.  A presence of new instructions in processors of a later
generation, which allow for a "native" access to smaller chunks of
memory, makes for more compact and faster machine code to get to these
(no need for stack games) but does not really loosen up alignment
requirements.  Fetching 'int' from an unaligned memory address will earn
you the same "unaligned trap" like before.  Maybe fixup routine can be
made faster.

  Michal


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

* Re: unaligned trap
  2001-01-29 17:05   ` michal
@ 2001-01-30 12:49     ` Paul Repacholi
  0 siblings, 0 replies; 18+ messages in thread
From: Paul Repacholi @ 2001-01-30 12:49 UTC (permalink / raw)


michal@gortel.phys.ualberta.ca writes:

> Hartmann Schaffer <hs@paradise.nirvananet> wrote:
> > you probably have a first generation alpha (21064?):  they have only
> > full word load and store instructions.  halfword and byte instructions
> > were added with later generations.
> 
> Nope.  A presence of new instructions in processors of a later
> generation, which allow for a "native" access to smaller chunks of
> memory, makes for more compact and faster machine code to get to these
> (no need for stack games) but does not really loosen up alignment
> requirements.  Fetching 'int' from an unaligned memory address will earn
> you the same "unaligned trap" like before.  Maybe fixup routine can be
> made faster.

No ,the load unaligned and friend cost speed. See the design papers.
They should only be used for bus access if possible.

-- 
Paul Repacholi                               1 Crescent Rd.,
+61 (08) 9257-1001                           Kalamunda.
                                             West Australia 6076
Raw, Cooked or Well-done, it's all half baked.


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

end of thread, other threads:[~2001-01-30 12:49 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-28 18:55 unaligned trap klimadmin
2001-01-28 21:25 ` Hartmann Schaffer
2001-01-28 23:56   ` klimadmin
2001-01-29  2:13     ` JJ
2001-01-29 17:05   ` michal
2001-01-30 12:49     ` Paul Repacholi
2001-01-29 16:56 ` michal
  -- strict thread matches above, loose matches on Subject: below --
1999-12-01  5:00 Unaligned trap Idar Tollefsen
1999-12-01  5:00 ` Sashka Nochkin
1999-12-01  5:00   ` Idar Tollefsen
1999-12-02  5:00     ` Sashka Nochkin
1999-12-01  5:00 ` Pierre Asselin
1999-12-02  5:00   ` Idar Tollefsen
1999-12-02  5:00     ` Alex Rhomberg
1999-12-02  5:00       ` Idar Tollefsen
1999-12-03  5:00         ` Alex Rhomberg
1999-12-02  5:00 ` Michal Jaegermann
1999-12-02  5:00   ` Idar Tollefsen

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