John David Anglin | 3 Jun 20:28
Picon

Re: -pie is broken on hppa

> On the console, there's a continuous stream of messages:
> 
>      YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
>      PSW: 00001000000001101111111100001111 Not tainted
> r00-03  000000ff0806ff0f 000000004036c000 0000000040104edc 00000000c0601048
> r04-07  00000000403d79d4 00000000403d89d4 000000000002c258 0000000000000000
> r08-11  000000000002a3f4 000000000002a3f4 0000000000000001 0000000000000000
> r12-15  000000000002a3f4 0000000000000000 0000000000000001 000000000002c258
> r16-19  000000000002a3f4 000000000002a3f4 000000000002a3f4 0000000000000000
> r20-23  000000000000012a 000000004029c000 0000000040357594 000000000002c268
> r24-27  00000000c0601048 0000000000000058 000000000002c258 0000000040503fc0
> r28-31  00000000403daf60 000000007c744170 000000007c744180 00000000403575e3
> sr00-03  00000000000eb800 0000000000000000 0000000000000000 00000000000eb800
> sr04-07  0000000000000000 0000000000000000 0000000000000000 0000000000000000
> 
> IASQ: 0000000000000000 0000000000000000 IAOQ: 0000000000000000 0000000000000004
>  IIR: 00000000    ISR: 00000000000eb800  IOR: 0000000000000000
>  CPU:        0   CR30: 000000007c744000 CR31: 00000000404c4000
>  ORIG_R28: 0000000040155a7c
>  IAOQ[0]: 0x0
>  IAOQ[1]: 0x4
>  RP(r2): syscall_exit+0x0/0x14

The kernel is 2.6.20-gfb60ab85-dirty.  The above appears to be a
syscall that's not hooked up.   The number appears to be 0x12a (298).

I believe that we aren't allowed to fault on the gateway page.
If we have holes in the syscall table, I think we need a check
for this since the following code will fault if r19 is zero:

(Continue reading)

Kyle McMartin | 3 Jun 21:28
Picon

Re: -pie is broken on hppa

On Sun, Jun 03, 2007 at 02:28:17PM -0400, John David Anglin wrote:
> I believe that we aren't allowed to fault on the gateway page.
> If we have holes in the syscall table, I think we need a check
> for this since the following code will fault if r19 is zero:
> 
> .Lin_syscall:
>         ldil    L%syscall_exit,%r2
> 	be      0(%sr7,%r19)
> 	ldo     R%syscall_exit(%r2),%r2
> 

This is bad. Your kernel is too old, and glibc didn't take this into
account. I'll hack something up to return -ENOSYS.
Kyle McMartin | 3 Jun 22:49
Picon

Re: -pie is broken on hppa

On Sun, Jun 03, 2007 at 03:28:29PM -0400, Kyle McMartin wrote:
> On Sun, Jun 03, 2007 at 02:28:17PM -0400, John David Anglin wrote:
> > I believe that we aren't allowed to fault on the gateway page.
> > If we have holes in the syscall table, I think we need a check
> > for this since the following code will fault if r19 is zero:
> > 
> > .Lin_syscall:
> >         ldil    L%syscall_exit,%r2
> > 	be      0(%sr7,%r19)
> > 	ldo     R%syscall_exit(%r2),%r2
> > 
> 
> This is bad. Your kernel is too old, and glibc didn't take this into
> account. I'll hack something up to return -ENOSYS.
> 

Er, we already have code to do this:

#ifdef CONFIG_64BIT
	ldil	L%sys_call_table, %r1
	or,=	%r2,%r2,%r2
	addil	L%(sys_call_table64-sys_call_table), %r1
	ldo	R%sys_call_table(%r1), %r19
	or,=	%r2,%r2,%r2
	ldo	R%sys_call_table64(%r1), %r19
#else
	ldil	L%sys_call_table, %r1
	ldo     R%sys_call_table(%r1), %r19
#endif	
	comiclr,>>=	__NR_Linux_syscalls, %r20, %r0
(Continue reading)

John David Anglin | 3 Jun 21:49
Picon

Re: -pie is broken on hppa

> This is bad. Your kernel is too old, and glibc didn't take this into
> account. I'll hack something up to return -ENOSYS.

I'm a bit surprised that 2.6.20 is too old.  In any event, my
initial attempt to do the above hasn't worked:

Kernel command line: root=/dev/sda3 panic=5 console=ttyS1 palo_kernel=1/vmlinux
Backtrace:
 [<00000000401c6d02>] ep_remove+0xc8/0xe8
 [<0000000040200215>] log_do_checkpoint+0x1cc/0x418
 [<0000000040287010>] class_device_add+0x510/0x5f0
 [<0000000040140912>] sysctl_string+0x188/0x1b8
 [<000000004010020f>] aligned_rfi+0xc/0xe00
 [<0000000040366380>] packet_getsockopt+0x130/0x138
 [<0000000040365160>] packet_ioctl+0x188/0x198
 [<0000000040362798>] unix_ioctl+0xb8/0x110
 [<000000004034cecc>] ipv4_sysctl_forward_strategy+0x12c/0x138
 [<000000004034ce48>] ipv4_sysctl_forward_strategy+0xa8/0x138
 [<000000004034bd5c>] ip_mc_msfget+0x16c/0x1d0
 [<0000000040343fa0>] ipv4_doint_and_flush_strategy+0x110/0x138
 [<000000004033ef8c>] udp_ioctl+0xf4/0x100
 [<000000004033d8bc>] udp_lib_setsockopt+0x8c/0x170
 [<000000004033d37c>] udp_lib_getsockopt+0x54/0x110
 [<000000004033c140>] raw_sendmsg+0x640/0x810

Kernel Fault: Code=15 regs=00000000404c0290 (Addr=0000000080000000)

     YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
PSW: 00001000000001000000011100001110 Not tainted
r00-03  000000000804070e 00000000405107c0 000000004051aed4 0000000040103000
(Continue reading)

Kyle McMartin | 3 Jun 21:51
Picon

Re: -pie is broken on hppa

On Sun, Jun 03, 2007 at 03:49:38PM -0400, John David Anglin wrote:
> > This is bad. Your kernel is too old, and glibc didn't take this into
> > account. I'll hack something up to return -ENOSYS.
> 
> I'm a bit surprised that 2.6.20 is too old.  In any event, my
> initial attempt to do the above hasn't worked:
>

Why? The syscall was added for 2.6.21.

> 
>      YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
> PSW: 00001000000001000000011100001110 Not tainted
> r00-03  000000000804070e 00000000405107c0 000000004051aed4 0000000040103000
> r04-07  0000000040503fc0 0000000000480000 00000000fffffff0 00000000f040dd30
> r08-11  0000000000000258 0000000000000001 000000000804000e 0000000040514634
> r12-15  0000000000000000 0000000000000001 0000000000000001 00000000000225c4
> r16-19  00000000f0d00b0c 0000000000000000 00000000000f76f8 0000000080000000
> r20-23  00000000e208b185 000000003ffffd90 0000000040103020 00000000404e5300
> r24-27  0000000000000000 00000000403c3491 000000004010300d 0000000040503fc0
> r28-31  00000000e208b185 00000000404c0260 00000000404c0290 000000000fec6fc0
> sr00-03  0000000000000000 0000000000000000 0000000000000000 0000000000000000
> sr04-07  0000000000000000 0000000000000000 0000000000000000 0000000000000000
> 
> IASQ: 0000000000000000 0000000000000000 IAOQ: 000000004051af34 000000004051af38
>  IIR: 0e60109c    ISR: 0000000000000000  IOR: 0000000080000000
>  CPU:        0   CR30: 00000000404c0000 CR31: 00000000404c4000
>  ORIG_R28: 00000000401385a4
>  IAOQ[0]: check_ivt+0x84/0xe0
>  IAOQ[1]: check_ivt+0x88/0xe0
(Continue reading)

John David Anglin | 4 Jun 03:02
Picon

Re: -pie is broken on hppa

> >      YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
> > PSW: 00001000000001000000011100001110 Not tainted
> > r00-03  000000000804070e 00000000405107c0 000000004051aed4 0000000040103000
> > r04-07  0000000040503fc0 0000000000480000 00000000fffffff0 00000000f040dd30
> > r08-11  0000000000000258 0000000000000001 000000000804000e 0000000040514634
> > r12-15  0000000000000000 0000000000000001 0000000000000001 00000000000225c4
> > r16-19  00000000f0d00b0c 0000000000000000 00000000000f76f8 0000000080000000
> > r20-23  00000000e208b185 000000003ffffd90 0000000040103020 00000000404e5300
> > r24-27  0000000000000000 00000000403c3491 000000004010300d 0000000040503fc0
> > r28-31  00000000e208b185 00000000404c0260 00000000404c0290 000000000fec6fc0
> > sr00-03  0000000000000000 0000000000000000 0000000000000000 0000000000000000
> > sr04-07  0000000000000000 0000000000000000 0000000000000000 0000000000000000
> > 
> > IASQ: 0000000000000000 0000000000000000 IAOQ: 000000004051af34 000000004051af38
> >  IIR: 0e60109c    ISR: 0000000000000000  IOR: 0000000080000000
> >  CPU:        0   CR30: 00000000404c0000 CR31: 00000000404c4000
> >  ORIG_R28: 00000000401385a4
> >  IAOQ[0]: check_ivt+0x84/0xe0
> >  IAOQ[1]: check_ivt+0x88/0xe0
> >  RP(r2): check_ivt+0x24/0xe0
> > Kernel panic - not syncing: Kernel Fault
> > <0>Rebooting in 5 seconds..
> 
> binutils is fucked.

I don't think so.  There's some wierd stuff in check_ivt.  It looks
like the function is trying to see if it can compute a checksum for
the os_hpmc function without causing a panic.  However, the function
pointer stuff is all wrong.  Note that 32 and 64-bit function pointer
handling is completely different.
(Continue reading)

Kyle McMartin | 4 Jun 03:10
Picon

Re: -pie is broken on hppa

On Sun, Jun 03, 2007 at 09:02:24PM -0400, John David Anglin wrote:
> 
> I don't think so.  There's some wierd stuff in check_ivt.  It looks
> like the function is trying to see if it can compute a checksum for
> the os_hpmc function without causing a panic.  However, the function
> pointer stuff is all wrong.  Note that 32 and 64-bit function pointer
> handling is completely different.
> 

Er, then why didn't it complain before?

Can you do a quick test if I cook up a patch?
John David Anglin | 4 Jun 03:23
Picon

Re: -pie is broken on hppa

> Er, then why didn't it complain before?

I think the linker script may have changed.

> Can you do a quick test if I cook up a patch?

Yes.  I disabled the code after "cows can fly".  2.6.22-rc2
now boots and df works.s

However, svn is still behaving wierdly:
Badness at 000000004018e2cc
Seems to be in __kmalloc.

Dave
--

-- 
J. David Anglin                                  dave.anglin <at> nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
John David Anglin | 4 Jun 03:37
Picon

Re: -pie is broken on hppa

> However, svn is still behaving wierdly:

Running svn cleanup with strace, these are the last few syscalls:

lstat64("libgcc/config/ia64/.svn/tmp/propsbase", 0xc02b6f08) = -1 ENOENT (No such file or directory)
gettimeofday({1180920486, 457857}, NULL) = 0
_newselect(0, NULL, NULL, NULL, {0, 642143}) = 0 (Timeout)
write(2, "svn: Can\'t read directory \'libgc"..., 112svn: Can't read directory
'libgcc/config/ia64/.svn/tmp': Partial results are valid but processing is incomplete
) = 112
close(3)                                = 0
brk(0x80000)                            = 0x80000
exit_group(1)                           = ?
Process 1357 detached

I wonder if there is a problem with lstat64.  Is this one of the syscalls
that was added recently?

Dave
--

-- 
J. David Anglin                                  dave.anglin <at> nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
Kyle McMartin | 4 Jun 03:43
Picon

Re: -pie is broken on hppa

On Sun, Jun 03, 2007 at 09:37:12PM -0400, John David Anglin wrote:
> Running svn cleanup with strace, these are the last few syscalls:
> 
> lstat64("libgcc/config/ia64/.svn/tmp/propsbase", 0xc02b6f08) = -1 ENOENT (No such file or directory)
> gettimeofday({1180920486, 457857}, NULL) = 0
> _newselect(0, NULL, NULL, NULL, {0, 642143}) = 0 (Timeout)
> write(2, "svn: Can\'t read directory \'libgc"..., 112svn: Can't read directory
'libgcc/config/ia64/.svn/tmp': Partial results are valid but processing is incomplete
> ) = 112
> close(3)                                = 0
> brk(0x80000)                            = 0x80000
> exit_group(1)                           = ?
> Process 1357 detached
> 

I don't suppose you could strace in a chroot with a older working glibc
and see what syscalls are there?

I don't see anything offhand that would have changed about this here.

Cheers,
	Kyle
John David Anglin | 4 Jun 03:47
Picon

Re: -pie is broken on hppa

> I don't suppose you could strace in a chroot with a older working glibc
> and see what syscalls are there?

Probably, I won't have time until next weekend.

Dave
--

-- 
J. David Anglin                                  dave.anglin <at> nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
Kyle McMartin | 29 Jun 09:29
Picon

Re: -pie is broken on hppa

On Sun, Jun 03, 2007 at 09:47:10PM -0400, John David Anglin wrote:
> > I don't suppose you could strace in a chroot with a older working glibc
> > and see what syscalls are there?
> 
> Probably, I won't have time until next weekend.
>

Could you try this patch?

Thanks,
	Kyle M.

>From 0deea67e075b5152d427426583500b8d9cf0a56c Mon Sep 17 00:00:00 2001
From: Kyle McMartin <kyle <at> parisc-linux.org>
Date: Fri, 29 Jun 2007 03:38:10 -0400
Subject: [PARISC] Use compat_sys_getdents

Switch to using the generic compat_sys_getdents instead of a
homebrew one.

Signed-off-by: Kyle McMartin <kyle <at> parisc-linux.org>
---
 arch/parisc/kernel/sys_parisc32.c  |  141 ------------------------------------
 arch/parisc/kernel/syscall_table.S |    4 +-
 2 files changed, 1 insertions(+), 144 deletions(-)

diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index bb23ff7..2989c66 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
(Continue reading)

Jeff Bailey | 6 Jul 18:20

Re: [parisc-linux] -pie is broken on hppa

On 29/06/07, Kyle McMartin <kyle <at> mcmartin.ca> wrote:
> On Sun, Jun 03, 2007 at 09:47:10PM -0400, John David Anglin wrote:
> > > I don't suppose you could strace in a chroot with a older working glibc
> > > and see what syscalls are there?
> >
> > Probably, I won't have time until next weekend.
> >
>
> Could you try this patch?

I tried it to see if it would fix the strangeness in the glibc
testsuite where three tests can't find files, but if run a couple
seconds later finds them fine.  It doesn't fix this, but it also
doesn't cause any further regressions.

--

-- 
Jeff Bailey - http://www.raspberryginger.com/jbailey/

John David Anglin | 30 Jun 17:44
Picon

Re: -pie is broken on hppa

> Could you try this patch?

I installed it last night.  svn works, gcc bootstraps and I haven't
seen any other problems.  There was a problem building libjava with
the getdents bug.

> -	/* struct linux_dirent has longs, like 'unsigned long d_ino' which
> -	 * almost definitely should be 'ino_t d_ino' but it's too late now */

This is my only concern.

Dave
--

-- 
J. David Anglin                                  dave.anglin <at> nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
Kyle McMartin | 30 Jun 18:54
Picon

Re: -pie is broken on hppa

On Sat, Jun 30, 2007 at 11:44:13AM -0400, John David Anglin wrote:
> > Could you try this patch?
> 
> I installed it last night.  svn works, gcc bootstraps and I haven't
> seen any other problems.  There was a problem building libjava with
> the getdents bug.
>

OK. I'll try to build a HEAD kernel and boot with an old glibc to see if
it fucks up. Is there a really easy testcase I can try to reproduce
this?

> > -	/* struct linux_dirent has longs, like 'unsigned long d_ino' which
> > -	 * almost definitely should be 'ino_t d_ino' but it's too late now */
> 
> This is my only concern.
> 

It should be fine, since all other compat arches have the same problem.
John David Anglin | 30 Jun 19:51
Picon

Re: -pie is broken on hppa

> On Sat, Jun 30, 2007 at 11:44:13AM -0400, John David Anglin wrote:
> > > Could you try this patch?
> > 
> > I installed it last night.  svn works, gcc bootstraps and I haven't
> > seen any other problems.  There was a problem building libjava with
> > the getdents bug.
> >
> 
> OK. I'll try to build a HEAD kernel and boot with an old glibc to see if
> it fucks up. Is there a really easy testcase I can try to reproduce
> this?

I phrased my response badly.  I haven't seen any new problems and
the change fixes the libjava build problem.

Dave
--

-- 
J. David Anglin                                  dave.anglin <at> nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
John David Anglin | 3 Jun 22:03
Picon

Re: -pie is broken on hppa

> binutils is fucked.

Crap!  I'll try installing one of my own builds from a different system.

Dave
--

-- 
J. David Anglin                                  dave.anglin <at> nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
Kyle McMartin | 3 Jun 22:12
Picon

Re: -pie is broken on hppa

On Sun, Jun 03, 2007 at 04:03:15PM -0400, John David Anglin wrote:
> > binutils is fucked.
> 
> Crap!  I'll try installing one of my own builds from a different system.
> 

I've had good luck building kernels with my Etch (Debian 4.0) chroots.

--Kyle

Gmane