Bug#1076512: Info received (Bug#1076512: Info received (Bug#1076512: Acknowledgement (glibc: FTBFS on hppa - stdlib/tst-swapcontext2 test fails)))

2024-07-18 Thread John David Anglin

Upstream patch:
https://sourceware.org/pipermail/libc-alpha/2024-July/158419.html

BZ:
https://sourceware.org/bugzilla/show_bug.cgi?id=31989

Regard,
Dave

--
John David Anglin  dave.ang...@bell.net



Bug#1076512: Info received (Bug#1076512: Acknowledgement (glibc: FTBFS on hppa - stdlib/tst-swapcontext2 test fails))

2024-07-18 Thread John David Anglin

There are more problems of the same nature in glibc source:

dave@atlas:~/gnu/glibc/glibc$ find . -type f|xargs grep _STACK_GROWS|grep ifdef
./malloc/memusage.c:#ifdef _STACK_GROWS_UP
./include/stackinfo.h:# ifdef _STACK_GROWS_UP
./include/stackinfo.h:# ifdef _STACK_GROWS_DOWN
./sysdeps/unix/sysv/linux/longjmp_chk.c:#ifdef _STACK_GROWS_DOWN

./include/stackinfo.h is okay but the other two usages of these defines look 
wron.

Dave
--

John David Anglin  dave.ang...@bell.net



Bug#1076512: Acknowledgement (glibc: FTBFS on hppa - stdlib/tst-swapcontext2 test fails)

2024-07-17 Thread John David Anglin

It's a bug in the test.  The attached patch fixes the failure on hppa.

This happened once before...

Regards,
Dave Anglin

--
John David Anglin  dave.ang...@bell.net
diff --git a/stdlib/tst-swapcontext2.c b/stdlib/tst-swapcontext2.c
index f679755649..a9c1dc827c 100644
--- a/stdlib/tst-swapcontext2.c
+++ b/stdlib/tst-swapcontext2.c
@@ -85,7 +85,7 @@ do_test (void)
 {
   /* longjmp_chk has  */
 #if 0
-#ifdef _STACK_GROWS_DOWN
+#if _STACK_GROWS_DOWN
 #define called_from(this, saved) ((this) < (saved))
 #else
 #define called_from(this, saved) ((this) > (saved))
@@ -98,7 +98,7 @@ do_test (void)
   /* Arrange stacks for uctx_func1 and uctx_func2 so that called_from
  is true when setjmp is called from uctx_func1 and longjmp is called
  from uctx_func2.  */
-#ifdef _STACK_GROWS_DOWN
+#if _STACK_GROWS_DOWN
 # define UCTX_FUNC1_STACK  1
 # define UCTX_FUNC2_STACK  0
 #else


Bug#1076512: glibc: FTBFS on hppa - stdlib/tst-swapcontext2 test fails

2024-07-17 Thread John David Anglin
Source: glibc
Version: 2.39-4
Severity: normal
Tags: ftbfs

Dear Maintainer,

Build filas here:

--
FAIL: stdlib/tst-swapcontext2
original exit status 1
  [31mfunc1: func3(&uctx_func1, &uctx_main, str1)[0m
[31mfunc3: func4(uocp, ucp, str)[0m
  [31mfunc4: [31mswapcontext(&uctx_func1, &uctx_main)[0m[0m
[35mmain: swapcontext(&uctx_main, &uctx_func2)
[0m  [34mfunc2: func3(&uctx_func2, &uctx_main, str2)[0m
[34mfunc3: func4(uocp, ucp, str)[0m
  [34mfunc4: [34mswapcontext(&uctx_func2, &uctx_main)[0m[0m
[35mmain: swapcontext(&uctx_main, &uctx_func1)
[0m  [31mfunc4: returning[0m
[31mfunc3: returning[0m
  [31mfunc1: func3(&uctx_func1, &uctx_main, str1)[0m
[31mfunc3: func4(uocp, ucp, str)[0m
  [31mfunc4: [31mswapcontext(&uctx_func1, &uctx_main)[0m[0m
[35mmain: swapcontext(&uctx_main, &uctx_func2)
[0m  [34mfunc4: returning[0m
[34mfunc3: returning[0m
[34mfunc2: calling longjmp[0m
Didn't expect signal from child: got `Aborted'
--
+-+
| Encountered regressions that don't match expected failures. |
+-+
FAIL: stdlib/tst-swapcontext2
touch /<>/stamp-dir/check_libc
CHECK SUMMARY
check for check_libc failed

Full log is here:
https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=hppa&ver=2.39-4&stamp=1721152208&raw=0

dave@atlas:~/gnu/glibc/objdir/stdlib$ ./tst-swapcontext2
  func1: func3(&uctx_func1, &uctx_main, str1)
func3: func4(uocp, ucp, str)
  func4: swapcontext(&uctx_func1, &uctx_main)
main: swapcontext(&uctx_main, &uctx_func2)
  func2: func3(&uctx_func2, &uctx_main, str2)
func3: func4(uocp, ucp, str)
  func4: swapcontext(&uctx_func2, &uctx_main)
main: swapcontext(&uctx_main, &uctx_func1)
  func4: returning
func3: returning
  func1: func3(&uctx_func1, &uctx_main, str1)
func3: func4(uocp, ucp, str)
  func4: swapcontext(&uctx_func1, &uctx_main)
main: swapcontext(&uctx_main, &uctx_func2)
  func4: returning
func3: returning
func2: calling longjmp
*** longjmp causes uninitialized stack frame ***: terminated
Didn't expect signal from child: got `Aborted'

This bug is enabled by the --enable-fortify-source configure option.

This needs more research to determine whether this fail is caused
by a real problem (hppa is the only architecure where the stack
grows upward).  I think for now we should xfail the test.

Regards,
Dave Anglin

-- System Information:
Debian Release: trixie/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 6.9.9-dirty (SMP w/4 CPU threads)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)



Bug#1070875: glibc: FTBFS on hppa - Encountered regressions that don't match expected failures

2024-05-10 Thread John David Anglin
Source: glibc
Version: 2.38-10
Severity: normal
Tags: ftbfs

Dear Maintainer,

The following tests are known to fail on hppa when glibc is built with
gcc-13 or later:

FAIL: math/test-double-fma
FAIL: math/test-double-ldouble-fma
FAIL: math/test-float32x-float64-fma
FAIL: math/test-float32x-fma
FAIL: math/test-float64-fma
FAIL: math/test-ldouble-fma

The tests do not fail when glibc is built with gcc-12.

See following gcc bug report:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111709

Full build log is here:
https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=hppa&ver=2.38-10&stamp=1715383873&raw=0

Things get worse with gcc-14.  I suspect this is an issue with nan
representation.

Please change the above tests to xfails.

Thanks,
Dave Anglin

-- System Information:
Debian Release: trixie/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 6.1.90+ (SMP w/4 CPU threads)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)



Bug#1022771: glibc: FTBFS on hppa - malloc/tst-scratch_buffer fails with gcc-12

2022-10-25 Thread John David Anglin
Source: glibc
Version: 2.34-3
Severity: normal
Tags: ftbfs

Dear Maintainer,

The malloc/tst-scratch_buffer test fails with gcc-12:

+-+
| Encountered regressions that don't match expected failures. |
+-+
FAIL: malloc/tst-scratch_buffer

--
FAIL: malloc/tst-scratch_buffer
original exit status 1
tst-scratch_buffer.c:167: error: blob comparison failed
  blob length: 1040 bytes
  left (evaluated from r):
  
"\000\000\000\020\000\000\004\000\000\000\004\020A>\005\230"
  40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 
40 40 40 40 40 40 40 40 40 40 40 40 00 00 00 10 00 00 04 00 00 00 04 10 41 3E 
05 98
  right (evaluated from buf.data):
  
"@

Bug#1020857: libc6: 2.35-1 breaks gdb on hppa

2022-10-01 Thread John David Anglin

More info is here:
https://sourceware.org/bugzilla/show_bug.cgi?id=29635

Bug breaks glibc build (gdb attach tests fail) and probably binutils build 
(test regressions).

The problem is the dp register is sometimes not initialized for the main 
application before
initializers are run.

The attached patch fixes issue.  It restores code removed in the fix for the 
tst-audit2 failure
some months ago.  I will commit upstream as soon as more testing completes.  
I'm currently
building a +b1 version of 2.35-1 with change.

Regards,
Dave Anglin

--
John David Anglin  dave.ang...@bell.net
diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h
index c865713be1..1d51948566 100644
--- a/sysdeps/hppa/dl-machine.h
+++ b/sysdeps/hppa/dl-machine.h
@@ -347,6 +347,16 @@ elf_machine_runtime_setup (struct link_map *l, struct 
r_scope_elem *scope[],
its return value is the user program's entry point.  */
 
 #define RTLD_START \
+/* Set up dp for any non-PIC lib constructors that may be called.  */  \
+static struct link_map * __attribute__((used)) \
+set_dp (struct link_map *map)  \
+{  \
+  register Elf32_Addr dp asm ("%r27"); \
+  dp = D_PTR (map, l_info[DT_PLTGOT]); \
+  asm volatile ("" : : "r" (dp));  \
+  return map;  \
+}  \
+   \
 asm (  \
 "  .text\n"\
 "  .globl _start\n"\
@@ -426,6 +436,13 @@ asm (  
\
   direct loader invocation.  Thus, argc and argv must be   \
   reloaded from from _dl_argc and _dl_argv.  */\
\
+   /* Load main_map from _rtld_local and setup dp. */  \
+"  addil   LT'_rtld_local,%r19\n"  \
+"  ldw RT'_rtld_local(%r1),%r26\n" \
+"  bl  set_dp, %r2\n"  \
+"  ldw 0(%r26),%r26\n" \
+"  copy%ret0,%r26\n"   \
+   \
/* Load argc from _dl_argc.  */ \
 "  addil   LT'_dl_argc,%r19\n" \
 "  ldw RT'_dl_argc(%r1),%r20\n"\
@@ -438,13 +455,10 @@ asm ( 
\
 "  ldw 0(%r20),%r24\n" \
 "  stw %r24,-44(%sp)\n"\
\
-   /* Call _dl_init(main_map, argc, argv, envp). */\
-"  addil   LT'_rtld_local,%r19\n"  \
-"  ldw RT'_rtld_local(%r1),%r26\n" \
-"  ldw 0(%r26),%r26\n" \
-   \
/* envp = argv + argc + 1 */\
 "  sh2add  %r25,%r24,%r23\n"   \
+   \
+   /* Call _dl_init(main_map, argc, argv, envp). */\
 "  bl  _dl_init,%r2\n" \
 "  ldo 4(%r23),%r23\n" /* delay slot */\
\


Bug#1020857: libc6: 2.35-1 breaks gdb on hppa

2022-09-28 Thread John David Anglin

If I start gdb with /lib/ld.so.1, it runs okay with glibc 2.35-1:

dave@mx3210:~/debian/gdb/gdb-12.1$ /lib/ld.so.1 /usr/bin/gdb
GNU gdb (Debian 12.1-3) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "hppa-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb) quit

dave@atlas:~/gnu/gdb/objdir$ /lib/ld.so.1 /usr/bin/gdb -c core /usr/bin/gdb
GNU gdb (Debian 12.1-3) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "hppa-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/gdb...
Reading symbols from 
/usr/lib/debug/.build-id/26/0797847dd13b287f99df369368a8a943c3d2f3.debug...
[New LWP 3873]
[Thread debugging using libthread_db enabled]
Using host libthread_db library 
"/home/dave/gnu/glibc/objdir/nptl_db/libthread_db.so.1".
Core was generated by `gdb'.
--Type  for more, q to quit, c to continue without paging--
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x4bc63f08 in ?? ()
(gdb) bt
#0  0x4bc63f08 in ?? ()
#1  0x006b5534 in operator new (sz=340)
    at /build/gdb-2W62n4/gdb-12.1/gdbsupport/new-op.cc:59
#2  0xf2ae4c00 in boost::basic_regex > >::do_assign(char const*, char const*, 
unsigned int) ()

   from /lib/hppa-linux-gnu/libboost_regex.so.1.74.0
#3  0xf4a98434 in ?? () from /lib/hppa-linux-gnu/libsource-highlight.so.4
#4  0xf773ae50 in call_init (env=0xf4b2f7dc, argv=0xf4b2f76c, argc=9790160,
    l=) at dl-init.c:70
#5  call_init (l=, argc=9790160, argv=0xf4b2f76c,
    env=0xf4b2f7dc) at dl-init.c:26
#6  0xf773af88 in _dl_init (main_map=0xf4b574c8, argc=-189597732, argv=0x0,
    env=0x9562d0) at dl-init.c:117
#7  0xf7750f9c in _dl_start_user () from /lib/ld.so.1
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

So, it looks like we die running array initializers:

  /* Next see whether there is an array with initialization functions.  */
  ElfW(Dyn) *init_array = l->l_info[DT_INIT_ARRAY];
  if (init_array != NULL)
    {
  unsigned int j;
  unsigned int jm;
  ElfW(Addr) *addrs;

  jm = l->l_info[DT_INIT_ARRAYSZ]->d_un.d_val / sizeof (ElfW(Addr));

  addrs = (ElfW(Addr) *) (init_array->d_un.d_ptr + l->l_addr);
  for (j = 0; j < jm; ++j)
    ((dl_init_t) addrs[j]) (argc, argv, env);
    }

Regards,
Dave Anglin

--
John David Anglin  dave.ang...@bell.net



Bug#1020857: libc6: 2.35-1 breaks gdb on hppa

2022-09-27 Thread John David Anglin
Package: libc6
Version: 2.34-8
Severity: normal

Dear Maintainer,

dave@atlas:~$ gdb
Segmentation fault (core dumped)

Gdb doesn't drop core if I revert glibc to 2.34-8.

Sep 26 22:04:36 mx3210 kernel: do_page_fault() command='gdb' type=6 
address=0x4bc63f0b in libresolv.so.2[ea7f2000+e000]
Sep 26 22:04:36 mx3210 kernel: trap #6: Instruction TLB miss fault, vm_start = 
0x0098b000, vm_end = 0x009c4000
Sep 26 22:04:36 mx3210 kernel: command line: gdb
Sep 26 22:04:36 mx3210 kernel: CPU: 0 PID: 7976 Comm: gdb Not tainted 5.19.11+ 
#1
Sep 26 22:04:36 mx3210 kernel: Hardware name: 9000/800/rp3440
Sep 26 22:04:36 mx3210 kernel:
Sep 26 22:04:36 mx3210 kernel: YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
Sep 26 22:04:36 mx3210 kernel: PSW: 0110 Not tainted
Sep 26 22:04:36 mx3210 kernel: r00-03  00ff0006ff0f 0014a908 
006b5537 0154
Sep 26 22:04:36 mx3210 kernel: r04-07  f2e59fd4 f4e396c8 
009562d0 f4e1176c
Sep 26 22:04:36 mx3210 kernel: r08-11  f4e117dc  
 
Sep 26 22:04:36 mx3210 kernel: r12-15   00177730 
 
Sep 26 22:04:36 mx3210 kernel: r16-19  0001 0013c41c 
0016e870 4bc53f11
Sep 26 22:04:36 mx3210 kernel: r20-23  009562d0 4bc63f09 
0014add8 
Sep 26 22:04:36 mx3210 kernel: r24-27  f4e117dc f4e1176c 
0154 00135108
Sep 26 22:04:36 mx3210 kernel: r28-31   0001 
f98e24c0 00011234
Sep 26 22:04:36 mx3210 kernel: sr00-03  00957400  
 00957400
Sep 26 22:04:36 mx3210 kernel: sr04-07  00957400 00957400 
00957400 00957400
Sep 26 22:04:36 mx3210 kernel:
Sep 26 22:04:36 mx3210 kernel:  VZOUICununcqcqcqcqcqcrmunTDVZOUI
Sep 26 22:04:36 mx3210 kernel: FPSR: 
Sep 26 22:04:36 mx3210 kernel: FPER1: 
Sep 26 22:04:36 mx3210 kernel: fr00-03    
 
Sep 26 22:04:36 mx3210 kernel: fr04-07    
 
Sep 26 22:04:36 mx3210 kernel: fr08-11    
 
Sep 26 22:04:36 mx3210 kernel: fr12-15    
 
Sep 26 22:04:36 mx3210 kernel: fr16-19    
 
Sep 26 22:04:36 mx3210 kernel: fr20-23    
006b559562d0 
Sep 26 22:04:36 mx3210 kernel: fr24-27    
 
Sep 26 22:04:36 mx3210 kernel: fr28-31    
 
Sep 26 22:04:36 mx3210 kernel:
Sep 26 22:04:36 mx3210 kernel: IASQ: 00957400 00957400 IAOQ: 
4bc63f0b 4bc63f0f
Sep 26 22:04:36 mx3210 kernel: IIR: 4380ISR: 00957400  IOR: 
0014add8
Sep 26 22:04:36 mx3210 kernel: CPU:0   CR30: 0040d6db4570 CR31: 
efff
Sep 26 22:04:36 mx3210 kernel: ORIG_R28: 
Sep 26 22:04:36 mx3210 kernel: IAOQ[0]: 4bc63f0b
Sep 26 22:04:36 mx3210 kernel: IAOQ[1]: 4bc63f0f
Sep 26 22:04:36 mx3210 kernel: RP(r2): 006b5537

   104c4:   43 ff ff 80 ldb 1fc0(sr3,r31),r31

dave@mx3210:~$ gdb -c core_gdb /usr/bin/gdb
GNU gdb (Debian 12.1-3) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "hppa-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/gdb...
(No debugging symbols found in /usr/bin/gdb)
[New LWP 8366]

warning: File "/usr/lib/hppa-linux-gnu/libthread_db.so.1" auto-loading has been 
declined by your `auto-load safe-path' set to 
"$debugdir:$datadir/auto-load:/lib/hppa-linux-gnu/libthread_db-1.0.so:/home/dave/debian/firefox/firefox-50.1.0/.gdbinit".
To enable execution of this file add
add-auto-load-safe-path /usr/lib/hppa-linux-gnu/libthread_db.so.1
line to your configuration file "/home/dave/.gdbinit".
To completely disable this security protection add
set auto-load safe-path /
--Type  for more, q to quit, c to continue without paging--
line to yo

Bug#472269: libc6: res_query makes assumptions about the alignment of the answer argument

2022-03-22 Thread John David Anglin
Package: libc6
Followup-For: Bug #472269

Dear Maintainer,

I believe this bug is fixed upstream by the following commit:

commit 05dec22d7be722987ff07aebf9690f6078b3c4e9 (HEAD -> master, origin/master,
origin/HEAD)
Author: John David Anglin 
Date:   Tue Mar 22 17:35:54 2022 +

resolv: Fix unaligned accesses to fields in HEADER struct

The structure HEADER is normally aligned to a word boundary but
sometimes it needs to be accessed when aligned on a byte boundary.
This change defines a new typedef, UHEADER, with alignment 1.
It is used to ensure the fields are accessed with byte loads and
stores when necessary.

V4: Change to res_mkquery.c deleted.  Small whitespace fix.

V5: Move UHEADER typedef to resolv/resolv-internal.h.  Replace all
HEADER usage with UHEADER in resolv/res_send.c.

Signed-off-by: John David Anglin 
Reviewed-by: Adhemerval Zanella  

This bug is fixed in debian 2.33 by the patch
any/submitted-resolv-unaligned.diff.  It turns out the following
hunk can be removed:

diff --git a/resolv/res_mkquery.c b/resolv/res_mkquery.c
index 5bc5b41531..9b82c82157 100644
--- a/resolv/res_mkquery.c
+++ b/resolv/res_mkquery.c
@@ -193,6 +193,15 @@ context_mkquery_common (struct resolv_context *ctx,
   return result;
 }
 
+/* The structure HEADER is normally aligned to a word boundary and its
+   fields are accessed using word loads and stores.  We need to access
+   this structure when it is aligned on a byte boundary.  This can cause
+   problems on machines with strict alignment.  So, we create a new
+   typedef to reduce its alignment to one.  This ensures the fields are
+   accessed with byte loads and stores.  */
+typedef HEADER __attribute__ ((__aligned__(1))) UHEADER;
+#define HEADER UHEADER
+
 /* Form all types of queries.  Returns the size of the result or -1 on
error.
 
Regards,
Dave Anglin

-- System Information:
Debian Release: bookworm/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 5.16.16+ (SMP w/4 CPU threads)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libc6 depends on:
ii  libgcc-s4  12-20220319-1

Versions of packages libc6 recommends:
ii  libidn2-0  2.3.2-2

Versions of packages libc6 suggests:
ii  debconf [debconf-2.0]  1.5.79
ii  glibc-doc  2.33-7
ii  libc-l10n  2.33-7
ii  libnss-nis 3.1-4
ii  libnss-nisplus 1.3-4
ii  locales2.33-7

-- debconf information excluded



Bug#1004390: glibc: FTBFS on hppa - incorrect ctid argument in xclone.c

2022-01-26 Thread John David Anglin
Source: glibc
Version: 2.31-13+deb11u2
Severity: normal

Dear Maintainer,

Build fails here:

hppa-linux-gnu-gcc-10 xchmod.c -c -std=gnu11 -fgnu89-inline  -pipe -O2 -g 
-fdebug-prefix-map=/<>=. -Wall -Wwrite-strings -Wundef -Werror 
-fmerge-all-constants -frounding-math -fno-stack-protector -Wstrict-prototypes 
-Wold-style-definition -fmath-errno-fPIC-isystem 
/<>/debian/include  -I../include 
-I/<>/build-tree/hppa-libc/support  
-I/<>/build-tree/hppa-libc  -I../sysdeps/unix/sysv/linux/hppa  
-I../sysdeps/hppa/nptl  -I../sysdeps/unix/sysv/linux/include 
-I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  
-I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  
-I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/hppa/hppa1.1  
-I../sysdeps/wordsize-32  -I../sysdeps/ieee754/flt-32  
-I../sysdeps/ieee754/dbl-64  -I../sysdeps/hppa/fpu  -I../sysdeps/hppa  
-I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I. -nostdinc 
-isystem /usr/lib/gcc/hppa-linux-gnu/10/include -isystem 
/<>/debian/include -D_LIBC_REENTRANT -include 
/<>/build-tree/hppa-libc/libc-modules.h -DMODULE_NAME=libsupport 
-include ../include/libc-symbols.h   -DPIC -DLIBC_NONSHARED=1 
-DTOP_NAMESPACE=glibc -o 
/<>/build-tree/hppa-libc/support/xchmod.oS -MD -MP -MF 
/<>/build-tree/hppa-libc/support/xchmod.oS.dt -MT 
/<>/build-tree/hppa-libc/support/xchmod.oS
xclone.c: In function ‘xclone’:
xclone.c:41:8: error: ‘ctid’ undeclared (first use in this function)
   41 |   &ctid);
  |^~~~
xclone.c:41:8: note: each undeclared identifier is reported only once for each 
function it appears in

I believe this argument should be NULL.

Regards,
Dave Anglin


-- System Information:
Debian Release: bookworm/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 5.16.2+ (SMP w/4 CPU threads)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)


Bug#1002041: glibc: rc

2021-12-20 Thread John David Anglin
Source: glibc
Version: 2.34-0experimental2
Severity: normal

Dear Maintainer,

There are two new regressions in glibc 2.34 that need to be xfailed on
hppa:

+-+
| Encountered regressions that don't match expected failures. |
+-+
FAIL: dirent/tst-readdir64-compat
FAIL: signal/tst-minsigstksz-5
touch /<>/stamp-dir/check_libc
CHECK SUMMARY
check for check_libc failed
make: *** [debian/rules.d/build.mk:187: build-arch-post-check] Error 1
dpkg-buildpackage: error: debian/rules build-arch subprocess returned exit 
status 2


The dirent/tst-readdir64-compat failure is libc/27654.  This is apparently
a test issue.

The signal/tst-minsigstksz-5 failure is a known issue with the signal
trampoline which should be fixed when the kernel implements a vdso:
https://www.spinics.net/lists/linux-parisc/msg15397.html

Regards,
Dave Anglin

-- System Information:
Debian Release: bookworm/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 5.14.21+ (SMP w/4 CPU threads)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)



Bug#993954: glibc: Usually FTBFS on hppa - please xfail nptl/tst-cond24

2021-09-08 Thread John David Anglin
Source: glibc
Version: 2.32
Severity: normal

Dear Maintainer,

The nptl/tst-cond24 test usually fails on multi-way machines.  For now,
it needs to be xfailed like nptl/tst-cond25 in testsuite-xfail-debian.mk.

Thanks,
Dave Anglin

-- System Information:
Debian Release: bookworm/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 5.13.14+ (SMP w/4 CPU threads)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)



Bug#981650: Acknowledgement (libc6-dev: Update flag bit defines in fcntl.h on hppa)

2021-02-19 Thread John David Anglin
Attached is an updated patch.  We also need to update the defines for 
EFD_NONBLOCK,
IN_NONBLOCK, SFD_NONBLOCK and TFD_NONBLOCK.  Glibc master is update.

Regards,
Dave Anglin

-- 
John David Anglin  dave.ang...@bell.net

Index: glibc-2.31/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
===
--- glibc-2.31.orig/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
+++ glibc-2.31/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
@@ -24,14 +24,11 @@
 #define O_EXCL 2000 /* not fcntl */
 #define O_NOCTTY   0040 /* not fcntl */
 #define O_APPEND   0010
-#define O_NONBLOCK 0024 /* HPUX has separate NDELAY & NONBLOCK */
+#define O_NONBLOCK 0020
 #define __O_DSYNC  0100
-#define __O_RSYNC  0200 /* HPUX only */
 #define __O_SYNC   0010
 #define O_SYNC (__O_SYNC|__O_DSYNC)
 
-#define O_BLKSEEK  0100 /* HPUX only */
-
 #define __O_DIRECTORY  1 /* Must be a directory.  */
 #define __O_NOFOLLOW   00200 /* Do not follow links.  */
 #define __O_CLOEXEC01000 /* Set close_on_exec.  */
Index: glibc-2.31/sysdeps/unix/sysv/linux/hppa/bits/eventfd.h
===
--- glibc-2.31.orig/sysdeps/unix/sysv/linux/hppa/bits/eventfd.h
+++ glibc-2.31/sysdeps/unix/sysv/linux/hppa/bits/eventfd.h
@@ -26,6 +26,6 @@ enum
 #define EFD_SEMAPHORE EFD_SEMAPHORE
 EFD_CLOEXEC = 01000,
 #define EFD_CLOEXEC EFD_CLOEXEC
-EFD_NONBLOCK = 0024 /* HPUX has separate NDELAY & NONBLOCK */
+EFD_NONBLOCK = 0020
 #define EFD_NONBLOCK EFD_NONBLOCK
   };
Index: glibc-2.31/sysdeps/unix/sysv/linux/hppa/bits/inotify.h
===
--- glibc-2.31.orig/sysdeps/unix/sysv/linux/hppa/bits/inotify.h
+++ glibc-2.31/sysdeps/unix/sysv/linux/hppa/bits/inotify.h
@@ -24,6 +24,6 @@ enum
   {
 IN_CLOEXEC = 01000,
 #define IN_CLOEXEC IN_CLOEXEC
-IN_NONBLOCK = 00024 /* HPUX has separate NDELAY & NONBLOCK */
+IN_NONBLOCK = 00020
 #define IN_NONBLOCK IN_NONBLOCK
   };
Index: glibc-2.31/sysdeps/unix/sysv/linux/hppa/bits/signalfd.h
===
--- glibc-2.31.orig/sysdeps/unix/sysv/linux/hppa/bits/signalfd.h
+++ glibc-2.31/sysdeps/unix/sysv/linux/hppa/bits/signalfd.h
@@ -24,6 +24,6 @@ enum
   {
 SFD_CLOEXEC = 01000,
 #define SFD_CLOEXEC SFD_CLOEXEC
-SFD_NONBLOCK = 0024 /* HPUX has separate NDELAY & NONBLOCK */
+SFD_NONBLOCK = 0020
 #define SFD_NONBLOCK SFD_NONBLOCK
   };
Index: glibc-2.31/sysdeps/unix/sysv/linux/hppa/bits/timerfd.h
===
--- glibc-2.31.orig/sysdeps/unix/sysv/linux/hppa/bits/timerfd.h
+++ glibc-2.31/sysdeps/unix/sysv/linux/hppa/bits/timerfd.h
@@ -24,6 +24,6 @@ enum
   {
 TFD_CLOEXEC = 01000,
 #define TFD_CLOEXEC TFD_CLOEXEC
-TFD_NONBLOCK = 00024 /* HPUX has separate NDELAY & NONBLOCK */
+TFD_NONBLOCK = 00020
 #define TFD_NONBLOCK TFD_NONBLOCK
   };


Bug#981650: libc6-dev: Update flag bit defines in fcntl.h on hppa

2021-02-02 Thread John David Anglin
Package: libc6-dev
Version: 2.31-9
Severity: normal
Tags: patch

Dear Maintainer,

Several flags in fcntl.h need updating to match the current kernel support
for hppa.  In particular, the define for O_NONBLOCK has changed.  The defines
for __O_RSYNC and O_BLKSEEK are removed.  They are not used in Linux.

These defines are fixed upstream in master.

This caused a build failure for tor package:
util/socket_ipv4: [forking]
  FAIL ../src/test/test_util.c:5432: assert(fd_is_nonblocking(fd2) OP_EQ 1): 0 
vs 1
  [socket_ipv4 FAILED]
util/socket_ipv6: [forking]
  FAIL ../src/test/test_util.c:5432: assert(fd_is_nonblocking(fd2) OP_EQ 1): 0 
vs 1
  [socket_ipv6 FAILED]

Please install.

Regards,
Dave Anglin

-- System Information:
Debian Release: bullseye/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 5.10.12+ (SMP w/4 CPU threads)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages libc6-dev depends on:
ii  libc-dev-bin2.31-9
ii  libc6   2.31-9
ii  libcrypt-dev1:4.4.17-1
ii  libnsl-dev  1.3.0-2
ii  linux-libc-dev  5.10.12-1

libc6-dev recommends no packages.

Versions of packages libc6-dev suggests:
ii  glibc-doc 2.31-9
ii  manpages-dev  5.10-1

-- no debconf information
Index: glibc-2.31/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
===
--- glibc-2.31.orig/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
+++ glibc-2.31/sysdeps/unix/sysv/linux/hppa/bits/fcntl.h
@@ -24,14 +24,11 @@
 #define O_EXCL 2000 /* not fcntl */
 #define O_NOCTTY   0040 /* not fcntl */
 #define O_APPEND   0010
-#define O_NONBLOCK 0024 /* HPUX has separate NDELAY & NONBLOCK */
+#define O_NONBLOCK 0020
 #define __O_DSYNC  0100
-#define __O_RSYNC  0200 /* HPUX only */
 #define __O_SYNC   0010
 #define O_SYNC (__O_SYNC|__O_DSYNC)
 
-#define O_BLKSEEK  0100 /* HPUX only */
-
 #define __O_DIRECTORY  1 /* Must be a directory.  */
 #define __O_NOFOLLOW   00200 /* Do not follow links.  */
 #define __O_CLOEXEC01000 /* Set close_on_exec.  */


Bug#941174: Info received (Bug#941174: Info received (Bug#941174: Acknowledgement (glibc: FTBFS on hppa - new test failures)))

2019-09-26 Thread John David Anglin
This is glibc bug 23296:
https://sourceware.org/bugzilla/show_bug.cgi?id=23296

-- 
John David Anglin  dave.ang...@bell.net



Bug#941174: Info received (Bug#941174: Acknowledgement (glibc: FTBFS on hppa - new test failures))

2019-09-26 Thread John David Anglin
_dl_fixup was called from _dl_runtime_resolve:

(gdb) disass 0xf89e7878-16,0xf89e7878
Dump of assembler code from 0xf89e7868 to 0xf89e7878:
   0xf89e7868 <_dl_runtime_resolve+60>: ldw c(r20),r26
   0xf89e786c <_dl_runtime_resolve+64>: copy r19,r25
   0xf89e7870 <_dl_runtime_resolve+68>: b,l 0xf89e09b8 <_dl_fixup>,rp
   0xf89e7874 <_dl_runtime_resolve+72>: copy r21,r19
End of assembler dump.

-- 
John David Anglin  dave.ang...@bell.net



Bug#941174: Acknowledgement (glibc: FTBFS on hppa - new test failures)

2019-09-25 Thread John David Anglin
The segmentation faults in these tests occur in _dl_fixup().

Sep 25 20:02:39 mx3210 kernel: trap #15: Data TLB miss fault, vm_start = 0x00015
000, vm_end = 0x00016000
Sep 25 20:02:39 mx3210 kernel: CPU: 0 PID: 2908 Comm: ld.so.1 Not tainted 4.14.1
46+ #1
Sep 25 20:02:39 mx3210 kernel: Hardware name: 9000/800/rp3440
Sep 25 20:02:39 mx3210 kernel: task: 000197cda000 task.stack: 0001cdc2c0
00
Sep 25 20:02:39 mx3210 kernel:
Sep 25 20:02:39 mx3210 kernel: YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
Sep 25 20:02:39 mx3210 kernel: PSW: 0100 Not tainted
Sep 25 20:02:39 mx3210 kernel: r00-03  00ff0004ff0f f6a79228 000
0f89e787b f7279698
Sep 25 20:02:39 mx3210 kernel: r04-07  f83f82e4 f6a79000 000
1f069893c f6a79290
Sep 25 20:02:39 mx3210 kernel: r08-11  f72794e8 f869b004 000
0f72796b4 f8d024d0
Sep 25 20:02:39 mx3210 kernel: r12-15  f72796a8  000
0 f869d82c
Sep 25 20:02:39 mx3210 kernel: r16-19   f869d828 000
0f7279480 f89f815c
Sep 25 20:02:39 mx3210 kernel: r20-23  f83f4f50 f83f4f80 000
0f82a0658 
Sep 25 20:02:39 mx3210 kernel: r24-27   f83f82e4 000
0f8cff6b0 00015000
Sep 25 20:02:39 mx3210 kernel: r28-31  0034 f7279698 000
0f6a79300 f8684e6f
Sep 25 20:02:39 mx3210 kernel: sr00-03  0dee5000  00
00 0dee5000
Sep 25 20:02:39 mx3210 kernel: sr04-07  0dee5000 0dee5000 00
000dee5000 0dee5000
Sep 25 20:02:39 mx3210 kernel:
Sep 25 20:02:39 mx3210 kernel:  VZOUICununcqcqcqcqcqcrmunTDVZOUI
Sep 25 20:02:39 mx3210 kernel: FPSR: 
Sep 25 20:02:39 mx3210 kernel: FPER1: 
Sep 25 20:02:39 mx3210 kernel: fr00-03    00
00 
Sep 25 20:02:39 mx3210 kernel: fr04-07  0003 4008 00
00 4090
Sep 25 20:02:39 mx3210 kernel: fr08-11    
 
Sep 25 20:02:39 mx3210 kernel: fr12-15    
 
Sep 25 20:02:39 mx3210 kernel: fr16-19    
 
Sep 25 20:02:39 mx3210 kernel: fr20-23    
0088 0037
Sep 25 20:02:39 mx3210 kernel: fr24-27  41d442209dc0 8dd8e63ce5a92bce 
e12c4247803777cd 63a440f29eda3092
Sep 25 20:02:39 mx3210 kernel: fr28-31  2deb33a075f5d1c1 6b17d1f2508fe882 
d898c296 
Sep 25 20:02:39 mx3210 kernel:
Sep 25 20:02:39 mx3210 kernel: IASQ: 0dee5000 0dee5000 IAOQ: 
f89e09ef f89e09f3
Sep 25 20:02:39 mx3210 kernel: IIR: 0ed90085    ISR: 0dee5000  IOR: 
f069893c
Sep 25 20:02:39 mx3210 kernel: CPU:    0   CR30: 0001cdc2c000 CR31: 
efff
Sep 25 20:02:39 mx3210 kernel: ORIG_R28: 
Sep 25 20:02:39 mx3210 kernel: IAOQ[0]: f89e09ef
Sep 25 20:02:39 mx3210 kernel: IAOQ[1]: f89e09f3
Sep 25 20:02:39 mx3210 kernel: RP(r2): f89e787b

Dump of assembler code for function _dl_fixup:
   0xf89e09b8 <+0>: stw rp,-14(sp)
   0xf89e09bc <+4>: ldo 80(sp),sp
   0xf89e09c0 <+8>: stw r7,-6c(sp)
   0xf89e09c4 <+12>:    ldo -70(sp),r7
   0xf89e09c8 <+16>:    stw r6,-68(sp)
   0xf89e09cc <+20>:    stw r5,-64(sp)
   0xf89e09d0 <+24>:    stw r4,-60(sp)
   0xf89e09d4 <+28>:    stw r3,-5c(sp)
   0xf89e09d8 <+32>:    stw r19,-20(sp)
   0xf89e09dc <+36>:    ldw 7c(r26),r21
   0xf89e09e0 <+40>:    ldw 4(r21),r22
   0xf89e09e4 <+44>:    ldw 38(r26),r20
   0xf89e09e8 <+48>:    add,l r25,r22,r6
  =>  0xf89e09ec <+52>:    ldw r25(r22),r5
   0xf89e09f0 <+56>:    ldw 4(r6),r21
   0xf89e09f4 <+60>:    extrw,u r21,23,24,r31
   0xf89e09f8 <+64>:    depw,z r31,27,28,ret1
   0xf89e09fc <+68>:    ldw 34(r26),r22


-- 
John David Anglin  dave.ang...@bell.net



Bug#941174: glibc: FTBFS on hppa - new test failures

2019-09-25 Thread John David Anglin
Source: glibc
Version: 2.29-2
Severity: normal

Dear Maintainer,

Since version 2.29-2, glibc fails to build on hppa.  We have the following
test fails:

+-+
| Encountered regressions that don't match expected failures. |
+-+
FAIL: nptl/tst-cond21
FAIL: nptl/tst-rwlock19
FAIL: nptl/tst-stackguard1
FAIL: nptl/tst-tls1
FAIL: stdio-common/tst-vfprintf-user-type

These fails are not fully consistent from build to build.  2.29-1 built
successfully.

I did a build outside the buildd and all these tests passed.  One test
failed:

+-+
| Encountered regressions that don't match expected failures. |
+-+
FAIL: elf/tst-pldd

dave@mx3210:~/debian/glibc/glibc-2.29$ cat 
./build-tree/hppa-libc/elf/tst-pldd.out
error: xposix_spawn.c:30: posix_spawn to /usr/bin/pldd file failed: No such 
file or directory
error: 1 test failures

It seems like pldd got installed in the wrong place:
mv -f /home/dave/debian/glibc/glibc-2.29/debian/tmp-libc/usr/bin/pldd.new 
/home/dave/debian/glibc/glibc-2.29/debian/tmp-libc/usr/bin/pldd

Regards,
Dave Anglin

-- System Information:
Debian Release: bullseye/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 4.14.146+ (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)



Bug#915676: glibc: FTBFS on hppa - Please xfail some new tests

2018-12-05 Thread John David Anglin
Source: glibc
Version: 2.28-1
Severity: normal
Tags: patch

Dear Maintainer,

Some new tests fail on hppa.  See for example:
https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=hppa&ver=2.28-1&stamp=1543515737&raw=0

The attached change allows the build to complete.

Regards,
Dave Anglin

-- System Information:
Debian Release: buster/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 4.14.85+ (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE=C (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
--- testsuite-xfail-debian.mk.save  2018-12-02 18:52:26.068360032 -0500
+++ testsuite-xfail-debian.mk   2018-12-02 18:55:19.708996325 -0500
@@ -229,9 +229,12 @@
 test-xfail-tst-backtrace6 = yes
 test-xfail-tst-cleanupx4 = yes
 test-xfail-tst-makecontext = yes
+test-xfail-tst-preadvwritev2 = yes
+test-xfail-tst-preadvwritev64v2 = yes
 test-xfail-tst-protected1a = yes
 test-xfail-tst-protected1b = yes
 test-xfail-tst-setcontext2 = yes
+test-xfail-tst-setcontext7 = yes
 test-xfail-tst-stack4 = yes
 # The following tests sometimes fail due to timeouts.
 test-xfail-tst-barrier5 = yes


Bug#904056: glibc: FTBFS on hppa - nptl/tst-execstack fails

2018-07-18 Thread John David Anglin
Source: glibc
Version: 2.27-5
Severity: normal
Tags: patch

Dear Maintainer,

As on mips, hppa still requires an executable stack for syscall restarts
and signal returns.  This is BZ #23174.

2.27-5 fails to build because of the following problem:

+-+
| Encountered regressions that don't match expected failures. |
+-+
FAIL: nptl/tst-execstack
make: *** [debian/rules.d/build.mk:115: /<>/stamp-dir/check_libc] 
Error 1

Full log is here:
https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=hppa&ver=2.27-5&stamp=1531930990&raw=0

The attached fix is installed on glibc trunk.

Regards,
Dave Anglin

-- System Information:
Debian Release: buster/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 4.14.56+ (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968), LANGUAGE=C 
(charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
2018-06-10  John David Anglin  

[BZ #23174]
* sysdeps/unix/sysv/linux/hppa/Makefile: xfail check-execstack.

diff --git a/sysdeps/unix/sysv/linux/hppa/Makefile 
b/sysdeps/unix/sysv/linux/hppa/Makefile
index 68569013fb..e1637f54f5 100644
--- a/sysdeps/unix/sysv/linux/hppa/Makefile
+++ b/sysdeps/unix/sysv/linux/hppa/Makefile
@@ -2,3 +2,10 @@
 ifeq ($(subdir),stdlib)
 gen-as-const-headers += ucontext_i.sym
 endif
+
+# Supporting non-executable stacks on HPPA requires changes to both
+# the Linux kernel and glibc. The kernel currently needs an executable
+# stack for syscall restarts and signal returns.
+ifeq ($(subdir),elf)
+test-xfail-check-execstack = yes
+endif


Bug#882874: glibc 2.25 FTBFS on ia64

2017-11-28 Thread John David Anglin

On 2017-11-28 9:47 AM, James Clarke wrote:

[Cc'ing hppa people for reasons which will become clear]

On Tue, Nov 28, 2017 at 08:22:56AM -0500, Jason Duerstock wrote:

Source: glibc
Followup-For: Bug #882874

This patch appears to correct the problem.

-- System Information:
Debian Release: buster/sid
Architecture: ia64

Kernel: Linux 3.2.0-4-mckinley (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
--- sysdeps/ia64/dl-machine.h
+++ sysdeps/ia64/dl-machine.h
@@ -45,7 +45,8 @@
  }

  #define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info)   \
-   __ia64_init_bootstrap_fdesc_table (&bootstrap_map);
+   __ia64_init_bootstrap_fdesc_table (&bootstrap_map); \
+   _dl_fptr_init();

  /* Return nonzero iff ELF header is compatible with the running host.  */
  static inline int __attribute__ ((unused))

As discussed on IRC with Jason, here are my findings for what on earth
is going on here.

This change is required due to the any/local-dlfptr.diff patch in
Debian, which modifies elf/dl-fptr.c to introduce a _dl_fptr_init to
assign local.root to &local.boot_table, with hppa calling this function
early before it might have to process any relocations needing function
pointers. Now, ignoring one important fact, this is needed on hppa for a
very specific reason: it doesn't have special relative relocation types,
instead reusing R_PARISC_DIR32 and others with symbol index 0, and
doesn't set DT_RELACOUNT in its dynamic section (I assume because
nobody bothered to implement it for bfd), so ld.so cannot perform any
early relative relocations, despite having an implementation for
elf_machine_rela_relative in sysdeps/hppa/dl-machine.h. This means that,
depending on whether any function pointer-needing relocations appear
before the R_hppa_DIR32 for local.root, local.root may not have been
relocated, and thus cannot be used. Instead, the assignment is done
manually in _dl_fptr_init using ELF_MACHINE_LOAD_ADDRESS to do this
without needing any dynamic relocations to have been applied.

However, hppa, at least currently, has its own sysdeps/hppa/dl-fptr.c,
and does not compile elf/dl-fptr.c. This platform-specific dl-fptr.c
also has the same workaround in it, so at least in the context of hppa,
I don't see why this patch is needed any more (perhaps at one point
elf/dl-fptr.c was being used for hppa on Debian, but it isn't now).

Now, the only architecture actually using elf/dl-fptr.c currently is
ia64. This patch therefore presents a problem, as its
ELF_MACHINE_BEFORE_RTLD_RELOC does not call _dl_fptr_init (as pointed
out by Jason's patch above). Thus, applying Jason's patch does in fact
fix the issue on ia64. However, on ia64, there are specific relative
relocations, and DT_RELACOUNT *does* get set to something sensible, so
local.root gets relocated early, and this is why upstream glibc has not
seen an issue with elf/dl-fptr.c on ia64. Therefore, this patch is
*also* not needed on ia64 (albeit for different reasons), and so my
suggested fix would be instead to simply drop this local patch, as its
sole effect is to break ia64.

Thoughts (especially from hppa people)?


I'm not sure about calling  _dl_fptr_init.  I recall there were issues 
with backtraces

on hppa and some backtrace tests fail on hppa.

From your comments, it may be possible to switch hppa to elf/dl-fptr.c.

First, hppa does have special relative relocations.  For example, we have:

#define ELF_MACHINE_LOAD_ADDRESS(var, symbol) \
  asm ( \
"   b,l 1f,%0\n"    \
"   depi    0,31,2,%0\n"    \
"1: addil   L'" #symbol " - ($PIC_pcrel$0 - 8),%0\n"    \
"   ldo R'" #symbol " - ($PIC_pcrel$0 - 12)(%%r1),%0\n" \
   : "=&r" (var) : : "r1");

I have learned recently that the depi instruction isn't needed.  The 
above can become:


#define ELF_MACHINE_LOAD_ADDRESS(var, symbol) \
  asm ( \
"   b,l 1f,%0\n"    \
"       addil   L'" #symbol " - ($PIC_pcrel$0 - 1),%0\n"    \
"1:   ldo  R'" #symbol " - ($PIC_pcrel$0 - 5)(%%r1),%0\n" \
   : "=&r" (var) : : "r1");

The offsets are adjusted to account for the priority level bits in the 
program counter.


The use of pc-relative relocation is something I added fairly recently.

Second, Alan Modra recently fixed the relocation handling for R_PARISC_DIR32
so that it now works in dynamic applications.

Dave

--
John David Anglin  dave.ang...@bell.net



Bug#882152: glibc: FTBFS on hppa - nptl/tst-create-detached fails due to timeout

2017-11-19 Thread John David Anglin
Source: glibc
Version: 2.25-1
Severity: normal

Dear Maintainer,

The nptl/tst-create-detached test fails on hppa with a TIMEOUTFACTOR of
25.  Either the timeout value for the test needs to be increased from 100
to about 500, or the test needs to be xfailed.  I think we need about a
factor 4 or 5 increase for the slower buildd machines.

Full log is here:
https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=hppa&ver=2.25-1&stamp=1511033278&raw=0

Regards,
Dave

-- System Information:
Debian Release: buster/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 4.13.14+ (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to en_US.utf8), 
LANGUAGE=C (charmap=UTF-8) (ignored: LC_ALL set to en_US.utf8)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect



Bug#858738: libc6: [PATCH] Fix crash in __longjmp on hppa architecture (BZ #21049)

2017-03-25 Thread John David Anglin
Package: libc6
Version: 2.24-9
Severity: normal

Dear Maintainer,

The build of libsigsegv on hppa fails due failing configuration tests:
checking whether a signal handler can be left through longjmp... no
checking whether a signal handler can be left through longjmp and 
sigaltstack... no
checking whether a signal handler can be left through longjmp and setcontext... 
no
checking whether a signal handler can be left through siglongjmp... no
checking whether a signal handler can be left through siglongjmp and 
sigaltstack... no
checking whether a signal handler can be left through siglongjmp and 
setcontext... no

This results in the expected symbols being incorrect:
--- debian/libsigsegv2.symbols (libsigsegv2_2.10-5_hppa)
+++ dpkg-gensymbolsZE40Az   2017-03-19 06:09:43.426334880 +
@@ -7,7 +7,7 @@
  sigsegv_install_handler@Base 2.9
  sigsegv_leave_handler@Base 2.9
  sigsegv_register@Base 2.9
- (arch=!hurd-i386)sigsegv_reset_onstack_flag@Base 2.9
+#MISSING: 2.10-5# (arch=!hurd-i386)sigsegv_reset_onstack_flag@Base 2.9

The problem is longjmp is broken when -D_FORTIFY_SOURCE=2 is used during
compilation.  The bug is BZ #21049 and a fix was posted here by Helge:
https://sourceware.org/ml/libc-alpha/2017-01/msg00310.html

Regards,
Dave Anglin

-- System Information:
Debian Release: 9.0
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 4.10.5+ (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to en_US.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages libc6 depends on:
ii  libgcc4  1:6.3.0-10

libc6 recommends no packages.

Versions of packages libc6 suggests:
ii  debconf [debconf-2.0]  1.5.60
ii  glibc-doc  2.24-9
ii  libc-l10n  2.24-9
ii  locales2.24-9

-- debconf information excluded



Bug#838574: glibc: FTBFS on hppa - nptl/tst-stack4 fails

2016-09-22 Thread John David Anglin
Source: glibc
Version: 2.24-3
Severity: normal
Tags: patch

Dear Maintainer,

In the previous change which fixed various cancellation tests on hppa, I
removed nptl/tst-stack4 from the expected fail list.  Probably, it should
be added back to the xfail list.  However, with the attached change, the
test does not fail on my test system.  It optimizes the atomic compare
and exchange code on hppa to avoid conditional branches.

The patch has been submitted upstream:
https://sourceware.org/ml/libc-alpha/2016-09/msg00456.html

Regards,
Dave Anglin

-- System Information:
Debian Release: stretch/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 4.7.4+ (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to en_US.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
2016-09-22  John David Anglin  

	* sysdeps/unix/sysv/linux/hppa/atomic-machine.h: Don't include
	abort-instr.h.
	(EFAULT): Remove conditional define.
	(ENOSYS): Likewise.
	(atomic_compare_and_exchange_val_acq): Use instruction nullification
	instead of conditional branch instructions.

Index: glibc-2.23/sysdeps/unix/sysv/linux/hppa/atomic-machine.h
===
--- glibc-2.23.orig/sysdeps/unix/sysv/linux/hppa/atomic-machine.h
+++ glibc-2.23/sysdeps/unix/sysv/linux/hppa/atomic-machine.h
@@ -17,13 +17,6 @@
<http://www.gnu.org/licenses/>.  */
 
 #include  /*  Required for type definitions e.g. uint8_t.  */
-#include  /*  Required for ABORT_INSTRUCTIUON.  */
-
-/* We need EFAULT, ENONSYS */
-#if !defined EFAULT && !defined ENOSYS
-#define EFAULT	14
-#define ENOSYS	251
-#endif
 
 #ifndef _ATOMIC_MACHINE_H
 #define _ATOMIC_MACHINE_H	1
@@ -62,7 +55,7 @@ typedef uintmax_t uatomic_max_t;
 #define _ASM_EDEADLOCK "-45"
 
 /* The only basic operation needed is compare and exchange.  The mem
-   pointer must be word aligned.  */
+   pointer must be word aligned.  We no longer loop on deadlock.  */
 #define atomic_compare_and_exchange_val_acq(mem, newval, oldval)	\
   ({	\
  register long lws_errno asm("r21");\
@@ -74,20 +67,15 @@ typedef uintmax_t uatomic_max_t;
 	"0:	\n\t"			\
 	"ble	" _LWS "(%%sr2, %%r0)		\n\t"			\
 	"ldi	" _LWS_CAS ", %%r20		\n\t"			\
-	"ldi	" _ASM_EAGAIN ", %%r20		\n\t"			\
-	"cmpb,=,n %%r20, %%r21, 0b		\n\t"			\
-	"nop	\n\t"			\
-	"ldi	" _ASM_EDEADLOCK ", %%r20	\n\t"			\
-	"cmpb,=,n %%r20, %%r21, 0b		\n\t"			\
-	"nop	\n\t"			\
+	"cmpiclr,<> " _ASM_EAGAIN ", %%r21, %%r0\n\t"			\
+	"b,n 0b	\n\t"			\
+	"cmpclr,= %%r0, %%r21, %%r0		\n\t"			\
+	"iitlbp %%r0,(%%sr0, %%r0)		\n\t"			\
 	: "=r" (lws_ret), "=r" (lws_errno)\
 	: "r" (lws_mem), "r" (lws_old), "r" (lws_new)			\
 	: _LWS_CLOBBER			\
  );	\
 	\
- if (lws_errno == -EFAULT || lws_errno == -ENOSYS)			\
-	ABORT_INSTRUCTION;		\
-	\
  (__typeof (oldval)) lws_ret;	\
})
 


Bug#837518: glibc: FTBFS on hppa - new syscall cancellation test failures

2016-09-11 Thread John David Anglin
Source: glibc
Version: 2.24-2
Severity: normal
Tags: patch

Dear Maintainer,

As noted in previous mail, glibc fails to build due to the following test
failures:

FAIL: nptl/tst-cancel-self
FAIL: nptl/tst-cancel-self-cancelstate
FAIL: nptl/tst-cancel12
FAIL: nptl/tst-cancel14
FAIL: nptl/tst-cancelx12
FAIL: nptl/tst-cancelx14

See full log here:
https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=hppa&ver=2.24-2&stamp=1472961842

Build with patch is here:
https://sourceware.org/ml/libc-alpha/2016-09/msg00193.html

The attached patch fixes these failures and some others which are xfailed.
It has been submitted upstream:
https://sourceware.org/ml/libc-alpha/2016-09/msg00193.html

I have also attached a patch which updates the hppa tests that need to be
xfailed.

Please add these changes.

Thanks,
Dave

-- System Information:
Debian Release: stretch/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 4.7.3+ (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to en_US.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h b/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h
index cafc752..f239408 100644
--- a/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h
@@ -62,12 +62,11 @@
 	ENTRY (__##syscall_name##_nocancel)\
 	DOARGS_##args	ASM_LINE_SEP	\
 	stwm TREG, 64(%sp)ASM_LINE_SEP	\
+	.cfi_def_cfa_offset -64ASM_LINE_SEP	\
 	.cfi_offset TREG, 0ASM_LINE_SEP	\
-	.cfi_adjust_cfa_offset 64			ASM_LINE_SEP	\
 	stw %sp, -4(%sp)ASM_LINE_SEP	\
-	.cfi_offset 30, -4ASM_LINE_SEP	\
 	stw %r19, -32(%sp)ASM_LINE_SEP	\
-	.cfi_offset 19, -32ASM_LINE_SEP	\
+	.cfi_offset 19, 32ASM_LINE_SEP	\
 	/* Save r19 */	ASM_LINE_SEP	\
 	SAVE_PIC(TREG)	ASM_LINE_SEP	\
 	/* Do syscall, delay loads # */			ASM_LINE_SEP	\
@@ -91,21 +90,19 @@ L(pre_nc_end):		ASM_LINE_SEP	\
 	/* No need to LOAD_PIC */			ASM_LINE_SEP	\
 	/* Undo frame */ASM_LINE_SEP	\
 	ldwm -64(%sp),TREGASM_LINE_SEP	\
-	.cfi_adjust_cfa_offset -64			ASM_LINE_SEP	\
 	/* Restore rp before exit */			ASM_LINE_SEP	\
 	ldw -20(%sp), %rpASM_LINE_SEP	\
-	.cfi_restore 2	ASM_LINE_SEP	\
 	ret		ASM_LINE_SEP	\
 	END(__##syscall_name##_nocancel)		ASM_LINE_SEP	\
 	/**/ASM_LINE_SEP	\
 	ENTRY (name)			\
 	DOARGS_##args	ASM_LINE_SEP	\
 	stwm TREG, 64(%sp)ASM_LINE_SEP	\
-	.cfi_adjust_cfa_offset 64			ASM_LINE_SEP	\
+	.cfi_def_cfa_offset -64ASM_LINE_SEP	\
+	.cfi_offset TREG, 0ASM_LINE_SEP	\
 	stw %sp, -4(%sp)ASM_LINE_SEP	\
-	.cfi_offset 30, -4ASM_LINE_SEP	\
 	stw %r19, -32(%sp)ASM_LINE_SEP	\
-	.cfi_offset 19, -32ASM_LINE_SEP	\
+	.cfi_offset 19, 32ASM_LINE_SEP	\
 	/* Done setting up frame, continue... */	ASM_LINE_SEP	\
 	SINGLE_THREAD_P	ASM_LINE_SEP	\
 	cmpib,<>,n 0,%ret0,L(pseudo_cancel)		ASM_LINE_SEP	\
@@ -168,40 +165,32 @@ L(pre_end):		ASM_LINE_SEP	\
 	/* No need to LOAD_PIC */			ASM_LINE_SEP	\
 	/* Undo frame */ASM_LINE_SEP	\
 	ldwm -64(%sp),TREGASM_LINE_SEP	\
-	.cfi_adjust_cfa_offset -64			ASM_LINE_SEP	\
 	/* Restore rp before exit */			ASM_LINE_SEP	\
-	ldw -20(%sp), %rpASM_LINE_SEP	\
-	.cfi_restore 2	ASM_LINE_SEP
+	ldw -20(%sp), %rpASM_LINE_SEP
 
 /* Save arguments into our frame */
 # define PUSHARGS_0	/* nothing to do */
 # define PUSHARGS_1	PUSHARGS_0 stw %r26, -36(%sr0,%sp)	ASM_LINE_SEP	\
-			.cfi_offset 26, -36			ASM_LINE_SEP
+			.cfi_offset 26, 28			ASM_LINE_SEP
 # define PUSHARGS_2	PUSHARGS_1 stw %r25, -40(%sr0,%sp)	ASM_LINE_SEP	\
-			.cfi_offset 25, -40			ASM_LINE_SEP
+			.cfi_offset 25, 24			ASM_LINE_SEP
 # define PUSHARGS_3	PUSHARGS_2 stw %r24, -44(%sr0,%sp)	ASM_LINE_SEP	\
-			.cfi_offset 24, -44			ASM_LINE_SEP
+			.cfi_offset 24, 20			ASM_LINE_SEP
 # define PUSHARGS_4	PUSHARGS_3 stw %r23, -48(%sr0,%sp)	ASM_LINE_SEP	\
-			.cfi_offset 23, -48			ASM_LINE_SEP
+			.cfi_offset 23, 16			ASM_LINE_SEP
 # define PUSHARGS_5	PUSHARGS_4 stw %r22, -52(%sr0,%sp)	ASM_LINE_SEP	\
-			.cfi_offset 22, -52			ASM_LINE_SEP
+			.cfi_offset 22, 12			ASM_LINE_SEP
 # define PUSHARGS_6	PUSHARGS_5 stw %r21, -56(%sr0,%sp)	ASM_LINE_SEP	\
-			.cfi_offset 21, -56			ASM_LINE_SEP
+			.cfi_offset 21, 8			ASM_LINE_SEP
 
 /* Bring them back from the stack */
 # define POPARGS_0	/* nothing to do */
-# define POPARGS_1	POPARGS_0 ldw -36(%sr0,%sp), %r26	ASM_LINE_SEP	\
-			.cfi_restore 26ASM_LINE_SEP
-# define POPARGS_2	POPARGS_1 ldw -40(%sr0,%sp), %r25	ASM_LINE_SEP	\
-			.cfi_restore 25ASM_LINE_SEP
-# define POPARGS_3	POPARGS_2 ldw -44(%sr0,%sp), %r24	ASM_LINE_SEP	\
-			.cfi_restore 24ASM_LINE_SEP
-# define POPARGS_4	POPARGS_3 ldw -48(%sr0,%sp), %r23	ASM_LINE_SEP	\
-			.cfi_restore 23ASM_LINE_SEP
-# define POPARGS_5	POPARGS_4 ldw -52(%sr0,%sp), %r22	ASM_LINE_SEP	\
-			.cfi_restore 22ASM_LINE_SEP
-

[PATCH] hppa: Fix syscall cancellation

2016-09-11 Thread John David Anglin
The attached patch fixes syscall cancellation on hppa and the 2.24 regressions 
mentioned by Aurelien below.

The problem was the forced unwind crashed in the syscall routine due to 
incorrect CFI offsets.  The big problem
was the stack offset was recorded as 64 after the stack pointer was bumped by 
64.  The new CFA offset should have
been -64.  Some register save offsets were also wrong and didn't reflect their 
correct position in the frame.

I removed the cfi directives that previously recorded PIC register saves and 
restores, and the epilogue directives
as these aren't needed by the unwinder.

A test build is here:
https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=hppa&ver=2.24-2%2Bb1&stamp=1473631746

As can be seen, the cancellation tests now all pass.

Please install if okay.

Thanks,
Dave Anglin

PS: The nptl/tst-default-attr, rt/tst-timer4 and rt/tst-timer5 fails were 
addressed in a separate patch.

On 2016-08-05, at 6:23 PM, Aurelien Jarno wrote:

> Dear HPPA porters,
> 
> We would like to push glibc 2.24 currently in experimental into sid in
> the next weeks. It is going to be the version we ship in Stretch.
> 
> I have looked at the testsuite results from the latest uploads, there
> are 9 real regressions (ie not new tests) mostly related to NPTL:
> 
> * FAIL: nptl/tst-default-attr
>original exit status 22
>stacksize test
>guardsize test
>sched test
>tst-default-attr.c:101: pthread_create returned 22 (errno = 22)
>tst-default-attr.c:371: do_sched_test returned 22 (errno = 22)
> 
> The test hasn't changed recently.
> 
> 
> * FAIL: rt/tst-timer4
>original exit status 1
>clock_gettime returned timespec = { 1469505650, 981046459 }
>clock_getres returned timespec = { 0, 400 }
>Timed out: killed the child process
> 
> * FAIL: rt/tst-timer5
>original exit status 1
>clock_gettime returned timespec = { 1665713, 650390357 }
>clock_getres returned timespec = { 0, 400 }
>Timed out: killed the child process
> 
> The above two seems related.
> 
> 
> * FAIL: nptl/tst-cancel-self
>original exit status 1
>Didn't expect signal from child: got `Segmentation fault'
> 
> * FAIL: nptl/tst-cancel-self-cancelstate
>original exit status 1
>Didn't expect signal from child: got `Segmentation fault'
> 
> * FAIL: nptl/tst-cancel12
>original exit status 1
>Didn't expect signal from child: got `Segmentation fault'
> 
> * FAIL: nptl/tst-cancel14
>original exit status 1
>Didn't expect signal from child: got `Segmentation fault'
> 
> * FAIL: nptl/tst-cancelx12
>original exit status 1
>Didn't expect signal from child: got `Segmentation fault'
> 
> * FAIL: nptl/tst-cancelx14
>original exit status 1
>Didn't expect signal from child: got `Segmentation fault'
> 
> The above 6 failures appeared when switching from GCC 5 to GCC 6 and
> looks like quite worrisome.
> 
> 
> Given that GCC 5 is going to be removed soon, we have to build the GNU
> libc with GCC 6. Could you please have a look at the issues?
> 
> Thanks,
> Aurelien
> 
> -- 
> Aurelien Jarno  GPG: 4096R/1DDD8C9B
> aurel...@aurel32.net http://www.aurel32.net
> 
> 

--
John David Anglin   dave.ang...@bell.net


2016-09-11  John David Anglin  

* sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h (PSEUDO): Fix CFA offset.
Use .cfi_def_cfa_offset instead of .cfi_offset.  Don't record stack
pointer offset.  Correct PIC register offset.  Don't mention frame
related instructions in epilogue.
(PUSHARGS_1): Correct offset.
(PUSHARGS_2): Likewise.
(PUSHARGS_3): Likewise.
(PUSHARGS_4): Likewise.
(PUSHARGS_5): Likewise.
(PUSHARGS_6): Likewise.
(POPARGS_1): Don't mention register restore.
(POPARGS_2): Likewise.
(POPARGS_3): Likewise.
(POPARGS_4): Likewise.
(POPARGS_5): Likewise.
(POPARGS_6): Likewise.
* sysdeps/unix/sysv/linux/hppa/sysdep.h (SAVE_PIC): Don't mention
copy of PIC register.
(LOAD_PIC): Likewise don't mention restore.
(DO_CALL): Fix CFA offset.  Use .cfi_def_cfa_offset instead of
.cfi_offset.  Don't record stack pointer offset.  Correct PIC register
offset.  Don't mention frame related instructions in epilogue.

diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h 
b/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h
index cafc752..f239408 100644
--- a/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h
+++ b/sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h
@@ -62,12 +62,11 @@
ENTRY (__##sysc

Bug#835414: glibc: hppa/submitted-setcontext.diff patch is not applied to source

2016-08-25 Thread John David Anglin
Source: glibc
Version: 2.23-5
Severity: normal

Dear Maintainer,

Noticed that tst-setcontext2 fails.  This was fixed by the
hppa/submitted-setcontext.diff patch which is present but not
applied to source.

All other hppa changes are applied:
dpkg-source: info: applying hppa/local-inlining.diff
dpkg-source: info: applying hppa/local-stack-grows-up.diff
dpkg-source: info: applying hppa/local-elf-make-cflags.diff
dpkg-source: info: applying hppa/local-shmlba.diff
dpkg-source: info: applying hppa/local-fptr-table-size.diff
dpkg-source: info: applying hppa/submitted-gmon-start.diff
dpkg-source: info: applying hppa/submitted-dladdr.diff
dpkg-source: info: applying hppa/submitted-libm-test-ulps.diff

Regards.
Dave

-- System Information:
Debian Release: stretch/sid
  APT prefers buildd-unstable
  APT policy: (500, 'buildd-unstable'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 4.7.2+ (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=UTF-8) (ignored: LC_ALL set to en_US.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)



Re: glibc 2.24 testsuite issues on hppa

2016-08-09 Thread John David Anglin
Hi Aurelien,

On 2016-08-08, at 5:58 AM, Aurelien Jarno wrote:

> On 2016-08-08 11:50, Aurelien Jarno wrote:
>> On 2016-08-07 19:54, John David Anglin wrote:
>>> On 2016-08-05, at 6:23 PM, Aurelien Jarno wrote:
>>> 
>>>> I have looked at the testsuite results from the latest uploads, there
>>>> are 9 real regressions (ie not new tests) mostly related to NPTL:
>>>> 
>>>> * FAIL: nptl/tst-default-attr
>>>>   original exit status 22
>>>>   stacksize test
>>>>   guardsize test
>>>>   sched test
>>>>   tst-default-attr.c:101: pthread_create returned 22 (errno = 22)
>>>>   tst-default-attr.c:371: do_sched_test returned 22 (errno = 22)
>>> 
>>> This was probably introduced by the following change:
>>> 
>>> 2016-02-19  Carlos O'Donell  
>>> 
>>>* nptl/allocatestack.c (allocate_stack): Declare new stackaddr,
>>>assign attr->stackaddr to it, and adjust it down when
>>>_STACK_GROWS_UP.  Change all attr->stackaddr to stackaddr.
>>>[_STACK_GROWS_UP]: Delete assert.
>>>* nptl/pthread_create.c (START_THREAD_DEFN) [!_STACK_GROWS_DOWN]:
>>>Implement stack grows up logic.
>>>* nptl/pthread_getattr_np.c (pthread_getattr_np): Implement
>>>stack grows up logic.
>>> 
>>> I presume that the stack grows up patch that we had before was removed.  We 
>>> are getting a mprotect error in test:
>> 
>> Indeed that is correct. We have removed it in favor of the upstream
>> version.
>> 
>>> [pid 21422] mprotect(0xfce4a480, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = -1 
>>> EINVAL (Invalid argument)
>>> 
>>> It looks like the error comes from here in allocatestack.c:
>>> 
>>> #elif _STACK_GROWS_UP
>>>  if (mprotect ((char *) pd - pd->guardsize,
>>>pd->guardsize - guardsize, prot) != 0)
>>>goto mprot_error;
>>> #endif
>> 
>> Looking more in details, there are small differences in the two
>> implementations, but the only one that changes the behaviour is due to
>> this missing hunk in the upstream version:
>> 
>> --- a/nptl/allocatestack.c
>> +++ b/nptl/allocatestack.c
>> @@ -683,9 +692,13 @@
>>  prot) != 0)
>>  goto mprot_error;
>> #elif _STACK_GROWS_UP
>> -  if (mprotect ((char *) pd - pd->guardsize,
>> -pd->guardsize - guardsize, prot) != 0)
>> -goto mprot_error;
>> +  char *new_guard = (char *) (((uintptr_t) pd - guardsize) & 
>> ~pagesize_m1);
>> +  char *old_guard = (char *) (((uintptr_t) pd - pd->guardsize) & 
>> ~pagesize_m1);
>> +  /* The guard size difference might be > 0, but once rounded
>> + to the nearest page the size difference might be zero.  */
>> +  if (old_guard - new_guard > 0)
>> +if (mprotect (old_guard, new_guard - old_guard, prot) != 0)
>> +  goto mprot_error;
>> #endif
>> 
>>pd->guardsize = guardsize;
>> 
>> It therefore looks like this should also be upstreamed. We can add it
>> back in the debian version in the meantime.
> 
> I have just committed it for now it will be in the next upload.


Based on my testing, this fixes tst-default-attr and the two timer tests.

Dave
--
John David Anglin   dave.ang...@bell.net





Re: glibc 2.24 testsuite issues on hppa

2016-08-08 Thread John David Anglin
On 2016-08-08, at 5:50 AM, Aurelien Jarno wrote:

> Looking more in details, there are small differences in the two
> implementations, but the only one that changes the behaviour is due to
> this missing hunk in the upstream version:
> 
> --- a/nptl/allocatestack.c
> +++ b/nptl/allocatestack.c
> @@ -683,9 +692,13 @@
>   prot) != 0)
>   goto mprot_error;
> #elif _STACK_GROWS_UP
> -   if (mprotect ((char *) pd - pd->guardsize,
> - pd->guardsize - guardsize, prot) != 0)
> - goto mprot_error;
> +   char *new_guard = (char *) (((uintptr_t) pd - guardsize) & 
> ~pagesize_m1);
> +   char *old_guard = (char *) (((uintptr_t) pd - pd->guardsize) & 
> ~pagesize_m1);
> +   /* The guard size difference might be > 0, but once rounded
> +  to the nearest page the size difference might be zero.  */
> +   if (old_guard - new_guard > 0)
> + if (mprotect (old_guard, new_guard - old_guard, prot) != 0)
> +   goto mprot_error;
> #endif
> 
> pd->guardsize = guardsize;
> 
> It therefore looks like this should also be upstreamed. We can add it
> back in the debian version in the meantime.

Thanks for comparing patches.

I tried to confirm the above change fixes the test regression using upstream 
source but it seems binutils 2.27-2 is broken:

[...]
a - elf/dl-tsd.os
hppa-linux-gnu-gcc-6   -nostdlib -nostartfiles -r -o 
/home/dave/gnu/glibc/objdir/elf/librtld.map.o '-Wl,-(' 
/home/dave/gnu/glibc/objdir/elf/dl-allobjs.os 
/home/dave/gnu/glibc/objdir/libc_pic.a -lgcc '-Wl,-)' 
-Wl,-Map,/home/dave/gnu/glibc/objdir/elf/librtld.mapT
/usr/bin/ld:/home/dave/gnu/glibc/objdir/libc_pic.a: file format not recognized; 
treating as linker script
/usr/bin/ld:/home/dave/gnu/glibc/objdir/libc_pic.a:1: syntax error
collect2: error: ld returned 1 exit status
Makefile:349: recipe for target '/home/dave/gnu/glibc/objdir/elf/librtld.map' 
failed
make[2]: *** [/home/dave/gnu/glibc/objdir/elf/librtld.map] Error 1

The error doesn't occur with 2.26.1.

Dave
--
John David Anglin   dave.ang...@bell.net





Re: glibc 2.24 testsuite issues on hppa

2016-08-07 Thread John David Anglin
On 2016-08-05, at 6:23 PM, Aurelien Jarno wrote:

> I have looked at the testsuite results from the latest uploads, there
> are 9 real regressions (ie not new tests) mostly related to NPTL:
> 
> * FAIL: nptl/tst-default-attr
>original exit status 22
>stacksize test
>guardsize test
>sched test
>tst-default-attr.c:101: pthread_create returned 22 (errno = 22)
>tst-default-attr.c:371: do_sched_test returned 22 (errno = 22)

This was probably introduced by the following change:

2016-02-19  Carlos O'Donell  

* nptl/allocatestack.c (allocate_stack): Declare new stackaddr,
assign attr->stackaddr to it, and adjust it down when
_STACK_GROWS_UP.  Change all attr->stackaddr to stackaddr.
[_STACK_GROWS_UP]: Delete assert.
* nptl/pthread_create.c (START_THREAD_DEFN) [!_STACK_GROWS_DOWN]:
Implement stack grows up logic.
* nptl/pthread_getattr_np.c (pthread_getattr_np): Implement
stack grows up logic.

I presume that the stack grows up patch that we had before was removed.  We are 
getting a mprotect error in test:

[pid 21422] mprotect(0xfce4a480, 4096, PROT_READ|PROT_WRITE|PROT_EXEC) = -1 
EINVAL (Invalid argument)

It looks like the error comes from here in allocatestack.c:

#elif _STACK_GROWS_UP
  if (mprotect ((char *) pd - pd->guardsize,
pd->guardsize - guardsize, prot) != 0)
        goto mprot_error;
#endif

Dave
--
John David Anglin   dave.ang...@bell.net





Re: glibc 2.23 testsuite issues on hppa

2016-07-03 Thread John David Anglin
On 2016-07-02, at 11:34 AM, Aurelien Jarno wrote:

>> dave@mx3210:~/gnu/glibc/objdir/nptl$ ldd ./tst-cancel9
>>  libpthread.so.0 => /lib/hppa-linux-gnu/libpthread.so.0 (0xfd4d8000)
>>  libc.so.6 => /lib/hppa-linux-gnu/libc.so.6 (0xfd2df000)
>>  /lib/ld.so.1 (0x4100)
> 
> Do you think that the test is not run correctly and uses part of the
> glibc from the host system?

I just remembered that cancellation involves loading libgcc to do the unwind.  
It also
depends on libc.so.6:

dave@mx3210:~/gnu/gcc/objdir/hppa-linux-gnu/libgcc$ ldd libgcc_s.so.4
libc.so.6 => /lib/hppa-linux-gnu/libc.so.6 (0xfcedf000)
/lib/ld.so.1 (0x4100)

So, there's some possibility that the dynamic loader messes up when not using 
the
default LD_LIBRARY_PATH.

The unwind works okay for a few steps back.  It suggests the unwind is on wrong 
stack,
or child stack wasn't hooked correctly to unwind.

Dave
--
John David Anglin   dave.ang...@bell.net





Re: glibc 2.23 testsuite issues on hppa

2016-07-02 Thread John David Anglin
On 2016-07-02, at 11:34 AM, Aurelien Jarno wrote:

> Do you think that the test is not run correctly and uses part of the
> glibc from the host system? It would be interesting to build glibc 2.23,
> install it on the system and check if the tests still fail.

The test fails randomly with new libraries and system dynamic loader.  It seems 
to always
pass with system libraries and system dynamic loader.

The test in testsuite is run using new dynamic loader but  I wonder if starting 
threads uses the system
dynamic loader.  We have in program headers:

  INTERP 0xf4 0x000100f4 0x000100f4 0xd 0xd R   0x1
  [Requesting program interpreter: /lib/ld.so.1]

Will see if building 2.23 using 2.23 is successful.

Dave
--
John David Anglin   dave.ang...@bell.net





Re: glibc 2.23 testsuite issues on hppa

2016-07-02 Thread John David Anglin
On 2016-06-30, at 7:25 PM, Aurelien Jarno wrote:

>  FAIL: nptl/tst-cancel9
>  FAIL: nptl/tst-cancelx9
> 
> These two errors need some investigation as the build log does not
> provide a lot of details. They seem to be linked as they anyway use the
> same source code with different compilation options.

These two fails are not new and I thought they had been added to XFAIL list.  
They
were listed as regressions in your mail "glibc 2.22 testsuite issues on hppa" 
on March 8
and were added to the 2.22 XFAIL list.

They also occur with trunk.

Strangely, these two tests do not fail when run using installed libraries:
dave@mx3210:~/gnu/glibc/objdir/nptl$ ./tst-cancel9
cancel now
waiting for the child
in cleanup
dave@mx3210:~/gnu/glibc/objdir/nptl$ ldd ./tst-cancel9
libpthread.so.0 => /lib/hppa-linux-gnu/libpthread.so.0 (0xfd4d8000)
libc.so.6 => /lib/hppa-linux-gnu/libc.so.6 (0xfd2df000)
/lib/ld.so.1 (0x4100)

The tests fail due to some kind of race which causes a segmentation fault in 
the unwind code:

(gdb) r
Starting program: /home/dave/gnu/glibc/objdir/nptl/tst-cancel9 
warning: Unable to find libthread_db matching inferior's thread library, thread 
debugging will not be available.
[New process 17717]
warning: Unable to find libthread_db matching inferior's thread library, thread 
debugging will not be available.
[New LWP 17718]
cancel now
waiting for the child

Thread 3.2 "tst-cancel9" received signal SIGSEGV, Segmentation fault.
[Switching to LWP 17718]
0xfa59afd4 in _Unwind_GetGR (index=2, context=0xfacd3708)
at ../../../src/libgcc/unwind-dw2.c:239
239 ../../../src/libgcc/unwind-dw2.c: No such file or directory.
(gdb) Timed out: killed the child process
bt
#0  0xfa59afd4 in _Unwind_GetGR (
index=, 
context=0xfacd3708) at ../../../src/libgcc/unwind-dw2.c:239
#1  _Unwind_GetPtr (
index=, 
context=0xfacd3708) at ../../../src/libgcc/unwind-dw2.c:251
#2  uw_update_context (context=0xfacd3708, 
context@entry=, fs=fs@entry=0xfacd3bc8) at ../../../src/libgcc/unwind-dw2.c:1518
#3  0xfa59b294 in uw_advance_context (fs=0xfacd3bc8, 
context=) at ../../../src/libgcc/unwind-dw2.c:1525
#4  _Unwind_ForcedUnwind_Phase2 (
exc=, 
context=) at ../../../src/libgcc/unwind.inc:185
Backtrace stopped: Cannot access memory at address 0xfacd3bac

I tend to think it's a kernel bug.

Dave
--
John David Anglin   dave.ang...@bell.net





Bug#827703: Acknowledgement (libc6: misaligned accesses in res_query.c to fields in HEADER struct)

2016-06-25 Thread John David Anglin
New patch is here:
https://sourceware.org/ml/libc-alpha/2016-06/msg01020.html

Dave
--
John David Anglin   dave.ang...@bell.net



Bug#827876: libc6: $dp is not initialized correctly in sysdeps/hppa/start.S (gcrt1.o)

2016-06-21 Thread John David Anglin
Package: libc6
Version: 2.22-12
Severity: normal

Dear Maintainer,

Since the update to glibc 2.22, executables compiled with -p and linked
against gcrt1.o crash on startup.  It was found that _start was not
initializing the $dp register correctly when sysdeps/hppa/start.S was
assembled with SHARED defined.  $dp is initilized correctly when SHARED
is not defined.  This is the normal case.

This is BZ 20277:
https://sourceware.org/bugzilla/show_bug.cgi?id=20277

A patch to fix this bug is here:
https://sourceware.org/ml/libc-alpha/2016-06/msg00823.html

Would you please add this change to the Debian hppa patch set for glibc.

Regards,
Dave Anglin

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.18.34+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages libc6 depends on:
ii  libgcc4  1:6.1.1-7

libc6 recommends no packages.

Versions of packages libc6 suggests:
ii  debconf [debconf-2.0]  1.5.59
ii  glibc-doc  2.22-12
ii  libc-l10n  2.22-12
ii  locales2.22-12
ii  locales-all [locales]  2.22-12+b1

-- debconf information:
  glibc/restart-failed:
  glibc/disable-screensaver:
* glibc/restart-services: spamassassin ssh samba postfix openbsd-inetd cron atd
  glibc/kernel-too-old:
* libraries/restart-without-asking: true
  glibc/kernel-not-supported:
* glibc/upgrade: true



Bug#827703: libc6: misaligned accesses in res_query.c to fields in HEADER struct

2016-06-19 Thread John David Anglin
Package: libc6
Version: 2.22-11+b3
Severity: normal

Dear Maintainer,

We see various misaligned accesses reported on the console and in the syslog
running apt-get on hppa:

http(13559): unaligned access to 0xfa703d49 at ip=0xf9f0a9bb
handle_unaligned: 37 callbacks suppressed
http(13810): unaligned access to 0xfa703d49 at ip=0xf9f0a9bb
http(13810): unaligned access to 0xfa703d49 at ip=0xf9f0a9c3
http(13810): unaligned access to 0xfa703d49 at ip=0xf9f0cdf3
http(13810): unaligned access to 0xfa703d49 at ip=0xf9f0cecf
http(13810): unaligned access to 0xfa703d4d at ip=0xf9f0c69b

This is upstream BZ 20243:
https://sourceware.org/bugzilla/show_bug.cgi?id=20243

A patch has been submitted here:
https://sourceware.org/ml/libc-alpha/2016-06/msg00679.html

It resolves the unaligned accesses without affecting the public headers
which expose the HEADER typedef.

Please add to the 2.22 patch set if okay.

Thanks,
Dave Anglin

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.18.34+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages libc6 depends on:
ii  libgcc4  1:6.1.1-6

libc6 recommends no packages.

Versions of packages libc6 suggests:
ii  debconf [debconf-2.0]  1.5.59
ii  glibc-doc  2.22-11
ii  libc-l10n  2.22-11
ii  locales2.22-11
ii  locales-all [locales]  2.22-11+b3

-- debconf information:
  glibc/disable-screensaver:
* libraries/restart-without-asking: true
  glibc/kernel-not-supported:
  glibc/restart-failed:
* glibc/upgrade: true
  glibc/kernel-too-old:
* glibc/restart-services: spamassassin ssh samba postfix openbsd-inetd cron atd



Bug#824363: glibc: Update debian xfail list for hppa

2016-05-14 Thread John David Anglin
Source: glibc
Version: 2.22
Severity: normal
Tags: patch

Dear Maintainer,

The attach patch updated the hppa xfail list based on the failures seen
in various builds for 2.22.  It adds two tests that sometimes fail.

Both tests fail during the unwind phase of cancellation.  It seems the
stack is being clobbered in a timing dependent manner and this breaks
the unwind.  The cause of the unwind failure is still undertermined.

This appears to be the reason many cancellation and cleanup tests fail
on hppa.

With this change and the other two patches provided today, glibc should
now build successfully on hppa.

Regards,
Dave Anglin

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.18.29+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
--- testsuite-xfail-debian.mk.save	2016-05-11 17:13:39.0 -0400
+++ testsuite-xfail-debian.mk	2016-05-11 20:18:33.848340159 -0400
@@ -160,8 +160,10 @@
 test-xfail-tst-cancel5 = yes
 test-xfail-tst-cancelx20 = yes
 test-xfail-tst-cancelx21 = yes
+test-xfail-tst-cancelx3 = yes
 test-xfail-tst-cancelx4 = yes
 test-xfail-tst-cancelx5 = yes
+test-xfail-tst-cleanup4 = yes
 test-xfail-tst-cleanupx4 = yes
 test-xfail-tst-cputimer2 = yes
 test-xfail-tst-cputimer3 = yes


Bug#824362: glibc: Fix failure of debug/backtrace-tst on hppa

2016-05-14 Thread John David Anglin
Source: glibc
Version: 2.22
Severity: normal
Tags: patch

Dear Maintainer,

The failure of the debug/backtrace-tst was introduced by the
hppa/submitted-dladdr.diff patch.  The code was not prepared to handle
being passed an arbitrary address.  As a result, _dl_lookup_address
generates a segmentation fault.

I believe this fixes one or two other tests as well.

This is BZ 20098:
https://sourceware.org/bugzilla/show_bug.cgi?id=20098

A patch to fix this problem in the upstream source is here:
https://sourceware.org/ml/libc-alpha/2016-05/txti8b7kcvurW.txt

Attached is a replacement for the current hppa/submitted-dladdr.diff patch.

Please update current patch.

Thanks,
Dave

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.18.29+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
2016-01-02  John David Anglin  

	[BZ #19415]
	* sysdeps/hppa/dl-fptr.c (_dl_fixup): Declare.
	(elf_machine_resolve): New.  Return address of _dl_runtime_resolve.
	(_dl_lookup_address): Rewrite using function resolver trampoline.
	* sysdeps/hppa/dl-lookupcfg.h (DL_LOOKUP_ADDRESS): Don't clear bottom
	two bits in address.

Index: glibc-2.22/sysdeps/hppa/dl-fptr.c
===
--- glibc-2.22.orig/sysdeps/hppa/dl-fptr.c
+++ glibc-2.22/sysdeps/hppa/dl-fptr.c
@@ -321,23 +321,76 @@ _dl_unmap (struct link_map *map)
   map->l_mach.fptr_table = NULL;
 }
 
+extern ElfW(Addr) _dl_fixup (struct link_map *, ElfW(Word)) attribute_hidden;
+
+static inline Elf32_Addr
+elf_machine_resolve (void)
+{
+  Elf32_Addr addr;
+
+  asm ("b,l 1f,%0\n"
+"	depi	0,31,2,%0\n"
+"1:	addil	L'_dl_runtime_resolve - ($PIC_pcrel$0 - 8),%0\n"
+"	ldo	R'_dl_runtime_resolve - ($PIC_pcrel$0 - 12)(%%r1),%0\n"
+   : "=r" (addr) : : "r1");
+
+  return addr;
+}
+
+static inline int
+_dl_read_access_allowed (unsigned int *addr)
+{
+  int result;
+
+  asm ("proberi(%1),3,%0" : "=r" (result) : "r" (addr) : );
+
+  return result;
+}
 
 ElfW(Addr)
 _dl_lookup_address (const void *address)
 {
   ElfW(Addr) addr = (ElfW(Addr)) address;
-  struct fdesc_table *t;
-  unsigned long int i;
+  unsigned int *desc, *gptr;
 
-  for (t = local.root; t != NULL; t = t->next)
-{
-  i = (struct fdesc *) addr - &t->fdesc[0];
-  if (i < t->first_unused && addr == (ElfW(Addr)) &t->fdesc[i])
-	{
-	  addr = t->fdesc[i].ip;
-	  break;
-	}
-}
+  /* Return ADDR if the least-significant two bits of ADDR are not consistent
+ with ADDR being a linker defined function pointer.  The normal value for
+ a code address in a backtrace is 3.  */
+  if (((unsigned int) addr & 3) != 2)
+return addr;
 
-  return addr;
+  /* Handle special case where ADDR points to page 0.  */
+  if ((unsigned int) addr < 4096)
+return addr;
+
+  /* Clear least-significant two bits from descriptor address.  */
+  desc = (unsigned int *) ((unsigned int) addr & ~3);
+  if (!_dl_read_access_allowed (desc))
+return addr;
+
+  /* Load first word of candidate descriptor.  It should be a pointer
+ with word alignment and point to memory that can be read.  */
+  gptr = (unsigned int *) desc[0];
+  if (((unsigned int) gptr & 3) != 0
+  || !_dl_read_access_allowed (gptr))
+return addr;
+
+  /* See if descriptor requires resolution.  The following trampoline is
+ used in each global offset table for function resolution:
+
+		ldw 0(r20),r22
+		bv r0(r22)
+		ldw 4(r20),r21
+ tramp:	b,l .-12,r20
+		depwi 0,31,2,r20
+		.word _dl_runtime_resolve
+		.word "_dl_runtime_resolve ltp"
+ got:	.word _DYNAMIC
+		.word "struct link map address" */
+  if (gptr[0] == 0xea9f1fdd			/* b,l .-12,r20 */
+  && gptr[1] == 0xd6801c1e			/* depwi 0,31,2,r20 */
+  && (ElfW(Addr)) gptr[2] == elf_machine_resolve ())
+_dl_fixup ((struct link_map *) gptr[5], (ElfW(Word)) desc[1]);
+
+  return (ElfW(Addr)) desc[0];
 }
Index: glibc-2.22/sysdeps/hppa/dl-lookupcfg.h
===
--- glibc-2.22.orig/sysdeps/hppa/dl-lookupcfg.h
+++ glibc-2.22/sysdeps/hppa/dl-lookupcfg.h
@@ -31,9 +31,7 @@ rtld_hidden_proto (_dl_symbol_address)
 
 Elf32_Addr _dl_lookup_address (const void *address);
 
-/* Clear the bottom two bits so generic code can find the fdesc entry */
-#define DL_LOOKUP_ADDRESS(addr) \
-  (_dl_lookup_address ((void *)((unsigned long)addr & ~3)))
+#define DL_LOOKUP_ADDRESS(addr) _dl_lookup_address ((const void *) addr)
 
 void attribute_hidden _dl_unmap (struct link_map *map);
 


Bug#824344: glibc: FTBFS on hppa due to stdlib/tst-setcontext3 test failure

2016-05-14 Thread John David Anglin
Source: glibc
Version: 2.22
Severity: normal
Tags: patch

Dear Maintainer,

Glibc fails to build on hppa because the stdlib/tst-setcontext3 test fails
and doesn't produce a .out file.  See, for example,
.

This problem is BZ 18124:
.

There is a submitted upstream patch here:
.

Please add attached patch to the hppa patch set.

Thanks,
Dave

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.18.29+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Index: glibc-2.22/sysdeps/unix/sysv/linux/hppa/setcontext.S
===
--- glibc-2.22.orig/sysdeps/unix/sysv/linux/hppa/setcontext.S
+++ glibc-2.22/sysdeps/unix/sysv/linux/hppa/setcontext.S
@@ -141,7 +141,7 @@ ENTRY(__setcontext)
 
 	/* No further context available. Exit now.  */
 	bl	HIDDEN_JUMPTARGET(exit), %r2
-	ldi	-1, %r26
+	ldi	0, %r26
 
 
 .Lerror:


Re: glibc 2.22 testsuite issues on hppa

2016-03-22 Thread John David Anglin
On 2016-03-08, at 1:07 PM, Aurelien Jarno wrote:

> Dear HPPA porters,
> 
> The glibc testsuite in version 2.22 which has been uploaded to sid 2
> days ago fails to pass on both phantom and sibaris build daemons.
> There seems to be 3 failures that are regressions compared to glibc
> 2.21:
> 
>  FAIL: debug/backtrace-tst

I have looked at the above failure.  It seems the implementation of 
DL_LOOKUP_ADDRESS(addr)
needs improvement.  It's not possible to detect a function pointer with 100% 
certainty given an arbitrary
address.  However, the above test passes with the following change.  The 
function pointer checks are
tightened and read access checks are added to help ensure the routine doesn't 
fault.

Dave
--
John David Anglin   dave.ang...@bell.net


diff --git a/sysdeps/hppa/dl-fptr.c b/sysdeps/hppa/dl-fptr.c
index 083242b..79032a6 100644
--- a/sysdeps/hppa/dl-fptr.c
+++ b/sysdeps/hppa/dl-fptr.c
@@ -331,20 +331,36 @@ elf_machine_resolve (void)
   return addr;
 }
 
+static inline int
+_dl_read_access_allowed (unsigned int *addr)
+{
+  int result;
+
+  asm ("proberi(%1),3,%0" : "=r" (result) : "r" (addr) : );
+
+  return result;
+}
+
 ElfW(Addr)
 _dl_lookup_address (const void *address)
 {
   ElfW(Addr) addr = (ElfW(Addr)) address;
   unsigned int *desc, *gptr;
 
-  /* Check for special cases.  */
-  if ((int) addr == -1
-  || (unsigned int) addr < 4096
-  || !((unsigned int) addr & 2))
+  /* Return ADDR if the least-significant two bits of ADDR are not consistent
+ with ADDR being a linker defined function pointer.  The normal value for
+ a code address in a backtrace is 3.  */
+  if (((unsigned int) addr & 3) != 2)
+return addr;
+
+  /* Handle special case where ADDR points to page 0.  */
+  if ((unsigned int) addr < 4096)
 return addr;
 
   /* Clear least-significant two bits from descriptor address.  */
   desc = (unsigned int *) ((unsigned int) addr & ~3);
+  if (!_dl_read_access_allowed (desc))
+return addr;
 
   /* Check if descriptor requires resolution.  The following trampoline is
  used in each global offset table for function resolution:
@@ -359,6 +375,9 @@ _dl_lookup_address (const void *address)
  got:  .word _DYNAMIC
.word "struct link map address" */
   gptr = (unsigned int *) desc[0];
+  if (!_dl_read_access_allowed (gptr))
+return addr;
+
   if (gptr[0] == 0xea9f1fdd/* b,l .-12,r20 */
   && gptr[1] == 0xd6801c1e /* depwi 0,31,2,r20 */
   && (ElfW(Addr)) gptr[2] == elf_machine_resolve ())


Re: glibc 2.22 testsuite issues on hppa

2016-03-08 Thread John David Anglin

On 2016-03-08, at 2:57 PM, Helge Deller wrote:

>> There seems to be 3 failures that are regressions compared to glibc
>> 2.21:
>> 
>>  FAIL: debug/backtrace-tst
>>  FAIL: nptl/tst-cancel9
>>  FAIL: nptl/tst-cancelx9
>> 
>> These tests have not been modified between glibc 2.21 and glibc 2.22. In
>> addition they are not listed in the expected failures list upstream [1].
>> Note that the compiler has been changed from gcc 4.9 to gcc 5, this
>> might explain the failures, especially the first one.
> 
> I think thread cancellation does has problems.
> Anyway, maybe Dave wants to take a look at those...?

The cancellation tests have always been somewhat problematic.  Helge wrote a 
couple of weeks
ago and he thought there was an unwind issue.  We will investigate as soon as 
possible.  At the
moment, we are trying to debug a kernel/gcc bug that causes a bootstrap 
failure.  I would guess
the new optimizations in gcc 5 are causing problems.

Dave
--
John David Anglin   dave.ang...@bell.net





Bug#810053: glibc: Fix dladdr and nss Bug#791537 on hppa

2016-01-05 Thread John David Anglin
Source: glibc
Version: 2.21-6
Severity: normal
Tags: patch

Dear Maintainer,

The attached patch resolves nss Bug#791537.  See:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=791537

A small testcase was developed to demonstrate the problem and a
glibc bug report was filed:
https://sourceware.org/bugzilla/show_bug.cgi?id=19415

A glibc patch was submitted here:
https://sourceware.org/ml/libc-alpha/2016-01/msg5.html

The submitted patch was backported to 2.21 and has been tested locally
for several days with no observed regressions in behavior.  nss now will
build successfully.

The submitted patch can be imported to 2.21 but it must be refreshed due
to minor file differences.  The attached change is the version tested on
2.21.

I would greatly appreciate your applying change in the next glibc update.

Thanks,
Dave

-- System Information:
Debian Release: stretch/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.18.25+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)



Bug#806839: glibc: FTBFS on hppa -- couple more expected fails needed

2015-12-01 Thread John David Anglin
Source: glibc
Version: 2.21-1
Severity: normal

Dear Maintainer,

A couple more expected fails are needed for a reliable build.  See log:
https://buildd.debian.org/status/fetch.php?pkg=glibc&arch=hppa&ver=2.21-1&stamp=1449012745

Details are:

+--- BEGIN COMPARE ---+
Comparing against debian/testsuite-checking/expected-results-hppa-linux-gnu-libc
+-+
| Encountered regressions that don't match expected failures: |
+-+
malloc/tst-trim1
nptl/tst-cancel3
+-+
TEST malloc/tst-trim1:
==
==
==
Timed out: killed the child process
TEST nptl/tst-cancel3:
Timed out: killed the child process
+-+
|Encountered progressions that don't match expected failures: |
+-+
rt/tst-cpuclock2
rt/tst-cputimer1
rt/tst-cputimer2
rt/tst-cputimer3
rt/tst-mqueue8
+ END COMPARE +

malloc/tst-trim1 seems a hard fail.  nptl/tst-cancel3 randomly fails.

I would greatly appreciate your adding these two to the expected hppa results.

Looking at my last build of the glibc trunk, I see that all the conformance
tests either pass or are XFAILed.  So, it should be possible to substantially
reduce number of fails on 2.21.

Thanks,
Dave

-- System Information:
Debian Release: stretch/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.18.24+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)



Bug#805836: glibc: __NO_LONG_DOUBLE_MATH needs to be defined on hppa

2015-11-22 Thread John David Anglin
Source: glibc
Version: 2.19-22
Severity: normal
Tags: patch

Dear Maintainer,

The attached fixes a problem found building the gmt package.  See BZ 19270:
https://sourceware.org/bugzilla/show_bug.cgi?id=19270

Normally gcc optimizes the isnan macro so the __isnanl call is eliminated.
Thus the problem was hidden for some time.

As noted in the bug report, __NO_LONG_DOUBLE_MATH needs to be defined on hppa
to ensure consistency with the library build.

The attached patch has been submitted here:
https://sourceware.org/ml/libc-alpha/2015-11/msg00520.html

Please add this change to hppa patch set.  It is now in 2.19-22+b6.

Regards,
Dave Anglin


-- System Information:
Debian Release: stretch/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.18.24+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Index: glibc-2.19/ports/sysdeps/hppa/fpu/bits/mathdef.h
===
--- glibc-2.19.orig/ports/sysdeps/hppa/fpu/bits/mathdef.h
+++ glibc-2.19/ports/sysdeps/hppa/fpu/bits/mathdef.h
@@ -34,6 +34,10 @@ typedef double double_t;	/* `double' exp
 
 #endif	/* ISO C99 */
 
-/* On hppa `long double' is 64-bits. */
-#undef __NO_LONG_DOUBLE_MATH
-
+#ifndef __NO_LONG_DOUBLE_MATH
+/* On hppa `long double' and `double' are  64-bits.  So, libm is built
+   with NO_LONG_DOUBLE defined.  The following define ensures the library
+   and headers are consistent.  This disables the declaration of all the
+   `long double' function variants.  */
+# define __NO_LONG_DOUBLE_MATH	1
+#endif


Bug#805730: glibc: __gmon_start__ symbol proliferation on hppa

2015-11-21 Thread John David Anglin
Source: glibc
Version: 2.19-22
Severity: normal
Tags: patch

Dear Maintainer,

The symbol __gmon_start__ is defined on the hppa in crtn.S.  As a result,
there is a weak definition in every executable.  This was originally done
to address problems in the handling of weak undefined symbols.  However,
the definition breaks the build of harfbuzz and vlc.  It breaks the
--as-needed processing of binutils/ld and this results in unnecessary
libraries being needed by executables.

The patch removes this definition and improves the handling of weak
undefined symbols in glibc.  The effect of removing __gmon_start is
handled by the dynamic linker, so it not necessary to immediately recompile
everything.

The problem is reported upstream here:
https://sourceware.org/bugzilla/show_bug.cgi?id=19170

Submitted patch is here:
https://sourceware.org/ml/libc-alpha/2015-11/msg00279.html

The attached change was installed in the +b4 build of 2.19-22 and no
regressions have been observed.

Would you please add the change to the debian/hppa patch set for glibc.

Regards,
Dave Anglin

-- System Information:
Debian Release: stretch/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.18.24+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Index: glibc-2.19/ports/sysdeps/hppa/crti.S
===
--- glibc-2.19.orig/ports/sysdeps/hppa/crti.S
+++ glibc-2.19/ports/sysdeps/hppa/crti.S
@@ -49,6 +49,95 @@
 # define PREINIT_FUNCTION_WEAK 1
 #endif
 
+#if PREINIT_FUNCTION_WEAK
+	weak_extern (PREINIT_FUNCTION)
+#else
+	.hidden PREINIT_FUNCTION
+#endif
+
+
+/* If we have working .init_array support, we want to keep the .init
+   section empty (apart from the mandatory prologue/epilogue.  This
+   ensures that the default unwind conventions (return-pointer in b0,
+   frame state in ar.pfs, etc.)  will do the Right Thing.  To ensure
+   an empty .init section, we register gmon_initializer() via the
+   .init_array.
+
+--davidm 02/10/29 */
+
+#if PREINIT_FUNCTION_WEAK
+/* This blob of assembly code is one simple C function:
+
+static void
+__attribute__ ((used))
+gmon_initializer (void)
+{
+  extern void weak_function __gmon_start__ (void);
+
+  if (__gmon_start__)
+(*__gmon_start__)();
+}
+
+In a final executable, PLABEL32 relocations for function pointers are
+resolved at link time.  Typically, binutils/ld resolves __gmon_start__
+using an external shared library.  __gmon_start__ is always called if
+it is found at link time.  If __gmon_start__ is not found at runtime
+due to a library update, then the function pointer will point at a null
+function descriptor and calling it will cause a segmentation fault.
+So, we call __canonicalize_funcptr_for_compare to obtain the canonicalized
+address of __gmon_start__ and skip calling __gmon_start__ if it is zero.
+
+ */
+	.type __canonicalize_funcptr_for_compare,@function
+	.type $$dyncall,@function
+
+	.section .data.rel.ro,"aw",@progbits
+	.align 4
+.LC0:
+	.type __gmon_start__,@function
+	.word P%__gmon_start__
+
+	.text
+	.align 4
+	.type gmon_initializer,@function
+gmon_initializer:
+	.PROC
+	.CALLINFO FRAME=64,CALLS,SAVE_RP,ENTRY_GR=4
+	.ENTRY
+	stw %r2,-20(%r30)
+	stwm %r4,64(%r30)
+	stw %r3,-60(%r30)
+	addil LT'.LC0,%r19
+	ldw RT'.LC0(%r1),%r28
+	ldw 0(%r28),%r3
+	comib,= 0,%r3,1f
+	copy %r19,%r4
+	stw %r19,-32(%r30)
+	bl __canonicalize_funcptr_for_compare,%r2
+	copy %r3,%r26
+	comib,= 0,%r28,1f
+	copy %r4,%r19
+	copy %r3,%r22
+	.CALL ARGW0=GR
+	bl $$dyncall,%r31
+	copy %r31,%r2
+1:
+	ldw -84(%r30),%r2
+	ldw -60(%r30),%r3
+	bv %r0(%r2)
+	ldwm -64(%r30),%r4
+	.EXIT
+	.PROCEND
+	.size gmon_initializer, .-gmon_initializer
+
+# undef PREINIT_FUNCTION
+# define PREINIT_FUNCTION gmon_initializer
+#endif
+
+	.section .init_array, "aw"
+	.word P% PREINIT_FUNCTION
+
+
 /* _init prologue.  */
 	.section .init, "ax", %progbits
 	.align 4
@@ -58,14 +147,6 @@ _init:
 	stw	%rp,-20(%sp)
 	stwm	%r4,64(%sp)
 	stw	%r19,-32(%sp)
-#if PREINIT_FUNCTION_WEAK
-	bl	PREINIT_FUNCTION,%rp
-	copy	%r19,%r4	/* delay slot */
-#else
-	bl	PREINIT_FUNCTION,%rp
-	copy	%r19,%r4	/* delay slot */
-#endif
-	copy	%r4,%r19
 
 /* _fini prologue.  */
 .section .fini,"ax",%progbits
Index: glibc-2.19/ports/sysdeps/hppa/crtn.S
===
--- glibc-2.19.orig/ports/sysdeps/hppa/crtn.S
+++ glibc-2.19/ports/sysdeps/hppa/crtn.S
@@ -38,27 +38,6 @@
 /* crtn.S puts function epilogues in the .init and .fini sections
corresponding to the prologues in crti.S. */
 
-/* Note that we cannot have a weak undefined __gmon_start__, because
-   that would require this to be PIC, and the linker is currently not
-   able to generate a proper procedure descriptor for _init.  Sad but
-   true.  Anyway, HPPA is one of tho

Bug#799478: glibc: revised atomic and new syscall patches for hppa

2015-09-19 Thread John David Anglin
Source: glibc
Version: 13
Severity: normal
Tags: patch

Dear Maintainer,

Attached are two patches for hppa.  Both use the register asm feature
of gcc to load arguments to specific registers prior to a syscall.

The updated atomic patch avoids the infamous "can't find a register in
class R1_REGS" and avoids the noinline function in the previous version.

The old hppa/local-atomic.diff patch needs to be deleted before applying
the hppa/submitted-atomic.diff change.

The syscall patch fixes the miscompilation of sched_setaffinity().  It
is similar to the fix applied to other archs.

Both patches have been submitted and applied to the upstream glibc source:
https://sourceware.org/bugzilla/show_bug.cgi?id=18787
https://sourceware.org/ml/libc-alpha/2015-08/msg00266.html

I would appreciate your adding these two changes to the set of hppa
changes.

I now need to look at 2.21...

Thanks,
Dave

-- System Information:
Debian Release: stretch/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.18.21+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
===
--- glibc-2.19.orig/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h
@@ -53,7 +53,7 @@ typedef uintmax_t uatomic_max_t;
 #define _LWS "0xb0"
 #define _LWS_CAS "0"
 /* Note r31 is the link register.  */
-#define _LWS_CLOBBER "r1", "r26", "r25", "r24", "r23", "r22", "r21", "r20", "r28", "r31", "memory"
+#define _LWS_CLOBBER "r1", "r23", "r22", "r20", "r31", "memory"
 /* String constant for -EAGAIN.  */
 #define _ASM_EAGAIN "-11"
 /* String constant for -EDEADLOCK.  */
@@ -63,25 +63,23 @@ typedef uintmax_t uatomic_max_t;
 /* The only basic operation needed is compare and exchange.  */
 # define atomic_compare_and_exchange_val_acq(mem, newval, oldval) 	\
   ({	\
- volatile int lws_errno;		\
- volatile int lws_ret;		\
+ register int lws_errno asm("r21");	\
+ register int lws_ret asm("r28");	\
+ register unsigned long lws_mem asm("r26") = (unsigned long)(mem);	\
+ register unsigned long lws_old asm("r25") = (unsigned long)(oldval);\
+ register unsigned long lws_new asm("r24") = (unsigned long)(newval);\
  asm volatile(			\
 	"0:	\n\t"			\
-	"copy	%2, %%r26			\n\t"			\
-	"copy	%3, %%r25			\n\t"			\
-	"copy	%4, %%r24			\n\t"			\
 	"ble	" _LWS "(%%sr2, %%r0)		\n\t"			\
 	"ldi	" _LWS_CAS ", %%r20		\n\t"			\
-	"ldi	" _ASM_EAGAIN ", %%r24		\n\t"			\
-	"cmpb,=,n %%r24, %%r21, 0b		\n\t"			\
+	"ldi	" _ASM_EAGAIN ", %%r20		\n\t"			\
+	"cmpb,=,n %%r20, %%r21, 0b		\n\t"			\
 	"nop	\n\t"			\
-	"ldi	" _ASM_EDEADLOCK ", %%r25	\n\t"			\
-	"cmpb,=,n %%r25, %%r21, 0b		\n\t"			\
+	"ldi	" _ASM_EDEADLOCK ", %%r20	\n\t"			\
+	"cmpb,=,n %%r20, %%r21, 0b		\n\t"			\
 	"nop	\n\t"			\
-	"stw	%%r28, %0			\n\t"			\
-	"stw	%%r21, %1			\n\t"			\
-	: "=m" (lws_ret), "=m" (lws_errno) \
-: "r" (mem), "r" (oldval), "r" (newval)\
+	: "=r" (lws_ret), "=r" (lws_errno)		 		\
+: "r" (lws_mem), "r" (lws_old), "r" (lws_new)			\
 	: _LWS_CLOBBER			\
  );	\
 	\
Index: glibc-2.19/ports/sysdeps/unix/sysv/linux/hppa/sysdep.h
===
--- glibc-2.19.orig/ports/sysdeps/unix/sysv/linux/hppa/sysdep.h
+++ glibc-2.19/ports/sysdeps/unix/sysv/linux/hppa/sysdep.h
@@ -361,9 +361,10 @@ L(pre_end):	ASM_LINE_SEP	\
 ({	\
 	long __sys_res;			\
 	{\
+		LOAD_ARGS_##nr(args)	\
 		register unsigned long __res asm("r28");		\
 		PIC_REG_DEF		\
-		LOAD_ARGS_##nr(args)	\
+		LOAD_REGS_##nr		\
 		/* FIXME: HACK save/load r19 around syscall */		\
 		asm volatile(		\
 			SAVE_ASM_PIC	\
@@ -407,9 +408,10 @@ L(pre_end):	ASM_LINE_SEP	\
 ({	\
 	long __sys_res;			\
 	{\
+		LOAD_ARGS_##nr(args)	\
 		register unsigned long __res asm("r28");		\
 		PIC_REG_DEF		\
-		LOAD_ARGS_##nr(args)	\
+		LOAD_REGS_##nr		\
 		/* FIXME: HACK save/load r19 around syscall */		\
 		asm volatile(		\
 			SAVE_ASM_PIC	\
@@ -432,9 +434,10 @@ L(pre_end):	ASM_LINE_SEP	\
 ({	\
 	long __sys_res;			\
 	{\
+		LOAD_ARGS_##nr(args)	\
 		register unsigned long __res asm("r28");		\
 		PIC_REG_DEF		\
-		LOAD_ARGS_##nr(args)	\
+		LOAD_REGS_##nr		\
 		/* FIXME: HACK save/load r19 around syscall */		\
 		asm volatile(		\
 			SAVE_ASM_PIC	\
@@ -453,24 +456,43 @@ L(pre_end):	ASM_LINE_SEP	\
 
 
 #define LOAD_ARGS_0()
-#define LOAD_ARGS_1(r26)		\
-  register unsigned long __r26 __asm__("r26") = (unsigned long)(r26);	\
+#define LOAD_REGS_0
+#define LOAD_ARGS_1(a1)	

Bug#785664: glibc: Additional fixes for hppa

2015-05-18 Thread John David Anglin
Package: glibc
Version: 2.19-18
Severity: normal
Tags: patch

Attached are five new patches to be imported to the hppa patch directory.

The submitted-fpu-r2.diff patch is a replacement for hppa/local-fpu.diff.
The hppa/local-fpu.diff patch must be deleted before applying
submitted-fpu-r2.diff.  The submitted-fpu-r2.diff patch improves the
handling of the floating point status register.  The patch has been
applied to trunk.

The submitted-fpu2.diff is from Carlos O'Donnel and has been applied
to trunk.  It contains further improvements to the handling of the
floating point context.

The local-fptr-table-size.diff patch improves the determination of the
size of the string table in the dynamic loader.  This help fix some
issues with the libgomp testsuite in gcc.  Again the patch is from
Carlos.

The local-setcontext.diff patch corrects a minor issue in __setcontext.
It should exit using "exit" so that the registered handlers are run.
This has been installed as part of a larger change on the trunk.

The submitted-start.diff patch fixes a PIE problem.  The Scrt1 object
needs to be position independent when generating PIE code.  The patch
adjusts the sections and relocations used when SHARED is defined so that
the generated code doesn't contain dynamic relocations in read-only
sections.  This patch is from Alan Modra.

I would greatly appreciat the application of these patches.

-- System Information:
Debian Release: stretch/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.17.8+ (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_CA.utf8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
2015-03-07  John David Anglin  

	* ports/sysdeps/hppa/fpu/feholdexcpt.c (feholdexcept): Don't modify
	bufptr in asms.
	* ports/sysdeps/hppa/fpu/fesetenv.c (fesetenv): Likewise.

Index: glibc-2.19/ports/sysdeps/hppa/fpu/feholdexcpt.c
===
--- glibc-2.19.orig/ports/sysdeps/hppa/fpu/feholdexcpt.c
+++ glibc-2.19/ports/sysdeps/hppa/fpu/feholdexcpt.c
@@ -29,8 +29,8 @@ feholdexcept (fenv_t *envp)
   /* Store the environment.  */
   bufptr = clear.buf;
   __asm__ (
-	   "fstd,ma %%fr0,8(%1)\n"
-	   : "=m" (clear), "+r" (bufptr) : : "%r0");
+	   "fstd %%fr0,0(%1)\n"
+	   : "=m" (clear) : "r" (bufptr) : "%r0");
   memcpy (envp, &clear.env, sizeof (fenv_t));
 
   /* Clear exception queues */
@@ -40,11 +40,9 @@ feholdexcept (fenv_t *envp)
   /* Now clear all flags  */
   clear.env.__status_word &= ~(FE_ALL_EXCEPT << 27);
 
-  /* Load the new environment. Note: fr0 must load last to enable T-bit
- Thus we start bufptr at the end and work backwards */
-  bufptr = (unsigned long long *)((unsigned int)(clear.buf) + sizeof(unsigned int)*4);
+  /* Load the new environment. Note: fr0 must load last to enable T-bit.  */
   __asm__ (
-	   "fldd,mb -8(%0),%%fr0\n"
+	   "fldd 0(%0),%%fr0\n"
 	   : : "r" (bufptr), "m" (clear) : "%r0");
 
   return 0;
Index: glibc-2.19/ports/sysdeps/hppa/fpu/fesetenv.c
===
--- glibc-2.19.orig/ports/sysdeps/hppa/fpu/fesetenv.c
+++ glibc-2.19/ports/sysdeps/hppa/fpu/fesetenv.c
@@ -33,7 +33,7 @@ fesetenv (const fenv_t *envp)
  we want to use from the environment specified by the parameter.  */
   bufptr = temp.buf;
   __asm__ (
-	   "fstd,ma %%fr0,8(%1)\n"
+	   "fstd %%fr0,0(%1)\n"
 	   : "=m" (temp) : "r" (bufptr) : "%r0");
 
   temp.env.__status_word &= ~(FE_ALL_EXCEPT
@@ -54,7 +54,7 @@ fesetenv (const fenv_t *envp)
  we take advantage of that to load in reverse order so fr0
  is loaded last and T-Bit is enabled. */
   __asm__ (
-	   "fldd,mb -8(%1),%%fr0\n"
+	   "fldd 0(%1),%%fr0\n"
 	   : : "m" (temp), "r" (bufptr) : "%r0" );
 
   /* Success.  */
Index: glibc-2.19/ports/sysdeps/hppa/fpu/feupdateenv.c
===
--- glibc-2.19.orig/ports/sysdeps/hppa/fpu/feupdateenv.c
+++ glibc-2.19/ports/sysdeps/hppa/fpu/feupdateenv.c
@@ -29,9 +29,22 @@ feupdateenv (const fenv_t *envp)
   __asm__ ("fstd %%fr0,0(%1)	\n\t"
"fldd 0(%1),%%fr0	\n\t"
 	   : "=m" (s.l) : "r" (&s.l));
-  memcpy(&temp, envp, sizeof(fenv_t));
-  /* Currently raised exceptions not cleared */
-  temp.__status_word |= s.sw[0] & (FE_ALL_EXCEPT << 27);
+
+  /* Given environment with exception flags not cleared.  */
+  if ((envp != FE_DFL_ENV) && (envp != FE_NOMASK_ENV))
+{
+  memcpy(&temp, envp, sizeof(fenv_t));
+  temp.__st

Bug#725508: hppa patches for eglibc

2014-05-07 Thread John David Anglin

On 7-May-14, at 7:02 PM, Aurelien Jarno wrote:


Done, but renamed to hppa/local-pthread_spin_unlock.diff.


Fantastic!  Thanks very much.




You will get these in the next upload. But please send these patches
UPSTREAM. Not doing so only expose you to some later problems like for
patch 3, and to regularly have to update the patches.


Understood.  We are relying on Carlos for this.

Thanks again,
Dave
--
John David Anglin   dave.ang...@bell.net


--
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: https://lists.debian.org/blu0-smtp3393baae78c2ce8f9c92fb97...@phx.gbl



Bug#725508: hppa patches for eglibc

2014-05-04 Thread John David Anglin

Attached is an updated patch set for 2.18-5.  All patches
apply cleanly.

The latest patches fix bugs in the floating point exception support,  
SHMLBA and

pthread spin lock code.

Dave
--
John David Anglin   dave.ang...@bell.net


0) hppa/local-longjmp-chk.diff -- delete
1) hppa/local-elf-make-cflags.diff
2) hppa/local-setjmp-namespace.diff
3) hppa/local-fanotify_mark-5i.diff
4) hppa/local-fcntl-osync.diff
5) hppa/local-atomic.diff
6) hppa/local-fpu.diff
7) hppa/local-shmlba.diff
8) hppa/pthread_spin_unlock.diff


local-elf-make-cflags.diff
Description: Binary data


local-setjmp-namespace.diff
Description: Binary data


local-fanotify_mark-5i.diff
Description: Binary data


local-fcntl-osync.diff
Description: Binary data


local-atomic.diff
Description: Binary data


local-fpu.diff
Description: Binary data


local-shmlba.diff
Description: Binary data


pthread_spin_unlock.diff
Description: Binary data


Bug#725508: hppa patches for eglibc

2014-03-02 Thread John David Anglin

On 24-Feb-14, at 12:49 PM, John David Anglin wrote:


Here is an updated hppa patch set for 2.18.


Attached is an updated patch set for 2.18-3.  All patches
apply cleanly.

I've also attached a replacement for the testsuite expected results
for hppa.  With this, I had a fully successful build even though results
from build to build are somewhat variable.

Dave
--
John David Anglin   dave.ang...@bell.net


0) hppa/local-longjmp-chk.diff -- delete
1) hppa/local-elf-make-cflags.diff
2) hppa/local-setjmp-namespace.diff
3) hppa/local-fanotify_mark-5i.diff
4) hppa/local-fcntl-osync.diff
5) hppa/local-atomic.diff


local-elf-make-cflags.diff
Description: Binary data


local-setjmp-namespace.diff
Description: Binary data


local-fanotify_mark-5i.diff
Description: Binary data


local-fcntl-osync.diff
Description: Binary data


local-atomic.diff
Description: Binary data


expected-results-hppa-linux-gnu-libc
Description: Binary data


Bug#725508: hppa patches for eglibc

2014-02-24 Thread John David Anglin

Here is an updated hppa patch set for 2.18.

Dave

 Original Message 
Subject:Re: Bug#725508: hppa patches for eglibc
Date:   Fri, 21 Feb 2014 19:26:27 -0500
From:   John David Anglin 
To: John David Anglin 
CC: 	Adam Conrad , Helge Deller , 
Carlos O'Donell 




On 17-Feb-14, at 7:15 PM, John David Anglin wrote:


On 17-Feb-14, at 5:51 PM, John David Anglin wrote:


On 17-Feb-14, at 4:38 PM, Adam Conrad wrote:


On Mon, Feb 17, 2014 at 04:17:51PM -0500, John David Anglin wrote:

No, I won't be able to complete a full build and check today.
If everything goes smoothly, the earliest would be tomorrow
morning.

It would be great if you could queue for a future upload.


Yeahp, works for me.  Get me clean patches against current
experimental
and I'll get them committed to SVN for you.  Also, would be
awesome if
you guys pushed more of this upstream (I'm looking at you, Carlos).



I reviewed the changes from 2.17 and removed the conflicting bits.
Attached
is what's left.  The ChangeLog entries are gone because they gave
problems.

Testing is in progress.



Build failed:

hppa-linux-gnu-gcc-4.8 gethstbyad.c -c -std=gnu99 -fgnu89-inline  -
O2 -Wall -Win
line -Wwrite-strings -fmerge-all-constants -frounding-math -g -pipe -
Wstrict-pro
totypes   -fPIC -fexceptions-isystem /home/dave/debian/eglibc/
eglibc-2.18/debian/include  -I../include -I/home/dave/debian/eglibc/
eglibc-2.18/build-tree/hpp
a-libc/inet  -I/home/dave/debian/eglibc/eglibc-2.18/build-tree/hppa-
libc  -I../p
orts/sysdeps/unix/sysv/linux/hppa/nptl  -I../ports/sysdeps/unix/sysv/
linux/hppa
-I../ports/sysdeps/unix/sysv/linux  -I../nptl/sysdeps/unix/sysv/
linux  -I../nptl/sysdeps/pthread  -I../sysdeps/pthread  -I../sysdeps/
unix/sysv/linux  -I../sysd
eps/gnu  -I../sysdeps/unix/inet  -I../ports/sysdeps/unix/sysv  -I../
nptl/sysdeps
/unix/sysv  -I../sysdeps/unix/sysv  -I../ports/sysdeps/unix  -I../
nptl/sysdeps/u
nix  -I../sysdeps/unix  -I../sysdeps/posix  -I../ports/sysdeps/hppa/
hppa1.1  -I.
./sysdeps/wordsize-32  -I../sysdeps/ieee754/flt-32  -I../sysdeps/
ieee754/dbl-64
-I../ports/sysdeps/hppa/fpu  -I../ports/sysdeps/hppa/nptl  -I../
ports/sysdeps/h
ppa  -I../sysdeps/ieee754  -I../sysdeps/generic  -I../ports  -I../
nptl  -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/hppa-linux-
gnu/4.8/include -isystem
/usr/lib/gcc/hppa-linux-gnu/4.8/include-fixed -isystem /home/dave/
debian/eglibc/
eglibc-2.18/debian/include  -D_LIBC_REENTRANT -include ../include/
libc-symbols.h
 -DPIC -DSHARED -o /home/dave/debian/eglibc/eglibc-2.18/build-
tree/hppa-lib
c/inet/gethstbyad.os -MD -MP -MF /home/dave/debian/eglibc/
eglibc-2.18/build-tree
/hppa-libc/inet/gethstbyad.os.dt -MT /home/dave/debian/eglibc/
eglibc-2.18/build-tree/hppa-libc/inet/gethstbyad.os
In file included from ../include/atomic.h:50:0,
from ../ports/sysdeps/unix/sysv/linux/hppa/nptl/
lowlevellock.h:
24,
from ../nptl/descr.h:30,
from ../ports/sysdeps/hppa/nptl/tls.h:56,
from ../include/netdb.h:10,
from gethstbyad.c:19:
../nss/getXXbyYY.c: In function ‘gethostbyaddr’:
../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h:68:6: error:
can’t find a register in class ‘R1_REGS’ while reloading ‘asm’
 asm volatile(   \
 ^
../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:217:13:
note: in expansion of macro ‘atomic_compare_and_exchange_val_acq’
  int val = atomic_compare_and_exchange_val_acq (futex, 1, 0);
^
../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h:68:6: error:
can’t find a register in class ‘R1_REGS’ while reloading ‘asm’
 asm volatile(   \
 ^
../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h:97:12: note: in
expansion of macro ‘atomic_compare_and_exchange_val_acq’
 ret = atomic_compare_and_exchange_val_acq(mem, newval, oldval); \
   ^
../include/atomic.h:189:7: note: in expansion of macro
‘atomic_compare_and_exchange_bool_acq’
 (atomic_compare_and_exchange_bool_acq (__atg5_memp,
__atg5_value, \
  ^
../include/atomic.h:196:45: note: in expansion of macro
‘atomic_exchange_acq’
# define atomic_exchange_rel(mem, newvalue) atomic_exchange_acq
(mem, newvalue)
^
../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:292:16:
note: in expansion of macro ‘atomic_exchange_rel’
 int val = atomic_exchange_rel (__futex, 0); \
   ^
../ports/sysdeps/unix/sysv/linux/hppa/nptl/lowlevellock.h:296:36:
note: in expansion of macro ‘__lll_unlock’
#define lll_unlock(futex, private) __lll_unlock(&(futex), private)
   ^
../nptl/sysdeps/pthread/bits/libc-lockP.h:237:3: note: in expansion
of macro ‘lll_unlock’
  lll_unlock (NAME, LLL_PRIVATE)
  ^
../nss/getXXbyYY.c:144:3: note: in expansion of macro
‘__libc_lock_unlock’
  __libc_lock_unlock (lock);
  ^
../ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h:68:6: error:

Bug#725508: Acknowledgement (eglibc: [hppa] Patch set for 2.13 build)

2013-10-07 Thread John David Anglin

Oops, wrong version in title.  Patches are for 2.17.

Dave

--
John David Anglindave.ang...@bell.net


--
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/blu0-smtp29b0a103831b4ce5b872cd97...@phx.gbl



Bug#725508: eglibc: [hppa] Patch set for 2.13 build

2013-10-06 Thread John David Anglin
Source: eglibc
Version: 2.17-93
Severity: important
Tags: patch

Attached are the set of patches that I use to build eglibc for the hppa
architecture.  They have been under test for a couple months.

The attached file ORDER.txt describes the installation order.

The current hppa/local-longjmp-chk.diff patch needs to be removed first.
Problem is fixed in 2.17 ports.

The hppa/submitted-fpu-control.diff patch fixes a problem in fpu_control.h.
Patch received from Guy Martin and Carlos O'Donell.

The hppa/local-volatile-fdesc.diff patch fixes an optimization
problem building with GCC versions after 4.4.  The newer compilers
optimize away the code setting fptr[0] and fptr[1] because they
don't understand hppa function pointer encoding.

The hppa/local-elf-make-cflags.diff patch fixes a CFLAGS issue compiling
rtld.c on hppa.  It's from Carlos.

The hppa/local-setjmp-namespace.diff patch fixes a warning about an
anonymous union.  It caused several fails in testsuite.

The hppa/local-fanotify_mark-5i.diff patch fixes the fanotify_mark syscall
interface.  It's from Jeroen Roovers.

Please test and install.

Thanks,
Dave Anglin

-- System Information:
Debian Release: 7.0
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: hppa (parisc64)

Kernel: Linux 3.12.0-rc3+ (SMP w/4 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
0) hppa/local-longjmp-chk.diff -- delete
1) hppa/submitted-fpu-control.diff
2) hppa/local-volatile-fdesc.diff
3) hppa/local-elf-make-cflags.diff
4) hppa/local-setjmp-namespace.diff
5) hppa/local-fanotify_mark-5i.diff
Index: eglibc-2.17/ports/ChangeLog.hppa
===
--- eglibc-2.17.orig/ports/ChangeLog.hppa	2012-12-02 16:11:45.0 -0500
+++ eglibc-2.17/ports/ChangeLog.hppa	2013-05-20 14:41:32.0 -0400
@@ -1,3 +1,10 @@
+2013-05-15  Guy Martin  
+	Carlos O'Donell  
+
+	[BZ# 15000]
+	* ports/sysdeps/hppa/fpu/fpu_control.h (_FPU_GETCW): Set cw.
+	(_FPU_SETCW): Pass address to fldd.
+
 2012-11-29  Carlos O'Donell  
 
 	* sysdeps/unix/sysv/linux/hppa/bits/socket.h: Delete file.
Index: eglibc-2.17/ports/sysdeps/hppa/fpu/fpu_control.h
===
--- eglibc-2.17.orig/ports/sysdeps/hppa/fpu/fpu_control.h	2012-12-02 16:11:45.0 -0500
+++ eglibc-2.17/ports/sysdeps/hppa/fpu/fpu_control.h	2013-05-20 14:50:06.0 -0400
@@ -49,7 +49,7 @@
   __asm__ ("fstd %%fr0,0(%1)\n\t"		\
"fldd 0(%1),%%fr0\n\t"		\
 	   : "=m" (__fullfp.__fpreg) : "r" (&__fullfp.__fpreg) : "%r0");	\
-  __fullfp.__halfreg[0];			\
+  cw = __fullfp.__halfreg[0];			\
 })
 
 #define _FPU_SETCW(cw) \
@@ -57,7 +57,7 @@
   union { unsigned long long __fpreg; unsigned int __halfreg[2]; } __fullfp;	\
   __fullfp.__halfreg[0] = cw;			\
   __asm__ ("fldd 0(%1),%%fr0\n\t"		\
-	   : : "m" (__fullfp.__fpreg), "r" (__fullfp.__fpreg) : "%r0" );	\
+	   : : "m" (__fullfp.__fpreg), "r" (&__fullfp.__fpreg) : "%r0" );	\
 })
 
 /* Default control word set at startup.  */
Index: eglibc-2.17/ports/ChangeLog.hppa
===
--- eglibc-2.17.orig/ports/ChangeLog.hppa	2013-06-27 21:26:29.0 -0400
+++ eglibc-2.17/ports/ChangeLog.hppa	2013-07-01 12:54:24.0 -0400
@@ -1,3 +1,9 @@
+2013-07-01  John David Anglin  
+
+	* ports/sysdeps/hppa/dl-lookupcfg.h (DL_AUTO_FUNCTION_ADDRESS): Make
+	function descriptor volatile.
+	(DL_STATIC_FUNCTION_ADDRESS): Likewise.
+
 2013-05-15  Guy Martin  
 	Carlos O'Donell  
 
Index: eglibc-2.17/ports/sysdeps/hppa/dl-lookupcfg.h
===
--- eglibc-2.17.orig/ports/sysdeps/hppa/dl-lookupcfg.h	2013-07-01 12:44:06.0 -0400
+++ eglibc-2.17/ports/sysdeps/hppa/dl-lookupcfg.h	2013-07-01 12:54:02.0 -0400
@@ -40,7 +40,7 @@
 
 #define DL_AUTO_FUNCTION_ADDRESS(map, addr)\
 ({	\
-  unsigned int fptr[2];			\
+  volatile unsigned int fptr[2];	\
   fptr[0] = (unsigned int) (addr);	\
   fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr;			\
   /* Set bit 30 to indicate to $$dyncall that this is a PLABEL. */	\
@@ -49,7 +49,7 @@
 
 #define DL_STATIC_FUNCTION_ADDRESS(map, addr)\
 ({	\
-  static unsigned int fptr[2];		\
+  static volatile unsigned int fptr[2];	\
   fptr[0] = (unsigned int) (addr);	\
   fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr;			\
   /* Set bit 30 to indicate to $$dyncall that this is a PLABEL. */	\
Index: eglibc-2.17/elf/Makefile
===
--- eglibc-2.17.orig/elf/Makefile	2013-07-07 16:32:49.0 -0400
+++ eglibc-2.17/elf/M

Bug#666774: eglibc: Updated hppa patch set for version 2.13

2012-04-03 Thread John David Anglin

On 4/3/2012 9:31 AM, Aurelien Jarno wrote:

tag 666774 - moreinfo
thanks

Le 02/04/2012 13:57, John David Anglin a écrit :

On 2-Apr-12, at 4:40 AM, Aurelien Jarno wrote:


tag 666774 + moreinfo
thanks

Le 01/04/2012 20:48, Dave Anglin a écrit :

Source: eglibc
Version: 2.13-27
Severity: important
Tags: patch

The following five patches will be attached to the report:
core-2011-08-31.diff
ports-2011-08-31.diff
ports-2011-09-17.diff
ports-2011-10-30.diff
ports-2012-03-31.diff

core-2011-08-31.diff replaces hppa/local-stack-grows-up.diff.
hppa/local-stack-grows-up.diff must be deleted first.  The
core patch addresses stack grows up issues.

The ports patches must be applied in order of date.  They address
a variety of issues (e.g., udev bootstrap failure due to incorrect
flags, various pthread condition failures).

The patches have been collected from messages posted to the parisc
linux mailing list, and from private work with Carlos O'Donell.
I have adjusted the original patches so that they apply to 2.13.

Aurelien, would you please apply these changes?


Thanks for theses patches. However it seems most of them are already
present in the Debian package. Against which version are there
supposed
to work? The best would be to get these patches against the current
Debian package.

As noted, the core-2011-08-31.diff patch replaces local-stack-grows-
up.diff.
The new content in it helps to fix the former pthread condition test
failures.

Ok, I read it too fast then. I have to say i don't really like the new
filenames, as they don't really say what the patch contains beside not
being compliant with our policy.


The "ports" patches are completely new.

Ok, thank we'll have a look at that for the next upload.

I have no objection to making the names compliant with your policy.  In 
particular,
core-2011-08-31.diff could be named local-stack-grows-up.diff as it's 
just an update

to the previous patch.

I just named the patches by date because the "ports" patches have to be 
applied

in order of date.  They all update the hppa changelog file.

Regards,
Dave

--
John David anglindave.ang...@bell.net




--
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/4f7b035b.9090...@bell.net



Bug#666774: Acknowledgement (eglibc: Updated hppa patch set for version 2.13)

2012-04-01 Thread John David Anglin

With the patches, this is the testsuite status:

# Testsuite failures, someone should be working towards
# fixing these! They are listed here for the purpose of
# regression testing during builds.
# Format: , Error  [(ignored)]
#
annexc.out, Error 1 (ignored)
check-execstack.out, Error 1
check-localplt.out, Error 1
check-textrel.out, Error 1
test-double.out, Error 1
test-float.out, Error 1
test-idouble.out, Error 1
test-ifloat.out, Error 1
tst-addr1.out, Error 1
tst-audit2.out, Error 139
tst-backtrace2.out, Error 1
tst-cancel22.out, Error 1
tst-cancel23.out, Error 1
tst-cancel25.out, Error 1
tst-cancel2.out, Error 1
tst-cancel5.out, Error 1
tst-cancelx11.out, Error 1
tst-cancelx20.out, Error 1
tst-cancelx21.out, Error 1
tst-cancelx2.out, Error 1
tst-cancelx3.out, Error 1
tst-cancelx4.out, Error 1
tst-cancelx5.out, Error 1
tst-cleanup4.out, Error 1
tst-cleanupx4.out, Error 1
tst-fini1.out, Error 142
tst-longjmp_chk.out, Error 1
tst-mqueue3.out, Error 1
*** WARNING ***
Please generate expected testsuite results for this arch!
*** WARNING ***

--
John David Anglin   dave.ang...@bell.net






--
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/blu0-smtp999321cf5c14e000820cce97...@phx.gbl



Bug#561203: threads and fork on machine with VIPT-WB cache

2010-04-02 Thread John David Anglin
On Fri, 02 Apr 2010, NIIBE Yutaka wrote:

> NIIBE Yutaka wrote:
>> To have same semantics as other archs, I think that VIPT-WB cache
>> machine should have cache flush at ptep_set_wrprotect, so that memory
>> of the page has up-to-date data.  Yes, it will be huge performance
>> impact for fork.  But I don't find any good solution other than this
>> yet.
>
> I think we could do something like (only for VIPT-WB cache machine):
>
> - static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned 
> long 
> address, pte_t *ptep)
>
> + static inline void ptep_set_wrprotect(struct vm_area_struct *vma, 
> struct 
> mm_struct *mm, unsigned long addr, pte_t *ptep)
>   {
>   pte_t old_pte = *ptep;
> + if (atomic_read(&mm->mm_users) > 1)
> + flush_cache_page(vma, addr, pte_pfn(old_pte));
>   set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
>   }

I tested the hack below on two machines currently running 2.6.33.2
UP kernels.  The change seems to fix Debian #561203 (minifail bug)!
Thus, I definitely think you are on the right track.  I'll continue
to test.

I suspect the same issue is present for SMP kernels.

Thanks,
Dave
-- 
J. David Anglin  dave.ang...@nrc-cnrc.gc.ca
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)

diff --git a/arch/parisc/include/asm/pgtable.h 
b/arch/parisc/include/asm/pgtable.h
index a27d2e2..a5d730f 100644
--- a/arch/parisc/include/asm/pgtable.h
+++ b/arch/parisc/include/asm/pgtable.h
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+extern void flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, 
unsigned long pfn);
 
 /*
  * kern_addr_valid(ADDR) tests if ADDR is pointing to valid kernel
@@ -456,7 +457,7 @@ static inline pte_t ptep_get_and_clear(struct mm_struct 
*mm, unsigned long addr,
return old_pte;
 }
 
-static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long 
addr, pte_t *ptep)
+static inline void ptep_set_wrprotect(struct vm_area_struct *vma, struct 
mm_struct *mm, unsigned long addr, pte_t *ptep)
 {
 #ifdef CONFIG_SMP
unsigned long new, old;
@@ -467,6 +468,8 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, 
unsigned long addr,
} while (cmpxchg((unsigned long *) ptep, old, new) != old);
 #else
pte_t old_pte = *ptep;
+   if (atomic_read(&mm->mm_users) > 1)
+   flush_cache_page(vma, addr, pte_pfn(old_pte));
set_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
 #endif
 }
diff --git a/mm/memory.c b/mm/memory.c
index 09e4b1b..21c2916 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -616,7 +616,7 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct 
*src_mm,
 * in the parent and the child
 */
if (is_cow_mapping(vm_flags)) {
-   ptep_set_wrprotect(src_mm, addr, src_pte);
+   ptep_set_wrprotect(vma, src_mm, addr, src_pte);
pte = pte_wrprotect(pte);
}
 



-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20100402193514.ga9...@hiauly1.hia.nrc.ca



Bug#478183: libc6-dev: Various header problems:

2008-07-22 Thread John David Anglin
> Any news on that?

The problem has gone away.  I presume this is due to the latest gcc 4.3
update.  I see stdarg.h is dated June 11.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)



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



Bug#478183: libc6-dev: Various header problems:

2008-06-12 Thread John David Anglin
> > Could you please send us a reduced testcase?
> > 
> 
> Any news on that?

No.  I just got back from vacation.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)



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



Bug#427398: Acknowledgement (svn is broken after updating ro

2007-06-12 Thread John David Anglin
A patch for this problem was posted here:
http://lists.parisc-linux.org/pipermail/parisc-linux/2007-June/031690.html

However, it's likely that the parisc specific code will be removed in
favour of the generic compat code.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Bug#427395: libc6: df command causes system crash on parisc

2007-06-03 Thread John David Anglin
> > It really looks like a bug in the kernel.
> 
> Yes, see
> http://lists.parisc-linux.org/pipermail/parisc-linux/2007-June/031651.html

The change posted here fixes the df problem:
http://lists.parisc-linux.org/pipermail/parisc-linux/2007-June/031652.html

So, this bug report can be closed.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Bug#427395: libc6: df command causes system crash on parisc

2007-06-03 Thread John David Anglin
> It really looks like a bug in the kernel.

Yes, see
http://lists.parisc-linux.org/pipermail/parisc-linux/2007-June/031651.html

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Bug#427395: libc6: df command causes system crash on parisc

2007-06-03 Thread John David Anglin
> I found really strange that this version of the glibc is using this
> syscall. It has been released 6 months ago, when 2.6.19 was still not
> released... How did you get this syscall number?

It's in register r20 of the register dump that I posted.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Bug#427395: libc6: df command causes system crash on parisc

2007-06-03 Thread John David Anglin
> > fstat64(3, {st_mode=0, st_size=0, ...}) = 0
> > mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
> > 0x40005000
> > read(3, "/dev/sda3 / ext3 rw,errors=remou"..., 4096) = 339
> > read(3, "", 4096)   = 0
> > close(3)= 0
> > munmap(0x40005000, 4096)= 0
> > fstat64(1, {st_mode=0, st_size=4299262263301, ...}) = 0
> > mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
> > 0x40005000
> > write(1, "Filesystem   1K-blocks  "..., 67Filesystem   
> > 1K-blocks  Used Available Use% Mounted on
> > ) = 67
> > upeek: ptrace(PTRACE_PEEKUSER,1410,4294967292,0): Input/output error
> 
> This strace looks "normal" or rather this seems to be a different bug. I
> mean I have the same output on my machine when running with strace, but
> df works correctly when not run with strace.

Kyle says "df uses statfs64, which was added to 2.6.21... I'm confused
why we're not catching it in syscall.S, I'll need to sit and think a bit."

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Bug#427395: libc6: df command causes system crash on parisc

2007-06-03 Thread John David Anglin
> It looks like you are using a hand built kernel. Do you use the patch to
> disable LWS CAS debugging [1] ?

Yes, but I've been told by Kyle that it's too old.  Syscall 298 was
added in 2.6.21.

I haven't disabled LWS CAS.

My attempts at modifying the kernel to return ENOSYS so far haven't
been successful.  Kyle says binutils is broken, so I need to do this
on a different system.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Bug#427395: libc6: df command causes system crash on parisc

2007-06-03 Thread John David Anglin
> >  YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
> >  PSW: 1110 Not tainted
> > r00-03  00ff0806ff0f 4036c000 40104edc 
> > c0601048
> > r04-07  403d79d4 403d89d4 0002c258 
> > 
> > r08-11  0002a3f4 0002a3f4 0001 
> > 
> > r12-15  0002a3f4  0001 
> > 0002c258
> > r16-19  0002a3f4 0002a3f4 0002a3f4 
> > 
> > r20-23  012a 4029c000 40357594 
> > 0002c268
> > r24-27  c0601048 0058 0002c258 
> > 40503fc0
> > r28-31  403daf60 7c744170 7c744180 
> > 403575e3
> > sr00-03  000eb800   
> > 000eb800
> > sr04-07     
> > 
> > 
> > IASQ:   IAOQ:  
> > 0004
> >  IIR: ISR: 000eb800  IOR: 
> >  CPU:0   CR30: 7c744000 CR31: 404c4000
> >  ORIG_R28: 40155a7c
> >  IAOQ[0]: 0x0
> >  IAOQ[1]: 0x4
> >  RP(r2): syscall_exit+0x0/0x14

The above looks to me like a syscall that isn't hooked up.
>From syscall.S, I see

LDREGX  %r20(%r19), %r19

/* If this is a sys_rt_sigreturn call, and the signal was received
 * when not in_syscall, then we want to return via syscall_exit_rfi,
 * not syscall_exit.  Signal no. in r20, in_syscall in r25 (see
 * trampoline code in signal.c).
 */
ldi __NR_rt_sigreturn,%r2
comb,=  %r2,%r20,.Lrt_sigreturn
.Lin_syscall:
ldilL%syscall_exit,%r2
be  0(%sr7,%r19)
ldo R%syscall_exit(%r2),%r2

r19 and sr7 are both zero.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Bug#427395: libc6: df command causes system crash on parisc

2007-06-03 Thread John David Anglin
> Is the libc6 the only thing that you updated? I am using the same libc
> here, paer.debian.org also uses it in the sid chroot, and I am unable to
> reproduce the problem.

This is on a PA8800 machine.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Bug#427395: libc6: df command causes system crash on parisc

2007-06-03 Thread John David Anglin
> Is the libc6 the only thing that you updated? I am using the same libc
> here, paer.debian.org also uses it in the sid chroot, and I am unable to
> reproduce the problem.

No, some other packages were updated.  Here are the most recent
packages in /var/cache/apt/archives:

-rw-r--r-- 1 root root 4088528 May 23 00:17 locales_2.5-9_all.deb
-rw-r--r-- 1 root root  336310 May 23 03:47 ncurses-term_5.6-3_all.deb
-rw-r--r-- 1 root root   12892 May 23 03:47 ncurses-base_5.6-3_all.deb
-rw-r--r-- 1 root root  158668 May 23 12:47 nscd_2.5-9_hppa.deb
-rw-r--r-- 1 root root 4875580 May 23 12:47 libc6_2.5-9_hppa.deb
-rw-r--r-- 1 root root 1435964 May 23 12:47 libc6-pic_2.5-9_hppa.deb
-rw-r--r-- 1 root root 2394486 May 23 12:47 libc6-dev_2.5-9_hppa.deb
-rw-r--r-- 1 root root 5600472 May 23 12:47 libc6-dbg_2.5-9_hppa.deb
-rw-r--r-- 1 root root  244816 May 23 12:47 ncurses-bin_5.6-3_hppa.deb
-rw-r--r-- 1 root root  365522 May 23 12:47 libncursesw5_5.6-3_hppa.deb
-rw-r--r-- 1 root root  344868 May 23 12:47 libncurses5_5.6-3_hppa.deb
-rw-r--r-- 1 root root 2514922 May 29 19:32 binutils_2.17cvs20070426-8_hppa.deb
-rw-r--r-- 1 root root 1222814 May 29 19:32 binutils-hppa64_2.17cvs20070426-8_hp

Running "strace df" I see:

[EMAIL PROTECTED]:~$ strace df
execve("/bin/df", ["df"], [/* 19 vars */]) = 0
brk(0)  = 0x2b000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x4000
newuname({sys="Linux", node="mx3210", ...}) = 0
access("/etc/ld.so.nohwcap", F_OK)  = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)  = 3
fstat64(3, {st_mode=0, st_size=0, ...}) = 0
mmap(NULL, 21269, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40486000
close(3)= 0
access("/etc/ld.so.nohwcap", F_OK)  = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY)= 3
read(3, "\177ELF\1\2\1\3\0\0\0\0\0\0\0\0\0\3\0\17\0\0\0\1\0\2\7"..., 512) = 512
fstat64(3, {st_mode=0, st_size=0, ...}) = 0
mmap(NULL, 1307036, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 
0x402ac000
mmap(0x403e2000, 32768, PROT_READ|PROT_WRITE|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x135000) = 0x403e2000
mmap(0x403ea000, 4508, PROT_READ|PROT_WRITE|PROT_EXEC, 
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x403ea000
close(3)= 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40001000
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40002000
munmap(0x40486000, 21269)   = 0
brk(0)  = 0x2b000
brk(0x4c000)= 0x4c000
open("/etc/mtab", O_RDONLY) = 3
fstat64(3, {st_mode=0, st_size=0, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40005000
read(3, "/dev/sda3 / ext3 rw,errors=remou"..., 4096) = 339
read(3, "", 4096)   = 0
close(3)= 0
munmap(0x40005000, 4096)= 0
fstat64(1, {st_mode=0, st_size=4299262263301, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 
0x40005000
write(1, "Filesystem   1K-blocks  "..., 67Filesystem   
1K-blocks  Used Available Use% Mounted on
) = 67
upeek: ptrace(PTRACE_PEEKUSER,1410,4294967292,0): Input/output error

The console message is different:

 YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
 PSW: 11001011 Not tainted
r00-03  00ff0804ff0b 7fe40180 401023a8 c0572048
r04-07  403e79d4 403e89d4 0002c258 
r08-11  0002a3f4 0002a3f4 0001 
r12-15  0002a3f4  0001 0002c258
r16-19  0002a3f4 0002a3f4 0002a3f4 
r20-23  012a 402ac000 40367594 0002c268
r24-27  c0572048 0058 0002c258 40503fc0
r28-31  7fe40180 7aaa8170 7aaa8180 7aaa8000
sr00-03  00069800   0006c000
sr04-07     

IASQ:   IAOQ:  0004
 IIR: ISR: 00069800  IOR: 
 CPU:0   CR30: 7aaa8000 CR31: 404c4000
 ORIG_R28: 40155a7c
 IAOQ[0]: 0x0
 IAOQ[1]: 0x4
 RP(r2): tracesys_exit+0x0/0x38

Rebooting...
Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Bug#427398: svn is broken after updating ro libc6 2.5-9

2007-06-03 Thread John David Anglin
Package: libc6
Version: 2.5-9
Severity: grave
Justification: renders package unusable


After updating to libc6 2.5-9 Friday evening, the svn package is
now broken:

[EMAIL PROTECTED]:~/gnu/gcc-4.3/gcc$ contrib/gcc_update
Updating SVN tree
Ugcc/real.c
Ugcc/real.h
Ugcc/ChangeLog
Ugcc/testsuite/ChangeLog
Dgcc/testsuite/gfortran.dg/allocate_stat_1.f90
Ugcc/config/sh/sh.md
Ugcc/config/m68k/m68k-modes.def
Ugcc/config/m68k/m68k.c
Updated to revision 125296.
svn: Can't read directory '.': Partial results are valid but processing 
is incomplete
Adjusting file timestamps
[EMAIL PROTECTED]:~/gnu/gcc-4.3/gcc$ svn cleanup
svn: Can't read directory 'libgcc/config/ia64/.svn/tmp': Partial results 
are valid but processing is incomplete

If an update is incomplete, svn cleanup can't fix or remove lock
files.  So, a complete new checkout has to be done. 

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (650, 'testing')
Architecture: hppa (parisc64)

Kernel: Linux 2.6.20-gfb60ab85-dirty
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

-- no debconf information


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



Bug#427395: libc6: df command causes system crash on parisc

2007-06-03 Thread John David Anglin
Package: libc6
Version: 2.5-9
Severity: critical
Justification: breaks the whole system

The following command leads to a system crash:

[EMAIL PROTECTED]:~$ df
Filesystem   1K-blocks  Used Available Use% Mounted on

The command hangs after the first line of output is printed.  It
is not possible to kill df, or login with ssh, telnet or the system
console.  The system console prints a continuous stream of the
following error messages:

 YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
 PSW: 1110 Not tainted
r00-03  00ff0806ff0f 4036c000 40104edc 
c0601048
r04-07  403d79d4 403d89d4 0002c258 

r08-11  0002a3f4 0002a3f4 0001 

r12-15  0002a3f4  0001 
0002c258
r16-19  0002a3f4 0002a3f4 0002a3f4 

r20-23  012a 4029c000 40357594 
0002c268
r24-27  c0601048 0058 0002c258 
40503fc0
r28-31  403daf60 7c744170 7c744180 
403575e3
sr00-03  000eb800   
000eb800
sr04-07     


IASQ:   IAOQ:  
0004
 IIR: ISR: 000eb800  IOR: 
 CPU:0   CR30: 7c744000 CR31: 404c4000
 ORIG_R28: 40155a7c
 IAOQ[0]: 0x0
 IAOQ[1]: 0x4
 RP(r2): syscall_exit+0x0/0x14

Prior to the libc6 update on June 1, 2008, the system had been running
in a stable manner for several months.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (650, 'testing')
Architecture: hppa (parisc64)

Kernel: Linux 2.6.20-gfb60ab85-dirty
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

-- no debconf information


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



Bug#352600:

2007-04-22 Thread John David Anglin

See GCC PR 31413:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31413

This change appears premature and breaks compatibility with other linux
distributions.



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



Bug#352600: GCC PR

2007-04-22 Thread John David Anglin
See:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31413

Since ROC hasn't been dropped, this change appears premature.  It
also breaks compatibility with other linux distributions.



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



Re: NPTL for hppa-linux is not backwards compatible with Linuxthreads.

2007-02-19 Thread John David Anglin
> Do you know of any other ABI breaks that could be coordinated with
> this transition?

No.  The last break was GCC 4.1.0 where the calling convention
for passing complex values was corrected.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Re: Bug#364231: [parisc-linux] Re: Bug#364231: exception catching

2006-05-02 Thread John David Anglin
> Ok, coming back to the question of the system compiler on hppa for
> etch. Assuming that hppa does want to do that:
> 
> - is glibc buildable with gcc-4.1 on hppa?

As far as I know, there's no new problems using 4.1 instead of 4.0.  See
http://lists.parisc-linux.org/pipermail/parisc-linux/2006-April/028894.html
and test results for a gcc 4.2.0 build using this glibc build
http://lists.parisc-linux.org/pipermail/parisc-linux/2006-April/028918.html

> - libstdc++6 would need to conflict with libgcc2, which seems to be
>   doable, but then rules out g++-3.4 and g++-4.0 as a fallback
>   solution, where g++-4.1 fails.

True.

> - is libffi hit by the ABI change as well?

No.  It's not affected because it doesn't support complex types.

I have one libffi fix that's not yet in 4.2.0 that fixes the remaining
Java testsuite failures.  I haven't tested a backport to 4.1.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Bug#354241: libc6: Dynamic loader doesn't support R_PARISC_PLABEL21L and R_PARISC_PLABEL14R

2006-02-24 Thread John David Anglin
Package: libc6
Version: 2.3.5-13
Severity: normal

The following two fails occur in the CVS binutils testsuite:

Running /home/dave/binutils-2.16.91/src/ld/testsuite/ld-pie/pie.exp ...
gcc -L/home/dave/binutils-2.16.91/objdir/./ld -pie 
/home/dave/binutils-2.16.91/s
rc/ld/testsuite/ld-pie/pie.c -o tmpdir/pie
gcc  -B/home/dave/binutils-2.16.91/objdir/ld/tmpdir/gas/ 
-I/home/dave/binutils-2
.16.91/src/ld/testsuite/ld-pie -g -O2   
-L/home/dave/binutils-2.16.91/objdir/./l
d -c -g -O2 -fPIC -c 
/home/dave/binutils-2.16.91/src/ld/testsuite/ld-pie/weakund
ef.c -o tmpdir/weakundef.o
gcc -L/home/dave/binutils-2.16.91/objdir/./ld 
-B/home/dave/binutils-2.16.91/objd
ir/ld/tmpdir/ld/ -L/home/dave/opt/gnu/hppa-linux/lib 
-L/home/dave/opt/gnu/lib -L
/usr/local/lib -L/lib -L/usr/lib  -o tmpdir/weakundef 
-L/home/dave/binutils-2.16
.91/src/ld/testsuite/ld-pie -pie tmpdir/weakundef.o
Running: tmpdir/weakundef > tmpdir/weakundef.out
tmpdir/weakundef: error while loading shared libraries: unexpected reloc 
type 0x
42
FAIL: weak undefined
gcc  -B/home/dave/binutils-2.16.91/objdir/ld/tmpdir/gas/ 
-I/home/dave/binutils-2
.16.91/src/ld/testsuite/ld-pie -g -O2   
-L/home/dave/binutils-2.16.91/objdir/./l
d -c -g -O2 -fPIC -c 
/home/dave/binutils-2.16.91/src/ld/testsuite/ld-pie/weakund
ef-data.c -o tmpdir/weakundef-data.o
gcc -L/home/dave/binutils-2.16.91/objdir/./ld 
-B/home/dave/binutils-2.16.91/objd
ir/ld/tmpdir/ld/ -L/home/dave/opt/gnu/hppa-linux/lib 
-L/home/dave/opt/gnu/lib -L
/usr/local/lib -L/lib -L/usr/lib  -o tmpdir/weakundef-data 
-L/home/dave/binutils
-2.16.91/src/ld/testsuite/ld-pie -pie tmpdir/weakundef-data.o
Running: tmpdir/weakundef-data > tmpdir/weakundef-data.out
tmpdir/weakundef-data: error while loading shared libraries: unexpected 
reloc ty
pe 0x42
FAIL: weak undefined data

This is the link for the first fail:
/home/dave/binutils-2.16.91/objdir/ld/tmpdir/ld/ld --eh-frame-hdr 
-dynamic-linke
r /lib/ld.so.1 -pie -o tmpdir/weakundef 
/usr/lib/gcc/hppa-linux-gnu/4.0.3/../../
../Scrt1.o /usr/lib/gcc/hppa-linux-gnu/4.0.3/../../../crti.o 
/usr/lib/gcc/hppa-l
inux-gnu/4.0.3/crtbeginS.o -L/home/dave/binutils-2.16.91/objdir/./ld 
-L/home/dav
e/opt/gnu/hppa-linux/lib -L/home/dave/opt/gnu/lib -L/usr/local/lib 
-L/lib -L/usr
/lib -L/home/dave/binutils-2.16.91/src/ld/testsuite/ld-pie 
-L/home/dave/binutils
-2.16.91/objdir/ld/tmpdir/ld -L/usr/lib/gcc/hppa-linux-gnu/4.0.3 
-L/usr/lib/gcc/
hppa-linux-gnu/4.0.3 -L/usr/lib/gcc/hppa-linux-gnu/4.0.3/../../.. 
tmpdir/weakund
ef.o -v -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed 
-lgcc_s -
-no-as-needed /usr/lib/gcc/hppa-linux-gnu/4.0.3/crtendS.o 
/usr/lib/gcc/hppa-linu
x-gnu/4.0.3/../../../crtn.o
GNU ld version 2.16.91 20060224

The problematic relocations come from here:

[EMAIL PROTECTED]:~/binutils-2.16.91/objdir/ld$ objdump -r 
/usr/lib/Scrt1.o|less

/usr/lib/Scrt1.o: file format elf32-hppa-linux

RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE  VALUE
 R_PARISC_PLABEL21L  main
0004 R_PARISC_PLABEL14R  main
0010 R_PARISC_PLABEL21L  __libc_csu_init
0014 R_PARISC_PLABEL14R  __libc_csu_init
0018 R_PARISC_PLABEL21L  __libc_csu_fini
001c R_PARISC_PLABEL14R  __libc_csu_fini

I believe that a patch was submitted by Carlos O'Donell to fix this bug.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (650, 'testing'), (90, 'unstable')
Architecture: hppa (parisc64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.13-pa1
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

-- no debconf information


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



Bug#344836: libc6: strtold is broken on hppa

2006-02-11 Thread John David Anglin
> Aurelien Jarno a écrit :
> > 
> > Could you please tell me where to find this version of the glibc, and 
> > also the sources? I can then find the patch and include it in the Debian 
> > package.
> > 
> OK, I have found the fix in the CVS, I am currently doing a test build.

Great.

If you are doing this, you might also look at seeing if you could find
the change mentioned here and add to the test build:
http://lists.parisc-linux.org/pipermail/parisc-linux/2006-January/028172.html
It's a floating point exception issue and it's currently blocking kde.

Randolph Chung posted a fix here:
http://lists.parisc-linux.org/pipermail/parisc-linux/2006-January/028140.html
However, this fix doesn't save all the FP exception registers and I think
Carlos was going to provide an update.

Thanks,
Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)



Bug#344836: libc6: strtold is broken on hppa

2005-12-26 Thread John David Anglin
Package: libc6
Version: 2.3.5-8
Severity: normal

The following program produces incorrect results:

#include 
int
main ()
{
  printf ("%Lf\n", strtold ("1", NULL));
  return 0;
}

[EMAIL PROTECTED]:~/gcc_test$ gcc -o ld1 ld1.c
[EMAIL PROTECTED]:~/gcc_test$ ./ld1
0.00


-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (650, 'testing'), (90, 'unstable')
Architecture: hppa (parisc64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.13-pa1
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

-- no debconf information


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



Bug#334112: libc6: SIGSEGV in linear_search_fdes

2005-10-15 Thread John David Anglin
Don't know if this will work.  My mail server at NRC is down for the 
day due
to building maintenance requiring a shutdown of electrical power.  
Thus, I

can't receive mail.

> Could you check for me why this failed:
>
>  if (hdr->fde_count_enc != DW_EH_PE_omit
>  && hdr->table_enc == (DW_EH_PE_datarel | DW_EH_PE_sdata4))

Both the fde_count_enc and table_enc fields are DW_EH_PE_omit.

> Do you have no search table, or is the encoding wrong?

There's no search table.  See the code at bfd/elf-eh-frame.c:730.

It looks as if hppa can't support tables because we need to use
DW_EH_PE_aligned for function pointers.  This requires runtime
relocation.  If it was just an issue of generating a pointer to the
function, I could probably use a pc-relative encoding.  However,
the value is used to actually call the function and we need a real
function pointer for that.

Dave



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



Bug#334112: libc6: SIGSEGV in linear_search_fdes

2005-10-15 Thread John David Anglin
Package: libc6
Version: 2.3.5-6.0.1
Severity: important


DWARF2 exception support is broken due to bad EH data in the .eh_frame
section of /lib/libc-2.3.5.so.

After installation of libc6 version 2.3.5-6.0.1, a number of regressions
were observed in the GCC 4.0 and 4.1 testsuites.  The following failure
occurs in g++.dg/eh/forced1.C:

(gdb) r
Starting program: /home/dave/gcc-4.1/objdir/gcc/testsuite/forced1.xg

Program received signal SIGSEGV, Segmentation fault.
linear_search_fdes (ob=0xc004a1d4, this_fde=0x40acba54, pc=0x4099d663)
at unwind-dw2-fde.c:776
776 in unwind-dw2-fde.c
(gdb) bt
#0  linear_search_fdes (ob=0xc004a1d4, this_fde=0x40acba54, pc=0x4099d663)
at unwind-dw2-fde.c:776
#1  0x401ba798 in _Unwind_IteratePhdrCallback (info=Variable "info" is not 
available.
)
at ../../gcc/gcc/unwind-dw2-fde-glibc.c:386
#2  0x40a90ccc in *__GI___dl_iterate_phdr (
[EMAIL PROTECTED]: 0x401ba47c <_Unwind_IteratePhdrCallback>,
data=0xc004a08c) at dl-iteratephdr.c:71
#3  0x401ba358 in _Unwind_Find_FDE (pc=0x4099d663, bases=0xc0049b80)
at ../../gcc/gcc/unwind-dw2-fde-glibc.c:417
#4  0x401b6968 in uw_frame_state_for (context=0xc0049a0c, fs=0xc0049c88)
at ../../gcc/gcc/unwind-dw2.c:975
#5  0x401b80e4 in _Unwind_ForcedUnwind_Phase2 (exc=0x22050, context=0xc0049a0c)
at unwind.inc:159
#6  0x401b84dc in _Unwind_Resume (exc=0x22050)
at unwind.inc:235
#7  0x000109d8 in doit ()
at /home/dave/gcc-4.1/gcc/gcc/testsuite/g++.dg/eh/forced1.C:71
#8  0x00010a04 in main ()
at /home/dave/gcc-4.1/gcc/gcc/testsuite/g++.dg/eh/forced1.C:79

linear_search_fdes is looking for the fde for __libc_start_main in
the .eh_frame data for libc:

(gdb) disass 0x4099d660
Dump of assembler code for function __libc_start_main:
0x4099d56c <__libc_start_main+0>:   addil 1000,r19,%r1
0x4099d570 <__libc_start_main+4>:   stw rp,-14(,sp)
...

Here is the fde data:

(gdb) x/20x 0x40acba40
0x40acba40 <__invoke_dynamic_linker__+126408>:  0x40a8e5fc 0x0040 
0x4c0ec0ff   0x0f84
0x40acba50 <__invoke_dynamic_linker__+126424>:  0x0011027b 0x40ad0116 
0x   0x40acfd16

Here is the end of the .eh_frame dump:

[EMAIL PROTECTED]:/usr/lib/debug$ objdump -s -j .eh_frame libc-2.3.5.so|less

libc-2.3.5.so: file format elf32-hppa-linux

Contents of section .eh_frame:
 149d00 000c  01000104 020c1e00  
 ...
 14ea30 830b840a 85098806 0018 0060  ...`
 14ea40 001115fc 0040 4c0ec0ff 0f84  [EMAIL PROTECTED]
 14ea50 0011027b ...{

(gdb) list unwind-dw2-fde.c:776
771 {
772   const struct dwarf_cie *last_cie = 0;
773   int encoding = ob->s.b.encoding;
774   _Unwind_Ptr base = base_from_object (ob->s.b.encoding, ob);
775
776   for (; ! last_fde (ob, this_fde); this_fde = next_fde (this_fde))

static inline int
last_fde (struct object *obj __attribute__ ((__unused__)), const fde *f)
{
#ifdef DWARF2_OBJECT_END_PTR_EXTENSION
  return (char *)f == obj->fde_end || f->length == 0;
#else
  return f->length == 0;
#endif
}

I believe that the fde data should terminate with an fde of zero length.
This isn't the case for the libc fde data.  This and the lack of fde
data for __libc_start_main causes the SEGV.

This is a regression from 2.3.2.

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (650, 'testing'), (90, 'unstable')
Architecture: hppa (parisc64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.14-rc2-pa2
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

-- no debconf information


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



Re: [parisc-linux] glibc binary NMU for hppa, built with gcc-3.4

2005-09-20 Thread John David Anglin
> John David Anglin writes:
> > > Following the discussion on parisc, I uploaded glibc built with
> > > gcc-3.4. Validated, that gcc-4.0 bootstraps again and the python build
> > > errors are gone.
> > 
> > Does this fix GCC PR 23731?
> 
> down to 475 test failures. Maybe related to PR23602

I suspect that there are still glibc issues.

With 2.3.2.ds1-22, I don't see anywhere this number of fails:
http://gcc.gnu.org/ml/gcc-testresults/2005-09/msg00946.html.
>From testing with 4.1, I know that the SyncTest and Thread_Monitor
can be fixed by adding locking to the pa compare_and_swap
implementation for java.  This is important on SMP systems.

I made a couple of changes to libjava on head which fixed problems
with java exception handling on the pa:

2005-08-21  John David Anglin  <[EMAIL PROTECTED]>

PR libgcj/23507
* stacktrace.cc (_Jv_StackTrace::UnwindTraceFn): Fix typo in newLength
assignment.  Cast operands of compare to function pointer type.

2005-08-20  John David Anglin  <[EMAIL PROTECTED]>

PR libgcj/21692
* sysdep/pa/descriptor.h: New file.
* configure.host: Use sysdep/pa/descriptor.h on hppa*-*.

Possibly, we need to look at back porting these fixes.  However,
the code in 4.0 is different and I wasn't seeing the same errors.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Re: [parisc-linux] glibc binary NMU for hppa, built with gcc-3.4

2005-09-18 Thread John David Anglin
> Following the discussion on parisc, I uploaded glibc built with
> gcc-3.4. Validated, that gcc-4.0 bootstraps again and the python build
> errors are gone.

Does this fix GCC PR 23731?

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Re: Bug#321785: fakeroot: segfaults on [hppa]

2005-08-15 Thread John David Anglin
> > no, it's not fakeroot, it's make segfaulting ...
> [...]
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread 16384 (LWP 16911)]
> > 0x4091fd20 in __canonicalize_funcptr_for_compare () from 
> > /lib/libpthread.so.0
> > (gdb) bt
> > #0  0x4091fd20 in __canonicalize_funcptr_for_compare ()
> >from /lib/libpthread.so.0
> > #1  0x4091b424 in sigaction () from /lib/libpthread.so.0
> > #2  0x405cc950 in sigaction () from /lib/libc.so.6
> > #3  0x405cc748 in ssignal () from /lib/libc.so.6
> > #4  0x0001d690 in main ()
> > (gdb)
> 
> Confirmed. We are passing a function pointer with a value of -2 into
> __cffc, which should not happen...

I've posted a candidate gcc fix here:
http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00923.html

As I mentioned earlier today to Randolph, I think there should possibly
be a pa specific implementation of sigaction that avoids doing function
pointer canonicalization.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Re: Bug#321785: fakeroot: segfaults on [hppa]

2005-08-13 Thread John David Anglin
> #1  0x406d7424 in __pthread_sigaction (sig=18, act=0xc0241ec8, 
> oact=0xc0241f50)
>  at signals.c:106
> 106   if (old == SIG_IGN || old == SIG_DFL || old == SIG_ERR)
> (gdb) print &old
> Address requested for identifier "old" which is in register $r11
> (gdb) print /x $r11
> $6 = 0x0
> (gdb) print /x $pc
> $7 = 0x406d7424
> (gdb) disassemble $pc-16 $pc+4
> Dump of assembler code from 0x406d7414 to 0x406d7428:
> 0x406d7414 <__pthread_sigaction+252>:   stw r20,-138(,sp)
> 0x406d7418 <__pthread_sigaction+256>:   copy r19,r4
> 0x406d741c <__pthread_sigaction+260>:   b,l 0x406dbcd8 
> <__canonicalize_funcptr_for_compare>,rp
> 0x406d7420 <__pthread_sigaction+264>:   ldo -2(r11),r26
> 0x406d7424 <__pthread_sigaction+268>:   copy r4,r19
> End of assembler dump.
> (gdb)
> 
> Why is it doing that "ldo -2(r11),r26" ?

I would have thought that old (r11) would have just been copied to
r26.  Could you send preprocessed source and compilation details?

The handling of function pointers in 4.0 branch was broken prior to
this change:

2005-07-02  Jeff Law  <[EMAIL PROTECTED]>

* tree-ssa-dom.c (find_equivalent_equality_comparison): Do not
a eliminate type conversion which feeds an equality comparison
if the original type or either operand in the comparison is a
function pointer.

This change is in 4.0.1.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Re: Bug#321785: fakeroot: segfaults on [hppa]

2005-08-12 Thread John David Anglin
> > no, it's not fakeroot, it's make segfaulting ...
> [...]
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread 16384 (LWP 16911)]
> > 0x4091fd20 in __canonicalize_funcptr_for_compare () from 
> > /lib/libpthread.so.0
> > (gdb) bt
> > #0  0x4091fd20 in __canonicalize_funcptr_for_compare ()
> >from /lib/libpthread.so.0
> > #1  0x4091b424 in sigaction () from /lib/libpthread.so.0
> > #2  0x405cc950 in sigaction () from /lib/libc.so.6
> > #3  0x405cc748 in ssignal () from /lib/libc.so.6
> > #4  0x0001d690 in main ()
> > (gdb)

GSIGNAL(3) Linux Programmer's ManualGSIGNAL(3)

NAME
   gsignal, ssignal - software signal facility

SYNOPSIS
   #include 

   typedef void (*sighandler_t)(int);

   int gsignal(signum);

   sighandler_t ssignal(int signum, sighandler_t action);

DESCRIPTION
   Don't  use  these  functions under Linux.  Due to a historical mistake,
   under Linux these functions  are  aliases  for  raise()  and  signal(),
   respectively.

   ...

CONFORMING TO
   SVID2, XPG2.  These functions are available  under  AIX,  DG-UX,  HPUX,
   SCO, Solaris, Tru64.  They are called obsolete under most of these sys-
   tems, and are broken under Linux libc and  glibc.   Some  systems  also
   have gsignal_r() and ssignal_r().

I'm guessing that ssignal is called with action -2.  I have no idea
what that's supposed to do.  __cffc accepts small positive function
pointer addresses and -1 as special.  It doesn't attempt to canonicalize
them.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Re: Bug#321785: fakeroot: segfaults on [hppa]

2005-08-10 Thread John David Anglin
> >>Confirmed. We are passing a function pointer with a value of -2 into
> >>__cffc, which should not happen...
> > 
> > 
> > Is -2 a special signal number?
> 
> I don't think so. in any case, others have observed that if they use an 
> older glibc, this problem does not happen.

Not sure this is related, but your put_user kernel patch fixed
some c++ issues.  There are also issues with the alignment of
alternate signal stacks.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Re: Bug#321785: fakeroot: segfaults on [hppa]

2005-08-10 Thread John David Anglin
> > no, it's not fakeroot, it's make segfaulting ...
> [...]
> > Program received signal SIGSEGV, Segmentation fault.
> > [Switching to Thread 16384 (LWP 16911)]
> > 0x4091fd20 in __canonicalize_funcptr_for_compare () from 
> > /lib/libpthread.so.0
> > (gdb) bt
> > #0  0x4091fd20 in __canonicalize_funcptr_for_compare ()
> >from /lib/libpthread.so.0
> > #1  0x4091b424 in sigaction () from /lib/libpthread.so.0
> > #2  0x405cc950 in sigaction () from /lib/libc.so.6
> > #3  0x405cc748 in ssignal () from /lib/libc.so.6
> > #4  0x0001d690 in main ()
> > (gdb)
> 
> Confirmed. We are passing a function pointer with a value of -2 into
> __cffc, which should not happen...

Is -2 a special signal number?

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6602)


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



Re: GNU/Libc 2.3.1 on HP-PARISC requires >= 2.4.19 kernel.

2003-03-05 Thread John David Anglin
> Hi, my name is Carlos, and I cause all your nightmares with glibc on
> HPPA :)
> [...]
> I recommend that you _do_ _not_ upgrade glibc on HPPA until 2.3.1-6.

Being perverse, I tried installing 2.3.1-5.  I hit the same problem
that Joel mentioned previously, the old dynamic loader doesn't define
GLIBC_PRIVATE.  I was trying to install glibc privately in a prefix of
my selection.  I have been using LD_LIBRARY_PATH to select my library
path.  However, this no longer works since all system binaries are
linked using /lib/ld.so.1 and it isn't compatible with the 2.3.1
libraries.  Is there a way around this?

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6605)


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



Re: [parisc-linux] Re: FATAL: kernel too old

2002-12-04 Thread John David Anglin
> Dave,
> I can build a UP 2.4.20 for the rp2470 and see how that fairs.
> SMP has in fact not been especially stable for the 2.4.19 hppa releases.

That would be great.  I was going to try vmlinux-2.4.20-rc1-pa7
after the gcc testsuite run that is in progress completes.  I seem
to recall that vmlinux-2.4.20-rc1-pa7 wasn't very stable, so it
would be nice to find something later than 2.4.18 that works reasonably
reliably.

I was trying to get a feel whether of not the current gcc mainline
would successfully build the latest glibc.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6605)




Re: [parisc-linux] Re: FATAL: kernel too old

2002-12-04 Thread John David Anglin
> On Wed, Dec 04, 2002 at 05:13:07PM -0500, John David Anglin wrote:
> 
> > Is 2.4.18-pa52 really too old?
> 
> Yes.  hppa-linux requires 2.4.19

Ok, I try one of the other builds but none so far have been particularly
stable on a rp2470c.

Thanks,
Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6605)




FATAL: kernel too old

2002-12-04 Thread John David Anglin
I'm getting the following error building glibc-2.3.1-5:

CPP='/home/dave/opt/gnu/bin/gcc -E -x c-header'  /home/dave/glibc-2.3.1-5/glibc-
2.3.1/objdir/elf/ld.so.1 --library-path /home/dave/glibc-2.3.1-5/glibc-2.3.1/obj
dir:/home/dave/glibc-2.3.1-5/glibc-2.3.1/objdir/math:/home/dave/glibc-2.3.1-5/gl
ibc-2.3.1/objdir/elf:/home/dave/glibc-2.3.1-5/glibc-2.3.1/objdir/dlfcn:/home/dav
e/glibc-2.3.1-5/glibc-2.3.1/objdir/nss:/home/dave/glibc-2.3.1-5/glibc-2.3.1/objd
ir/nis:/home/dave/glibc-2.3.1-5/glibc-2.3.1/objdir/rt:/home/dave/glibc-2.3.1-5/g
libc-2.3.1/objdir/resolv:/home/dave/glibc-2.3.1-5/glibc-2.3.1/objdir/crypt:/home
/dave/glibc-2.3.1-5/glibc-2.3.1/objdir/linuxthreads /home/dave/glibc-2.3.1-5/gli
bc-2.3.1/objdir/sunrpc/rpcgen -Y ../scripts -c rpcsvc/bootparam_prot.x -o /home/
dave/glibc-2.3.1-5/glibc-2.3.1/objdir/sunrpc/xbootparam_prot.T
FATAL: kernel too old
make[2]: *** [/home/dave/glibc-2.3.1-5/glibc-2.3.1/objdir/sunrpc/xbootparam_prot
.stmp] Error 1

Is 2.4.18-pa52 really too old?

I configured with

../glibc/configure --build=hppa-linux --host=hppa-linux --target=hppa-linux 
--prefix=/home/dave/opt/gnu --disable-profile --without-cvs --enable-add-ons 
--enable-hacker-mode --enable-kernel=2.4.8

Oh, I noticed that hppa-linux is not listed in INSTALL or README.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6605)




Re: [parisc-linux] Re: FATAL: kernel too old

2002-12-04 Thread John David Anglin
> Dave,
> I can build a UP 2.4.20 for the rp2470 and see how that fairs.
> SMP has in fact not been especially stable for the 2.4.19 hppa releases.

That would be great.  I was going to try vmlinux-2.4.20-rc1-pa7
after the gcc testsuite run that is in progress completes.  I seem
to recall that vmlinux-2.4.20-rc1-pa7 wasn't very stable, so it
would be nice to find something later than 2.4.18 that works reasonably
reliably.

I was trying to get a feel whether of not the current gcc mainline
would successfully build the latest glibc.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6605)


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




Re: [parisc-linux] Re: FATAL: kernel too old

2002-12-04 Thread John David Anglin
> On Wed, Dec 04, 2002 at 05:13:07PM -0500, John David Anglin wrote:
> 
> > Is 2.4.18-pa52 really too old?
> 
> Yes.  hppa-linux requires 2.4.19

Ok, I try one of the other builds but none so far have been particularly
stable on a rp2470c.

Thanks,
Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6605)


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




FATAL: kernel too old

2002-12-04 Thread John David Anglin
I'm getting the following error building glibc-2.3.1-5:

CPP='/home/dave/opt/gnu/bin/gcc -E -x c-header'  /home/dave/glibc-2.3.1-5/glibc-
2.3.1/objdir/elf/ld.so.1 --library-path /home/dave/glibc-2.3.1-5/glibc-2.3.1/obj
dir:/home/dave/glibc-2.3.1-5/glibc-2.3.1/objdir/math:/home/dave/glibc-2.3.1-5/gl
ibc-2.3.1/objdir/elf:/home/dave/glibc-2.3.1-5/glibc-2.3.1/objdir/dlfcn:/home/dav
e/glibc-2.3.1-5/glibc-2.3.1/objdir/nss:/home/dave/glibc-2.3.1-5/glibc-2.3.1/objd
ir/nis:/home/dave/glibc-2.3.1-5/glibc-2.3.1/objdir/rt:/home/dave/glibc-2.3.1-5/g
libc-2.3.1/objdir/resolv:/home/dave/glibc-2.3.1-5/glibc-2.3.1/objdir/crypt:/home
/dave/glibc-2.3.1-5/glibc-2.3.1/objdir/linuxthreads /home/dave/glibc-2.3.1-5/gli
bc-2.3.1/objdir/sunrpc/rpcgen -Y ../scripts -c rpcsvc/bootparam_prot.x -o /home/
dave/glibc-2.3.1-5/glibc-2.3.1/objdir/sunrpc/xbootparam_prot.T
FATAL: kernel too old
make[2]: *** [/home/dave/glibc-2.3.1-5/glibc-2.3.1/objdir/sunrpc/xbootparam_prot
.stmp] Error 1

Is 2.4.18-pa52 really too old?

I configured with

../glibc/configure --build=hppa-linux --host=hppa-linux --target=hppa-linux 
--prefix=/home/dave/opt/gnu --disable-profile --without-cvs --enable-add-ons 
--enable-hacker-mode --enable-kernel=2.4.8

Oh, I noticed that hppa-linux is not listed in INSTALL or README.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6605)


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




Re: [parisc-linux] Breaking PARISC ABI - Testing procedures?

2002-08-27 Thread John David Anglin

> 3- sizeof(long double) is incorrect in gcc and glibc (?)

This also needs to be fixed under 64-bit hpux.  Need to determine
the calling convention for long doubles.

Dave
-- 
J. David Anglin  [EMAIL PROTECTED]
National Research Council of Canada  (613) 990-0752 (FAX: 952-6605)


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