Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Debugging unaligned traps
@ 1998-07-11  7:57 B. James Phillippe
  1998-07-11 11:12 ` Matti Aarnio
  1998-07-11 11:39 ` Maciej W. Rozycki
  0 siblings, 2 replies; 12+ messages in thread
From: B. James Phillippe @ 1998-07-11  7:57 UTC (permalink / raw)
  To: RedHat AXP list

Hello,

	I'd like to learn more about finding and fixing unaligned traps on
Linux/Alpha.  I'm an accomplished C programmer, but frankly have very
little know-how on AXP.  I understand the concepts and principles behind
what an unaligned access is, and I can recognize it in the code if I know
where to look.  My main hurdle now is knowing where to look.  I understand
that the two addresses printed in the printk are 1.) the address improperly
accessed, and 2.) the address of the accessor.  What do the other values
represent, and how could I use gdb to find the offending line(s) of code?
I've done some net searches, but turned up very little.

thanks,
-bp
--
B. James Phillippe <bryan@terran.org>
Linux Software Engineer, WGT Inc.
http://earth.terran.org/~bryan



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

* Re: Debugging unaligned traps
  1998-07-11  7:57 Debugging unaligned traps B. James Phillippe
@ 1998-07-11 11:12 ` Matti Aarnio
  1998-07-12  9:17   ` Quant-X Alpha Linux Support
  1998-07-11 11:39 ` Maciej W. Rozycki
  1 sibling, 1 reply; 12+ messages in thread
From: Matti Aarnio @ 1998-07-11 11:12 UTC (permalink / raw)
  To: bryan; +Cc: axp-list

> Hello,
> 
> 	I'd like to learn more about finding and fixing unaligned traps on
> Linux/Alpha.  I'm an accomplished C programmer, but frankly have very
> little know-how on AXP.  I understand the concepts and principles behind
> what an unaligned access is, and I can recognize it in the code if I know
> where to look.  My main hurdle now is knowing where to look.  I understand
> that the two addresses printed in the printk are 1.) the address improperly
> accessed, and 2.) the address of the accessor.  What do the other values
> represent, and how could I use gdb to find the offending line(s) of code?
> I've done some net searches, but turned up very little.

Looking into the kernel sources would have told you something too..

Lets have an example:

X(31263): unaligned trap at 000000012004e50c: 000000012076ddb2 28 1

This means that program called X (pid 31263) has done unaligned
access with Alpha instruction 0x28 (LDL -- 32-bit load) on PC address
0x12004e50c while loading from  0x12076ddb2 into integer register 1.

> thanks,
> -bp
> --
> B. James Phillippe <bryan@terran.org>

/Matti Aarnio <matti.aarnio@sonera.fi>


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

* Re: Debugging unaligned traps
  1998-07-11  7:57 Debugging unaligned traps B. James Phillippe
  1998-07-11 11:12 ` Matti Aarnio
@ 1998-07-11 11:39 ` Maciej W. Rozycki
  1 sibling, 0 replies; 12+ messages in thread
From: Maciej W. Rozycki @ 1998-07-11 11:39 UTC (permalink / raw)
  To: RedHat AXP list

On Sat, 11 Jul 1998, B. James Phillippe wrote:

> accessed, and 2.) the address of the accessor.  What do the other values
> represent, and how could I use gdb to find the offending line(s) of code?
> I've done some net searches, but turned up very little.

 Just enter the printed address of the opcode as the address of a
breakpoint.  You must have debugging symbols compiled in, to get line
numbers information.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


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

* Re: Debugging unaligned traps
  1998-07-11 11:12 ` Matti Aarnio
@ 1998-07-12  9:17   ` Quant-X Alpha Linux Support
  0 siblings, 0 replies; 12+ messages in thread
From: Quant-X Alpha Linux Support @ 1998-07-12  9:17 UTC (permalink / raw)
  To: axp-list

Hi Matti !

> Lets have an example:
> 
> X(31263): unaligned trap at 000000012004e50c: 000000012076ddb2 28 1
> 
> This means that program called X (pid 31263) has done unaligned
> access with Alpha instruction 0x28 (LDL -- 32-bit load) on PC address
> 0x12004e50c while loading from  0x12076ddb2 into integer register 1.

Yes, but let me add a source example:

/*
 * uac.S
 */
	.text
	.globl	__start
	.ent	__start
	.align 3

__start:
	ldgp	$29, 0($27)
	lda	$0, uac		/* load unaligned address */

	.align 4		/* make PC 0xXXXXXXXXXXXXXXX0 */
	ldq     $1, 0($0)	/* unaligned access 64 Bit */
	.align 4
	ldl     $2, 0($0)	/* unaligned access 32 Bit */
	
	lda	$16,     0x0    /* rc */
	lda	$0,	0x1	/* sys_exit */
	call_pal 131		/* syscall */

	.align 4
	.align 0
ac:	.byte 0
uac:	.quad 0x0123456789abcdef     /* at 0xXXXXXXXXXXXXXXX1 */
			
	.end __start
	
/*
 * Local variables:
 *  compile-command: "gcc -g -nostartfiles -o uac uac.S" 
 * End:
 */

-- 

Quant-X Service &                         Ph:  (+43) 4212 6004-0
Consulting Ges.m.b.H.                     Fax: (+43) 4212 600420
http://www.quant-x.com                    Email: support@quant-x.com


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

* debugging unaligned traps
  1998-07-12 17:43 BT-958 = IRQ 24??? Jay.Estabrook
@ 1998-07-13  3:26 ` Tom Holroyd
  1998-07-13  4:26   ` Quant-X Alpha Linux Support
  1998-07-13 10:24   ` Tom Holroyd
  0 siblings, 2 replies; 12+ messages in thread
From: Tom Holroyd @ 1998-07-13  3:26 UTC (permalink / raw)
  To: axp-list

The addresses reported by the kernel seem to be different from what I see
with gdb.  E.g., the program uac.c:

main()
{
        int i, j;
        char *b, buf[10];

        for (i = 0; i < 4; i++) {
                b = &buf[i];
                printf("b = 0x%016lX\n", b);
                j = *((int *)b);
        }
}

produces output

b = 0x000000011FFFFBD8
b = 0x000000011FFFFBD9
b = 0x000000011FFFFBDA
b = 0x000000011FFFFBDB

and kernel messages
unaligned trap at 000000000000001e: 000000011ffffbd9 22 1
unaligned trap at 000000000000001e: 000000011ffffbda 22 1
unaligned trap at 000000000000001e: 000000011ffffbdb 22 1

but gdb reports that main looks like this (gcc -g uac.c -o uac):

0x120000700 <main>:             27bb0011  ldah       gp,17(t12)
0x120000704 <main+4>:           23bd8180  lda        gp,-32384(gp)
0x120000708 <main+8>:           23deffd0  lda        sp,-48(sp)
0x12000070c <main+12>:          b75e0000  stq        ra,0(sp)
0x120000710 <main+16>:          b5fe0008  stq        fp,8(sp)
0x120000714 <main+20>:          47de040f  mov        sp,fp
...
0x120000784 <main+132>:         6bfa8001  ret        zero,(ra),0x1

That is, the data addresses are correct, but where is that 0x1e coming
from?

P.S.  My X server says:
X(4158): unaligned trap at 0000000000000024: 00000001205ad80f 28 2

The PC of 0x24 is clearly junk in this case.

Dr. Tom Holroyd
Behavior Control Lab, Human Informatics Dept.            The basis of
National Institute of Bioscience and Human-Technology    stability is
1-1 Higashi, Tsukuba-shi, Ibaraki 305, Japan             instability.
The 9th Amendment of the U.S. Constitution:
"The enumeration in the Constitution, of certain rights, shall not be
construed to deny or disparage others retained by the people."


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

* Re: debugging unaligned traps
  1998-07-13  3:26 ` debugging unaligned traps Tom Holroyd
@ 1998-07-13  4:26   ` Quant-X Alpha Linux Support
  1998-07-13 10:24   ` Tom Holroyd
  1 sibling, 0 replies; 12+ messages in thread
From: Quant-X Alpha Linux Support @ 1998-07-13  4:26 UTC (permalink / raw)
  To: axp-list

Hi Tom !

> X(4158): unaligned trap at 0000000000000024: 00000001205ad80f 28 2
> 
> The PC of 0x24 is clearly junk in this case.

Your program works for me as expected. I'm using a 2.0.34 +
alpha-patches-2.0.34-0.1.gz. 

I had problems with earlier kernels too.
I don't remember exactly; but PC wrotes the address of the
instruction that follows the uac instruction and 
the uac-address was set to the previous aligned address.

-- 

Quant-X Service &                         Ph:  (+43) 4212 6004-0
Consulting Ges.m.b.H.                     Fax: (+43) 4212 600420
http://www.quant-x.com                    Email: support@quant-x.com


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

* Re: debugging unaligned traps
  1998-07-13  3:26 ` debugging unaligned traps Tom Holroyd
  1998-07-13  4:26   ` Quant-X Alpha Linux Support
@ 1998-07-13 10:24   ` Tom Holroyd
  1998-07-13 14:35     ` Quant-X Alpha Linux Support
  1 sibling, 1 reply; 12+ messages in thread
From: Tom Holroyd @ 1998-07-13 10:24 UTC (permalink / raw)
  To: axp-list

On Mon, 13 Jul 1998, Tom Holroyd wrote:

>My X server says:
>X(4158): unaligned trap at 0000000000000024: 00000001205ad80f 28 2
>
>The PC of 0x24 is clearly junk in this case.

Ah yes, there is a patch for this (to traps.c).  Thanks!

Now it says:
X(351): unaligned trap at 00000001200501b8: 00000001205b7ec6 28 2

Guess it's time to upgrade to 2.0.34 for real.

Dr. Tom Holroyd
Behavior Control Lab, Human Informatics Dept.            The basis of
National Institute of Bioscience and Human-Technology    stability is
1-1 Higashi, Tsukuba-shi, Ibaraki 305, Japan             instability.
The 9th Amendment of the U.S. Constitution:
"The enumeration in the Constitution, of certain rights, shall not be
construed to deny or disparage others retained by the people."


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

* Re: debugging unaligned traps
  1998-07-13 10:24   ` Tom Holroyd
@ 1998-07-13 14:35     ` Quant-X Alpha Linux Support
  1998-07-13 22:54       ` Steven N. Hirsch
  1998-07-14 14:53       ` Jason Lavoie
  0 siblings, 2 replies; 12+ messages in thread
From: Quant-X Alpha Linux Support @ 1998-07-13 14:35 UTC (permalink / raw)
  To: axp-list; +Cc: Jay A Estabrook

Hi Tom !

> >My X server says:
> >X(4158): unaligned trap at 0000000000000024: 00000001205ad80f 28 2
> >
> >The PC of 0x24 is clearly junk in this case.
> 
> Ah yes, there is a patch for this (to traps.c).  Thanks!
> 
> Now it says:
> X(351): unaligned trap at 00000001200501b8: 00000001205b7ec6 28 2
> 
> Guess it's time to upgrade to 2.0.34 for real.

If uac is a reason for you, yes. ;-}

2.0.34 with alpha-patches-2.0.34-0.1.gz + tulip update
is an extreme stable combination; if you don't need kgdb.
Thanks to ... Jay Estabrook ... 

BTW, Linus made a console back-port (pre-patch-2.1.109-2.{gz,bz2});
give it a try. Some people (like "Steven N. Hirsch" <shirsch@adelphia.net>
fighting with UDB) on the kernel list are our heros. ;-]

-- 

Quant-X Service &                         Ph:  (+43) 4212 6004-0
Consulting Ges.m.b.H.                     Fax: (+43) 4212 600420
http://www.quant-x.com                    Email: support@quant-x.com


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

* Re: debugging unaligned traps
  1998-07-13 14:35     ` Quant-X Alpha Linux Support
@ 1998-07-13 22:54       ` Steven N. Hirsch
  1998-07-14  0:32         ` Quant-X Alpha Linux Support
  1998-07-14 14:53       ` Jason Lavoie
  1 sibling, 1 reply; 12+ messages in thread
From: Steven N. Hirsch @ 1998-07-13 22:54 UTC (permalink / raw)
  To: Quant-X Alpha Linux Support; +Cc: axp-list



On Mon, 13 Jul 1998, Quant-X Alpha Linux Support wrote:

> BTW, Linus made a console back-port (pre-patch-2.1.109-2.{gz,bz2});
> give it a try. Some people (like "Steven N. Hirsch" <shirsch@adelphia.net>
> fighting with UDB) on the kernel list are our heros. ;-]

<blush>.  I always appreciate adulation, but what have I done to deserve
these nice words?  

Thanks, though <g>.

Steve



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

* Re: debugging unaligned traps
  1998-07-13 22:54       ` Steven N. Hirsch
@ 1998-07-14  0:32         ` Quant-X Alpha Linux Support
  0 siblings, 0 replies; 12+ messages in thread
From: Quant-X Alpha Linux Support @ 1998-07-14  0:32 UTC (permalink / raw)
  Cc: axp-list

Hi Steve !

> > BTW, Linus made a console back-port (pre-patch-2.1.109-2.{gz,bz2});
> > give it a try. Some people (like "Steven N. Hirsch" <shirsch@adelphia.net>
> > fighting with UDB) on the kernel list are our heros. ;-]
> 
> <blush>.  I always appreciate adulation, but what have I done to deserve
> these nice words?  

Just some messages in the KDE-GNOME <ouups> kernel mailinglist.
Linux and Alain both perform some statistics. If not at least
X (break-even) people complain against a broken Y it won't
get fixed. :-}

Alan does this really good. There was a cool situation where
Donald Becker has declared tulip 0.xx as stable.
Alan said something like: It may be stable for you but I've
21 reports that it doesn't work, no, it won't be included
in the 2.0.xx-preY release...

There is much chaos theory and statistic in the whole
game. Without some hacker like you the game wouldn't
work. The development kernels are needed for a stable
2.2. I bet 2.3 will bring us "suspend to disk"
(Linus is thinking about...)  btw I don't think
that it's useful nor even possible at moment.

-- 

Quant-X Service &                         Ph:  (+43) 4212 6004-0
Consulting Ges.m.b.H.                     Fax: (+43) 4212 600420
http://www.quant-x.com                    Email: support@quant-x.com


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

* Re: debugging unaligned traps
  1998-07-13 14:35     ` Quant-X Alpha Linux Support
  1998-07-13 22:54       ` Steven N. Hirsch
@ 1998-07-14 14:53       ` Jason Lavoie
  1998-07-14 18:20         ` Quant-X Alpha Linux Support
  1 sibling, 1 reply; 12+ messages in thread
From: Jason Lavoie @ 1998-07-14 14:53 UTC (permalink / raw)
  To: axp-list

On 07/13, Quant-X Alpha Linux Support wrote:
> Hi Tom !
> 
[...]
> 
> 2.0.34 with alpha-patches-2.0.34-0.1.gz + tulip update
                                            ^^^^^^^^^^^^
> is an extreme stable combination; if you don't need kgdb.
> Thanks to ... Jay Estabrook ... 

Where to find the 'tulip update'?   I'm having odd problems getting a
working kernel (2.0.34 with patches) on a UDB with the tulip driver.
I've tried .79, .83, and .89H with no progress.

Sorry to ask what was probably already discussed on this list, but 
I can't seem to find any searchable archives... (and I usually skim
the list and must've missed the original thread).

Thanks in advance!

-j

-- 
"What is the sound of Perl?  Is it not the sound of a        | Jason Lavoie 
 wall that people have stopped banging their heads against?" | jason@mint.net
     --Larry Wall in <1992Aug26.184221.29627@netlabs.com>    | 


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

* Re: debugging unaligned traps
  1998-07-14 14:53       ` Jason Lavoie
@ 1998-07-14 18:20         ` Quant-X Alpha Linux Support
  0 siblings, 0 replies; 12+ messages in thread
From: Quant-X Alpha Linux Support @ 1998-07-14 18:20 UTC (permalink / raw)
  To: axp-list

Hi !

> > 2.0.34 with alpha-patches-2.0.34-0.1.gz + tulip update
>                                             ^^^^^^^^^^^^
> > is an extreme stable combination; if you don't need kgdb.
> > Thanks to ... Jay Estabrook ... 
> 
> Where to find the 'tulip update'?   I'm having odd problems getting a
> working kernel (2.0.34 with patches) on a UDB with the tulip driver.
> I've tried .79, .83, and .89H with no progress.

I'm using 0.89H but have no experience with UDB.
Our kernels for all Linux/AXP systems we ship have tulip .89H and de4x5 
included (module). Default: de4x5.

-- 

Quant-X Service &                         Ph:  (+43) 4212 6004-0
Consulting Ges.m.b.H.                     Fax: (+43) 4212 600420
http://www.quant-x.com                    Email: support@quant-x.com


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

end of thread, other threads:[~1998-07-14 18:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-07-11  7:57 Debugging unaligned traps B. James Phillippe
1998-07-11 11:12 ` Matti Aarnio
1998-07-12  9:17   ` Quant-X Alpha Linux Support
1998-07-11 11:39 ` Maciej W. Rozycki
  -- strict thread matches above, loose matches on Subject: below --
1998-07-12 17:43 BT-958 = IRQ 24??? Jay.Estabrook
1998-07-13  3:26 ` debugging unaligned traps Tom Holroyd
1998-07-13  4:26   ` Quant-X Alpha Linux Support
1998-07-13 10:24   ` Tom Holroyd
1998-07-13 14:35     ` Quant-X Alpha Linux Support
1998-07-13 22:54       ` Steven N. Hirsch
1998-07-14  0:32         ` Quant-X Alpha Linux Support
1998-07-14 14:53       ` Jason Lavoie
1998-07-14 18:20         ` Quant-X Alpha Linux Support

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