Skip to contentSkip to conversation

Bug#200619: gcc: parisc: compiling dietlibc-dev with -Os caus

parisc-linux John David Anglin 2 participants 6 messages Jul 25, 2003 – Aug 9, 2003 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 4 lines

[CC to jda]

Please can you recheck with a current gcc snapshot (from the gcc-snapshot package) and attach the preprocessed source?

This doesn't appear to be a gcc problem. The register %r3 is saved on the stack in __stdio_init_file_nothreads. The stack location is clobbered by the fstat syscall.

Quoted 3 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+  {
+    struct stat st;
+    fstat(fd,&st);

At the fstat call we have the following values:

Breakpoint 11, 0x00010b10 in __stdio_init_file_nothreads () (gdb) printf "0x%x\n",*0xfaf005a8
0xfaf004c0
(gdb) printf "0x%x\n",$r25
0xfaf00548
(gdb) printf "0x%x\n",$r26
0x5
(gdb) c
Continuing.

Breakpoint 12, 0x00010b18 in __stdio_init_file_nothreads () (gdb) printf "0x%x\n",*0xfaf005a8
0x0

0xfaf005a8 is the location where %r3 was saved. The break is at the fstat syscall. Non of the user space code in the call patch affects the above location, so the bug must be in the kernel.

I looked at this on a 64-bit kernel:

dave@gsyprf11:~/dietlibc-0.22.orig$ uname -a
Linux gsyprf11.external.hp.com 2.4.21-pa6 #23 Mon Jul 14 23:11:39 PDT 2003 parisc64 GNU/Linux

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
#2 lore raw
In reply to a message not in the archive
Quoted 4 lines

[CC to jda]

Please can you recheck with a current gcc snapshot (from the gcc-snapshot package) and attach the preprocessed source?

This doesn't appear to be a gcc problem. The register %r3 is saved on the stack in __stdio_init_file_nothreads. The stack location is clobbered by the fstat syscall.

Quoted 3 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+  {
+    struct stat st;
+    fstat(fd,&st);

At the fstat call we have the following values:

Breakpoint 11, 0x00010b10 in __stdio_init_file_nothreads () (gdb) printf "0x%x\n",*0xfaf005a8
0xfaf004c0
(gdb) printf "0x%x\n",$r25
0xfaf00548
(gdb) printf "0x%x\n",$r26
0x5
(gdb) c
Continuing.

Breakpoint 12, 0x00010b18 in __stdio_init_file_nothreads () (gdb) printf "0x%x\n",*0xfaf005a8
0x0

0xfaf005a8 is the location where %r3 was saved. The break is at the fstat syscall. Non of the user space code in the call patch affects the above location, so the bug must be in the kernel.

I looked at this on a 64-bit kernel:

dave@gsyprf11:~/dietlibc-0.22.orig$ uname -a
Linux gsyprf11.external.hp.com 2.4.21-pa6 #23 Mon Jul 14 23:11:39 PDT 2003 parisc64 GNU/Linux

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
#3 lore raw
Quoted 11 lines

This doesn't appear to be a gcc problem. The register %r3 is saved on the stack in __stdio_init_file_nothreads. The stack location is clobbered by the fstat syscall.

Quoted 3 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+  {
+    struct stat st;
+    fstat(fd,&st);

At the fstat call we have the following values:

Breakpoint 11, 0x00010b10 in __stdio_init_file_nothreads ()

Carlos O'Donell and myself looked at this problem this afternoon. This is a dietlib problem. Dietlib is not using the correct kernel_stat mapping for parisc. They appear to be using the i386 mapping. They need to look at /libc/sysdeps/unix/sysv/linux/xstatconv.c and the hppa/kernel_stat.h header in glibc.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
#4 lore raw
In reply to John David Anglin
Quoted 11 lines

This doesn't appear to be a gcc problem. The register %r3 is saved on the stack in __stdio_init_file_nothreads. The stack location is clobbered by the fstat syscall.

Quoted 3 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+  {
+    struct stat st;
+    fstat(fd,&st);

At the fstat call we have the following values:

Breakpoint 11, 0x00010b10 in __stdio_init_file_nothreads ()

Carlos O'Donell and myself looked at this problem this afternoon. This is a dietlib problem. Dietlib is not using the correct kernel_stat mapping for parisc. They appear to be using the i386 mapping. They need to look at /libc/sysdeps/unix/sysv/linux/xstatconv.c and the hppa/kernel_stat.h header in glibc.

Dave

Signature · 2 lines
J. David Anglin                                  [email protected]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
#5 lore raw

reassign 200619 dietlibc
retitle 200619 dietlibc: parisc: bad stat struct mapping thanks

Quoted 9 lines · John David Anglin
Quoted 3 lines

At the fstat call we have the following values:

Breakpoint 11, 0x00010b10 in __stdio_init_file_nothreads ()

Carlos O'Donell and myself looked at this problem this afternoon. This is a dietlib problem. Dietlib is not using the correct kernel_stat mapping for parisc. They appear to be using the i386 mapping. They need to look at /libc/sysdeps/unix/sysv/linux/xstatconv.c and the hppa/kernel_stat.h header in glibc.

Yes, this seems to be the cause of the problems, and needs to be fixed in the dietlibc. Thanks a lot for your time looking into this, and your valuable support.

Regards, Gerrit.

#6 lore raw
In reply to John David Anglin

reassign 200619 dietlibc
retitle 200619 dietlibc: parisc: bad stat struct mapping thanks

Quoted 9 lines · John David Anglin
Quoted 3 lines

At the fstat call we have the following values:

Breakpoint 11, 0x00010b10 in __stdio_init_file_nothreads ()

Carlos O'Donell and myself looked at this problem this afternoon. This is a dietlib problem. Dietlib is not using the correct kernel_stat mapping for parisc. They appear to be using the i386 mapping. They need to look at /libc/sysdeps/unix/sysv/linux/xstatconv.c and the hppa/kernel_stat.h header in glibc.

Yes, this seems to be the cause of the problems, and needs to be fixed in the dietlibc. Thanks a lot for your time looking into this, and your valuable support.

Regards, Gerrit.