Linux PARISC architecture development
 help / color / mirror / Atom feed
* Re: [parisc-linux] booting problems
       [not found] <no.id>
@ 1999-06-10 18:32 ` Stan Sieler
  1999-06-21 17:03 ` Hack to head.S John David Anglin
                   ` (34 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: Stan Sieler @ 1999-06-10 18:32 UTC (permalink / raw)
  To: parisc-linux; +Cc: kirkb, adevries

Hi,

Re:

> On some X-Windows servers on PCs, pressing F9 will toggle the "25th" line
...

Oops...forgot that I'd customized my keyboard map.

My keyboard map, which tries to add the missing HP keys to a PC keyboard
(running Reflection X) is at:

http://www.allegro.com/sieler/custom.kmp.html

If you use a different X server on a PC (or Mac or Sun or whatever),
you might be interested in a couple of the keycodes that are less
common ... they're listed on the above page.

-- 
Stan Sieler                                          sieler@allegro.com
                                     http://www.allegro.com/sieler.html

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

* Re: Hack to head.S
       [not found] <no.id>
  1999-06-10 18:32 ` [parisc-linux] booting problems Stan Sieler
@ 1999-06-21 17:03 ` John David Anglin
  1999-06-21 19:38 ` John David Anglin
                   ` (33 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 1999-06-21 17:03 UTC (permalink / raw)
  To: John David Anglin; +Cc: Matthew.Wilcox, parisc-linux

> The module init/main.c uses the symbol _stext to determine the
> starting address of the kernel text.  Placing the start in the
> data region will give a totally erroneous result for the length
> of kernel text to profile.  Probably, init/main.c should use
> the origin selected for text when linking (currently, 0x8000)
> as the start of the kernel text.  Then, the kernel entry points
> can be moved back into the standard text space.

It looks like the symbol __text_start can be used by main.c to
determine the start of text when using the HP linker.

-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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

* Re: Hack to head.S
       [not found] <no.id>
  1999-06-10 18:32 ` [parisc-linux] booting problems Stan Sieler
  1999-06-21 17:03 ` Hack to head.S John David Anglin
@ 1999-06-21 19:38 ` John David Anglin
  2000-10-11 20:11 ` [parisc-linux] __hp9000s700 predefined John David Anglin
                   ` (32 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 1999-06-21 19:38 UTC (permalink / raw)
  To: John David Anglin; +Cc: Matthew.Wilcox, parisc-linux

> It looks like the symbol __text_start can be used by main.c to
> determine the start of text when using the HP linker.

Here are two patches which appear to resolve this issue.  I have
tested linking with hpux 9.01.  Somebody needs to check whether
the symbol __text_start is available under 10.X and 11.

-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

*** init/main.c.orig	Tue Feb 16 16:02:22 1999
--- init/main.c	Mon Jun 21 15:27:00 1999
***************
*** 56,62 ****
  #error sorry, your GCC is too old. It builds incorrect kernels.
  #endif
  
! extern char _stext, _etext;
  extern char *linux_banner;
  
  extern int console_loglevel;
--- 56,63 ----
  #error sorry, your GCC is too old. It builds incorrect kernels.
  #endif
  
! extern char __text_start;
! extern char _etext;
  extern char *linux_banner;
  
  extern int console_loglevel;
***************
*** 1132,1138 ****
  	if (prof_shift) {
  		prof_buffer = (unsigned int *) memory_start;
  		/* only text is profiled */
! 		prof_len = (unsigned long) &_etext - (unsigned long) &_stext;
  		prof_len >>= prof_shift;
  		memory_start += prof_len * sizeof(unsigned int);
  		memset(prof_buffer, 0, prof_len * sizeof(unsigned int));
--- 1133,1139 ----
  	if (prof_shift) {
  		prof_buffer = (unsigned int *) memory_start;
  		/* only text is profiled */
! 		prof_len = (unsigned long) &_etext-(unsigned long)&__text_start;
  		prof_len >>= prof_shift;
  		memory_start += prof_len * sizeof(unsigned int);
  		memset(prof_buffer, 0, prof_len * sizeof(unsigned int));
*** arch/parisc/kernel/head.S.orig	Mon Jun 21 10:38:05 1999
--- arch/parisc/kernel/head.S	Mon Jun 21 13:06:43 1999
***************
*** 32,39 ****
  
  ;	.section .text
  
! 	.space $DATA$
! 	.subspa $FLUFFY$,QUAD=1,ALIGN=8,ACCESS=0x2C,SORT=56
  
  	.EXPORT stext,ENTRY,PRIV_LEV=3,RTNVAL=GR
  	.EXPORT _stext,DATA,PRIV_LEV=3,RTNVAL=GR
--- 32,39 ----
  
  ;	.section .text
  
! ;	.space $DATA$
! ;	.subspa $FLUFFY$,QUAD=1,ALIGN=8,ACCESS=0x2C,SORT=56
  
  	.EXPORT stext,ENTRY,PRIV_LEV=3,RTNVAL=GR
  	.EXPORT _stext,DATA,PRIV_LEV=3,RTNVAL=GR

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

* Re: [parisc-linux] __hp9000s700 predefined
       [not found] <no.id>
                   ` (2 preceding siblings ...)
  1999-06-21 19:38 ` John David Anglin
@ 2000-10-11 20:11 ` John David Anglin
  2000-11-09 17:39 ` testcase for hppa64 gcc bug John David Anglin
                   ` (31 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2000-10-11 20:11 UTC (permalink / raw)
  To: John David Anglin; +Cc: grundler, parisc-linux

> > John, is there something specific you are concerned about which
> > can't be handled by the above predefined symbols?
> 
> I was just being cautious about __hp9000s[7-8]00.  I looked at some of
> the uses in the hpux 10.X headers, and for usage in gcc and binutils.  I
> don't see any obvious reason why these two symbols need to be defined
> for linux.
> 
> I believe that the compiler only should predefine symbols that are necessary
> for the control of code generation.  Neither CONFIG_XXX or runtime checks
> will help you for this since gcc only has a limited capability to change
> its code generation at runtime.  There appears to be some model dependence
> in the floating point implementations from one pa machine to another.  If
> this can't all be hidden in the kernel, some further specification of the
> hardware might be needed for floating point.  For example, __i686__ is
> defined on the Pentium Pro and is used in bits/mathinline.h.

There is a nice table listing model numbers, architecture and processor
type in /opt/langtools/lib/sched.models under hpux 11.  It still appears
possible to compile and link a PA1.0 app under hpux 11.  I am guessing
but it looks like there are 5 different PA1.1 float implementations (a-e).

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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

* Re: testcase for hppa64 gcc bug
       [not found] <no.id>
                   ` (3 preceding siblings ...)
  2000-10-11 20:11 ` [parisc-linux] __hp9000s700 predefined John David Anglin
@ 2000-11-09 17:39 ` John David Anglin
  2000-12-06  4:12   ` Jeffrey A Law
  2000-11-09 23:57 ` abort in eliminate_regs compiling glob.c from glibc John David Anglin
                   ` (30 subsequent siblings)
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2000-11-09 17:39 UTC (permalink / raw)
  To: John David Anglin; +Cc: alan, gcc-bugs, gcc-patches, parisc-linux, law

> > So I went down the path of trying to fix things properly by defining
> > ELIMINABLE_REGS and so on, but I ended in a maze of twisty little passages
> > labelled "Unrecognizable instruction", like this one:
> > 
> > /src/parisc/gcc/gcc/libgcc2.c: In function `__moddi3':
> > /src/parisc/gcc/gcc/libgcc2.c:601: Unrecognizable insn:
> > (insn 1289 209 1298 (set (reg:SI 50 %fr22)
> >         (subreg:SI (plus:DI (reg:DI 30 %r30)
> >                 (const_int -272 [0xfffffef0])) 0)) -1 (nil)
> >     (nil))
> > /src/parisc/gcc/gcc/libgcc2.c:601: Internal compiler error in
> > extract_insn, at recog.c:2134
> 
> I am making progress in trying to make the arg_pointer register eliminable.
> I have fixed the above problem.  What was happening was that reload_as_needed
> was incorrectly trying to eliminate the return from millicode calls which
> is also register r29.  I have figured out how to hide it from reload with
> unspec.
> 
> However, the compiler is now too good at eliminating the arg_pointer.  At
> -O3, it completely eliminates the arg_pointer.  However, as I read the ABI,
> the call must always set the arg_pointer before calls.

For the record, here is my final patch regarding making the arg_pointer
eliminable for TARGET_64BIT.  I think the code it generates is correct but
it hasn't been extensively tested.  However, I don't recommend it for
installation since in comparing the assembler code generated with and
without elimination for a couple of test cases, I didn't observe any
significant improvement in the code with the patch.  Possibly, the patch
implicitly disables elimination when the arg_pointer is needed.

I do find that Alan Modra's ARG_POINTER_INVARIANT patch needs to be installed
to get correct code with his test case.

There is one part of the patch below which I think needs to be installed.
That is

	(call, call_value): Always USE the arg_pointer for TARGET_64BIT.

The use for the arg_pointer needs to be pulled out of the `if (flag_pic)'.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2000-11-07  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* pa-linux64.h (ARG_POINTER_INVARIANT): Define even when the
	arg_pointer is being eliminated.
	(ELIMINABLE_REGS): Enable elimination of the arg_pointer.
	(INITIAL_ELIMINATION_OFFSET): Revise offsets for arg_pointer.
	* pa.md (mulsi3, divsi3, udivsi3, modsi3, umodsi3 and
	canonicalize_funcptr_for_compare): Put "(reg:SI 26)" inside
	unspec to prevent elimination.
	(call, call_value): Always USE the arg_pointer for TARGET_64BIT.
	Use the new addmovdi3 insn to load the arg_pointer register.
	(addmovdi3 and mov_from_r29_si): New insn and expand which prevent
	r29 from being eliminated in call setups and millicode returns.

--- pa-linux64.h.orig	Tue Oct 31 18:38:24 2000
+++ pa-linux64.h	Tue Nov  7 12:17:12 2000
@@ -209,21 +209,18 @@
    that grow to lower addresses.  What fun.  */
 #undef ARGS_GROW_DOWNWARD
 #undef ARG_POINTER_REGNUM
-#define ARG_POINTER_INVARIANT 0
 #define ARG_POINTER_REGNUM 29
+#define ARG_POINTER_INVARIANT 0
 #undef STATIC_CHAIN_REGNUM
 #define STATIC_CHAIN_REGNUM 31
 
-#if 1
-#define ARG_POINTER_INVARIANT 0
-#else
-/* If defined, this macro specifies a table of register pairs used to eliminate
-   unneeded registers that point into the stack frame.  */
+/* If defined, this macro specifies a table of register pairs used to
+   eliminate unneeded registers that point into the stack frame.  */
 
 #define ELIMINABLE_REGS							\
 {									\
-  {ARG_POINTER_REGNUM,	 STACK_POINTER_REGNUM},				\
   {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM},				\
+  {ARG_POINTER_REGNUM,	 STACK_POINTER_REGNUM},				\
   {ARG_POINTER_REGNUM,	 FRAME_POINTER_REGNUM},				\
 }
 
@@ -240,19 +237,18 @@
 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
   do								\
     {								\
-      int fsize;						\
+      int fsize = compute_frame_size (get_frame_size (), 0);	\
 								\
       if ((TO) == FRAME_POINTER_REGNUM				\
 	  && (FROM) == ARG_POINTER_REGNUM)			\
 	{							\
-	  (OFFSET) = - current_function_pretend_args_size - 16;	\
+	  (OFFSET) = fsize + 48 - current_function_outgoing_args_size;	\
 	  break;						\
 	}							\
 								\
       if ((TO) != STACK_POINTER_REGNUM)				\
 	abort ();						\
 								\
-      fsize = compute_frame_size (get_frame_size (), 0);	\
       switch (FROM)						\
 	{							\
 	case FRAME_POINTER_REGNUM:				\
@@ -260,14 +256,13 @@
 	  break;						\
 								\
 	case ARG_POINTER_REGNUM:				\
-	  (OFFSET) = - fsize - current_function_pretend_args_size - 16;	\
+	  (OFFSET) = 48 - current_function_outgoing_args_size;  \
 	  break;						\
 								\
 	default:						\
 	  abort ();						\
 	}							\
     } while (0)
-#endif
 
 #undef SELECT_RTX_SECTION
 #define SELECT_RTX_SECTION(MODE,RTX)	\
--- pa.md.orig	Tue Nov  7 13:50:34 2000
+++ pa.md.work	Wed Nov  8 14:06:05 2000
@@ -3993,7 +3993,7 @@
 	      (clobber (reg:SI 26))
 	      (clobber (reg:SI 25))
 	      (clobber (reg:SI 31))])
-   (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
+   (set (match_operand:SI 0 "general_operand" "") (unspec:SI [(reg:SI 29)] 0))]
   ""
   "
 {
@@ -4139,7 +4139,7 @@
 	      (clobber (reg:SI 26))
 	      (clobber (reg:SI 25))
 	      (clobber (reg:SI 31))])
-   (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
+   (set (match_operand:SI 0 "general_operand" "") (unspec:SI [(reg:SI 29)] 0))]
   ""
   "
 {
@@ -4197,7 +4197,7 @@
 	      (clobber (reg:SI 26))
 	      (clobber (reg:SI 25))
 	      (clobber (reg:SI 31))])
-   (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
+   (set (match_operand:SI 0 "general_operand" "") (unspec:SI [(reg:SI 29)] 0))]
   ""
   "
 {
@@ -4255,7 +4255,7 @@
 	      (clobber (reg:SI 26))
 	      (clobber (reg:SI 25))
 	      (clobber (reg:SI 31))])
-   (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
+   (set (match_operand:SI 0 "general_operand" "") (unspec:SI [(reg:SI 29)] 0))]
   ""
   "
 {
@@ -4310,7 +4310,7 @@
 	      (clobber (reg:SI 26))
 	      (clobber (reg:SI 25))
 	      (clobber (reg:SI 31))])
-   (set (match_operand:SI 0 "general_operand" "") (reg:SI 29))]
+   (set (match_operand:SI 0 "general_operand" "") (unspec:SI [(reg:SI 29)] 0))]
   ""
   "
 {
@@ -5785,9 +5785,9 @@
     op = XEXP (operands[0], 0);
 
   if (TARGET_64BIT)
-    emit_move_insn (arg_pointer_rtx,
-		    gen_rtx_PLUS (word_mode, virtual_outgoing_args_rtx,
-				  GEN_INT (64)));
+    emit_insn (gen_addmovdi3 (arg_pointer_rtx,
+			      virtual_outgoing_args_rtx,
+			      GEN_INT (64)));
 
   /* Use two different patterns for calls to explicitly named functions
      and calls through function pointers.  This is necessary as these two
@@ -5809,13 +5809,14 @@
       call_insn = emit_call_insn (gen_call_internal_reg (operands[1]));
     }
 
+  if (TARGET_64BIT)
+    use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), arg_pointer_rtx);
+
   if (flag_pic)
     {
       use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx);
       use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn),
 	       gen_rtx_REG (word_mode, PIC_OFFSET_TABLE_REGNUM_SAVED));
-      if (TARGET_64BIT)
-	use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), arg_pointer_rtx);
 
       /* After each call we must restore the PIC register, even if it
 	 doesn't appear to be used.
@@ -5961,9 +5962,9 @@
     op = XEXP (operands[1], 0);
 
   if (TARGET_64BIT)
-    emit_move_insn (arg_pointer_rtx,
-		    gen_rtx_PLUS (word_mode, virtual_outgoing_args_rtx,
-				  GEN_INT (64)));
+    emit_insn (gen_addmovdi3 (arg_pointer_rtx,
+			      virtual_outgoing_args_rtx,
+			      GEN_INT (64)));
 
   /* Use two different patterns for calls to explicitly named functions
      and calls through function pointers.  This is necessary as these two
@@ -5989,6 +5990,10 @@
       call_insn = emit_call_insn (gen_call_value_internal_reg (operands[0],
 							       operands[2]));
     }
+
+  if (TARGET_64BIT)
+    use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), arg_pointer_rtx);
+
   if (flag_pic)
     {
       use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx);
@@ -7124,7 +7129,7 @@
 	      (clobber (reg:SI 22))
 	      (clobber (reg:SI 31))])
    (set (match_operand:SI 0 "register_operand" "")
-	(reg:SI 29))]
+	(unspec:SI [(reg:SI 29)] 0))]
   "! TARGET_PORTABLE_RUNTIME && !TARGET_64BIT && !TARGET_ELF32"
   "
 {
@@ -7236,3 +7241,48 @@
   emit_insn (gen_blockage ());
   DONE;
 }")
+
+;; For TARGET_64BIT, the arg_pointer register is also used for millicode
+;; returns.  The ABI requires that the arg_pointer be set for all calls.
+;; When the arg_pointer is made an eliminable register, eliminate_regs
+;; will eliminate the arg_pointer register from the function call setup and
+;; millicode returns unless the arg_pointer is hidden in a use, clobber or
+;; unspec.
+
+;; This is for loading the arg_pointer in function calls.
+(define_insn "addmovdi3"
+  [(set (unspec:DI [(match_operand:DI 0 "register_operand" "=r,r")] 0)
+        (plus:DI (match_operand:DI 1 "register_operand" "r,r")
+		 (match_operand 2 "const_int_operand" "J,i")))
+   (set (match_dup 0) (match_dup 0))]
+  "TARGET_64BIT"
+  "@
+  ldo %2(%1),%0
+  ldil L'%G2,%0\;add,l %0,%1,%0"
+  [(set_attr "type" "binary,binary")
+   (set_attr "pa_combine_type" "addmove,none")
+   (set_attr "length" "4,8")])
+
+;; This is for millicode return.
+(define_expand "mov_from_r29_si"
+  [(set (match_operand:SI 0 "" "")
+        (unspec:SI [(reg:SI 29)] 0))]
+  ""
+  "
+{
+  if (!TARGET_64BIT)
+    {
+      rtx tmp = gen_rtx_REG (SImode, 29);
+      emit_insn (gen_movsi (operands[0], tmp));
+      DONE;
+    }
+}")
+
+(define_insn ""
+  [(set (match_operand:SI 0 "register_operand" "=r")
+	(unspec:SI [(reg:SI 29)] 0))]
+  ""
+  "copy %%r29,%0"
+  [(set_attr "type" "multi")
+   (set_attr "length" "4")])
+

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

* Re: abort in eliminate_regs compiling glob.c from glibc
       [not found] <no.id>
                   ` (4 preceding siblings ...)
  2000-11-09 17:39 ` testcase for hppa64 gcc bug John David Anglin
@ 2000-11-09 23:57 ` John David Anglin
  2000-11-10  0:36   ` Alan Modra
  2000-11-14 21:40   ` John David Anglin
  2000-12-14  0:48 ` pa reload problem John David Anglin
                   ` (29 subsequent siblings)
  35 siblings, 2 replies; 194+ messages in thread
From: John David Anglin @ 2000-11-09 23:57 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux, gcc-bugs

> Breakpoint 2, eliminate_regs_in_insn (insn=0x406a0ba0, replace=0)
>     at ../../gcc/reload1.c:2826
> 2826      if (! insn_is_asm && icode < 0)
> (gdb) p debug_rtx (insn)
> (insn/s 2711 2709 2719 (set (reg:SI 6 %r6)
>         (reg:SI 28 %r28)) 69 {pre_ldw-4} (insn_list 2708 (insn_list:REG_DEP_ANTI 2696 (insn_list:REG_DEP_ANTI 2702 (insn_list:REG_DEP_ANTI 2697 (nil)))))
>     (expr_list:REG_DEAD (reg:SI 28 %r28)
>         (insn_list:REG_RETVAL 2708 (expr_list:REG_EQUAL (expr_list (use (mem:BLK (scratch) 0))
>                     (expr_list (symbol_ref/v:SI ("@strlen"))
>                         (expr_list (reg/v:SI 4 %r4)
>                             (nil))))
>                 (nil)))))

The `use' arises from the `__pure__' attribute in the prototype for strlen:

extern size_t strlen (__const char *__s) __attribute__ ((__pure__));

Still haven't been able to figure out why the REG notes are processed or
a simple test case.  The cpp'd input is attached.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

begin 644 glob.i.gz
M'XL("('T"CH``V=L;V(N:0#M??MWV[:2\._Z*]CFG%[+<1I+\BO5MO>XB9/X
MJV-G;:>]W6P.#RU1-F\D4B4I.]DV^[=_>#\'("DQS6/%O9M:P&`P&`"#P6`P
MN!?T@F^___YA\;X8Q_/BX76<QGDR>G@]S:Z^'WW;N<?RDW0T78SCA]/D:O2@
M>#^[RJ;%]S??!CT$T?>"=!#$SKX?@GZDKH<WV2Q^.(YNXX?SQ622I(@4!/XP
MN_KW.,D?CK)TDES3FAW?O6`PJ(_'+KU[T*#TO6"_`=$(_&!G:=H0?_K;*[5L
MU]N7?1='5_H0U3L'=;I_I3KZ_7YK=2!L^X^6PW;//YT0BQ'$(^^,`_%Q0N(\
M3S,Q[P9@GJ/H)([*11Z+6=M[Y,K&90_VW+F?^X<X8XQTFWS<Q]OUFF@R$G7<
MP]$XGDA.DNQ94HR`O$=P9JUF[.TN41C5N;WG*8?R>P=+$^6HLN_F$![R?2SU
M'&,1D#I(@O?ZGLY!^=OPM.@+#/H\7*3)._SC%DWE=/'NX552%L9DVJY?0*G#
M%L847DH._$O6%`QJ%XV*F57P,_O0DM*8!7W<$L1O<!WTEAR0&OM[#7I6'USQ
MNS+.TR!)RX!`#/6TS3`DR>$T&T5EDJ7!QFV6C+M!&$9EF2=7BS(.PV!C(PS1
M(EN48=CM#AU\&>S[!RA`UN@FRH/->9Y=Y]$L3-);1D681K-X"\PI;K*\)/D&
M'>7[>8PF(&]JEH?ED!$VJ%Z@K,F,T1GB;IX5E/%Z)EN3[%S)FAHS$T)9JX!:
MR<-%D3_$73F5H^OJX?5H]`#_]V8^CQY0#/WO'^W)YI9CQ#@^Y:BD6143P?.H
M'3Q8EUH=3_.)WMO>:;EBK,[NMXD3:YIM$]GDXY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@;"EJO`6!@FFQUCZBJD#R->O^&IOA,L7ZV`+KZEM
M5+Z<<)_K$=6OJ]F/J:DKN_4R6N/5G82.&S(M1K<K#Z7N)I42B;/RK0*##??O
MOU%0*4;*IHBL)_0L/,;;>6)$X#A?N#!H%1?/`U![ON_M"/OU+]4.JIHY1].L
MB#4[)V^U9N\.!:!EY)0'4XX3`ZQZHG91/C#+O*KZ_C,88"LVSE9'``Z91]O#
M(Z!Y.>-O=)TF*PVN;&YE4RE'F)$<&KQVAZE:L.M!#B,DI%*D:^K[RIR0720C
.#:+Q]O\!-6U&P&H/`P!E
`
end

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

* Re: abort in eliminate_regs compiling glob.c from glibc
  2000-11-09 23:57 ` abort in eliminate_regs compiling glob.c from glibc John David Anglin
@ 2000-11-10  0:36   ` Alan Modra
  2000-11-10  2:50     ` John David Anglin
  2000-11-14 21:40   ` John David Anglin
  1 sibling, 1 reply; 194+ messages in thread
From: Alan Modra @ 2000-11-10  0:36 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux

On Thu, 9 Nov 2000, John David Anglin wrote:

> > Breakpoint 2, eliminate_regs_in_insn (insn=0x406a0ba0, replace=0)
> >     at ../../gcc/reload1.c:2826
> > 2826      if (! insn_is_asm && icode < 0)
> > (gdb) p debug_rtx (insn)
> > (insn/s 2711 2709 2719 (set (reg:SI 6 %r6)
> >         (reg:SI 28 %r28)) 69 {pre_ldw-4} (insn_list 2708 (insn_list:REG_DEP_ANTI 2696 (insn_list:REG_DEP_ANTI 2702 (insn_list:REG_DEP_ANTI 2697 (nil)))))
> >     (expr_list:REG_DEAD (reg:SI 28 %r28)
> >         (insn_list:REG_RETVAL 2708 (expr_list:REG_EQUAL (expr_list (use (mem:BLK (scratch) 0))
> >                     (expr_list (symbol_ref/v:SI ("@strlen"))
> >                         (expr_list (reg/v:SI 4 %r4)
> >                             (nil))))
> >                 (nil)))))
> 
> The `use' arises from the `__pure__' attribute in the prototype for strlen:
> 
> extern size_t strlen (__const char *__s) __attribute__ ((__pure__));

I don't see this problem using current puffin CVS hppa64-linux gcc.  Was
this with your REG_ELIMINATE patch?

Alan Modra
-- 
Linuxcare.  Support for the Revolution.

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

* Re: abort in eliminate_regs compiling glob.c from glibc
  2000-11-10  0:36   ` Alan Modra
@ 2000-11-10  2:50     ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2000-11-10  2:50 UTC (permalink / raw)
  To: Alan Modra; +Cc: parisc-linux

> > > 2826      if (! insn_is_asm && icode < 0)
> > > (gdb) p debug_rtx (insn)
> > > (insn/s 2711 2709 2719 (set (reg:SI 6 %r6)
> > >         (reg:SI 28 %r28)) 69 {pre_ldw-4} (insn_list 2708 (insn_list:REG_DEP_ANTI 2696 (insn_list:REG_DEP_ANTI 2702 (insn_list:REG_DEP_ANTI 2697 (nil)))))
> > >     (expr_list:REG_DEAD (reg:SI 28 %r28)
> > >         (insn_list:REG_RETVAL 2708 (expr_list:REG_EQUAL (expr_list (use (mem:BLK (scratch) 0))
> > >                     (expr_list (symbol_ref/v:SI ("@strlen"))
> > >                         (expr_list (reg/v:SI 4 %r4)
> > >                             (nil))))
> > >                 (nil)))))
> > 
> > The `use' arises from the `__pure__' attribute in the prototype for strlen:
> > 
> > extern size_t strlen (__const char *__s) __attribute__ ((__pure__));
> 
> I don't see this problem using current puffin CVS hppa64-linux gcc.  Was
> this with your REG_ELIMINATE patch?

No.  Well actually I saw it first with the patch.  I see this with the
32 bit compiler.  The only elimination with the 32 bit compiler is the
default frame pointer elimination.

I just tried the hppa64-linux-gcc compiler with the source that I posted
and it didn't abort.  There were lots of warnings about int to pointer
conversions though.

Make sure you compile with -O2 or -O3?  Register elimination only occurs
at -O2 or above.  I see the problem both with a i686-linux cross compiler
and a fairly recent native hpux compiler under hpux 10.20.  The problem is
not present in 2.95.2 but it doesn't support the pure atribute.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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

* Re: abort in eliminate_regs compiling glob.c from glibc
  2000-11-09 23:57 ` abort in eliminate_regs compiling glob.c from glibc John David Anglin
  2000-11-10  0:36   ` Alan Modra
@ 2000-11-14 21:40   ` John David Anglin
  2001-01-27 20:12     ` Richard Henderson
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2000-11-14 21:40 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux, gcc-bugs, gcc-patches

> > Breakpoint 2, eliminate_regs_in_insn (insn=0x406a0ba0, replace=0)
> >     at ../../gcc/reload1.c:2826
> > 2826      if (! insn_is_asm && icode < 0)
> > (gdb) p debug_rtx (insn)
> > (insn/s 2711 2709 2719 (set (reg:SI 6 %r6)
> >         (reg:SI 28 %r28)) 69 {pre_ldw-4} (insn_list 2708 (insn_list:REG_DEP_ANTI 2696 (insn_list:REG_DEP_ANTI 2702 (insn_list:REG_DEP_ANTI 2697 (nil)))))
> >     (expr_list:REG_DEAD (reg:SI 28 %r28)
> >         (insn_list:REG_RETVAL 2708 (expr_list:REG_EQUAL (expr_list (use (mem:BLK (scratch) 0))
> >                     (expr_list (symbol_ref/v:SI ("@strlen"))
> >                         (expr_list (reg/v:SI 4 %r4)
> >                             (nil))))
> >                 (nil)))))
> 
> The `use' arises from the `__pure__' attribute in the prototype for strlen:
> 
> extern size_t strlen (__const char *__s) __attribute__ ((__pure__));

Here is a patch to fix the abort in eliminate_regs when it encounters a USE.
As I understand the situation, there are three conditions needed to trigger
it:

1)	A function that contains insns with an eliminable register.
2)	The function must call __builtin_alloca to change the frame size
	from its initial size.
3)	After the call to __builtin_alloca, there must be a call to a
	pure function.

With the enclosed patch, I can now build glibc for hppa-linux with -O3
optimisation.

Please review carefully because I will be the first to admit that I don't
understand why the use is there in the first place and all the details of
what eliminate_reg does.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2000-11-14  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* reload1.c (eliminate_regs): Don't abort on MEM USEs.

--- reload1.c.orig	Wed Sep 27 14:27:23 2000
+++ reload1.c	Tue Nov 14 16:01:56 2000
@@ -2499,6 +2499,10 @@
 	return x;
 
     case USE:
+      /* Handle insn_list USE that a call to a pure functions may generate. */
+      new = eliminate_regs (XEXP (x, 0), 0, insn);
+      if (GET_CODE (new) == MEM)
+	return XEXP (new, 0);
     case CLOBBER:
     case ASM_OPERANDS:
     case SET:

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

* Re: testcase for hppa64 gcc bug
  2000-11-09 17:39 ` testcase for hppa64 gcc bug John David Anglin
@ 2000-12-06  4:12   ` Jeffrey A Law
  2000-12-06  4:14     ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Jeffrey A Law @ 2000-12-06  4:12 UTC (permalink / raw)
  To: John David Anglin; +Cc: alan, gcc-bugs, gcc-patches, parisc-linux


  In message <200011091739.MAA07483@hiauly1.hia.nrc.ca>you write:
  > For the record, here is my final patch regarding making the arg_pointer
  > eliminable for TARGET_64BIT.  I think the code it generates is correct but
  > it hasn't been extensively tested.  However, I don't recommend it for
  > installation since in comparing the assembler code generated with and
  > without elimination for a couple of test cases, I didn't observe any
  > significant improvement in the code with the patch.  Possibly, the patch
  > implicitly disables elimination when the arg_pointer is needed.
  > 
  > I do find that Alan Modra's ARG_POINTER_INVARIANT patch needs to be install
  > ed
  > to get correct code with his test case.
  > 
  > There is one part of the patch below which I think needs to be installed.
  > That is
  > 
  > 	(call, call_value): Always USE the arg_pointer for TARGET_64BIT.
  > 
  > The use for the arg_pointer needs to be pulled out of the `if (flag_pic)'.
  > 
  > Dave
  > -- 
  > J. David Anglin                                  dave.anglin@nrc.ca
  > National Research Council of Canada              (613) 990-0752 (FAX: 952-6
  > 605)
  > 
  > 2000-11-07  John David Anglin  <dave@hiauly1.hia.nrc.ca>
  > 
  > 	* pa-linux64.h (ARG_POINTER_INVARIANT): Define even when the
  > 	arg_pointer is being eliminated.
  > 	(ELIMINABLE_REGS): Enable elimination of the arg_pointer.
  > 	(INITIAL_ELIMINATION_OFFSET): Revise offsets for arg_pointer.
  > 	* pa.md (mulsi3, divsi3, udivsi3, modsi3, umodsi3 and
  > 	canonicalize_funcptr_for_compare): Put "(reg:SI 26)" inside
  > 	unspec to prevent elimination.
  > 	(call, call_value): Always USE the arg_pointer for TARGET_64BIT.
  > 	Use the new addmovdi3 insn to load the arg_pointer register.
  > 	(addmovdi3 and mov_from_r29_si): New insn and expand which prevent
  > 	r29 from being eliminated in call setups and millicode returns.
I haven't followed this discussion too closely.  Is this patch still needed
after some of the recent changes in how we compute liveness for the argument
pointer?
jeff

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

* Re: testcase for hppa64 gcc bug
  2000-12-06  4:12   ` Jeffrey A Law
@ 2000-12-06  4:14     ` John David Anglin
  2000-12-06  5:28       ` Alan Modra
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2000-12-06  4:14 UTC (permalink / raw)
  To: law; +Cc: alan, gcc-bugs, gcc-patches, parisc-linux

>   > 2000-11-07  John David Anglin  <dave@hiauly1.hia.nrc.ca>
>   > 
>   > 	* pa-linux64.h (ARG_POINTER_INVARIANT): Define even when the
>   > 	arg_pointer is being eliminated.
>   > 	(ELIMINABLE_REGS): Enable elimination of the arg_pointer.
>   > 	(INITIAL_ELIMINATION_OFFSET): Revise offsets for arg_pointer.
>   > 	* pa.md (mulsi3, divsi3, udivsi3, modsi3, umodsi3 and
>   > 	canonicalize_funcptr_for_compare): Put "(reg:SI 26)" inside
>   > 	unspec to prevent elimination.
>   > 	(call, call_value): Always USE the arg_pointer for TARGET_64BIT.
>   > 	Use the new addmovdi3 insn to load the arg_pointer register.
>   > 	(addmovdi3 and mov_from_r29_si): New insn and expand which prevent
>   > 	r29 from being eliminated in call setups and millicode returns.
> I haven't followed this discussion too closely.  Is this patch still needed
> after some of the recent changes in how we compute liveness for the argument
> pointer?

I think this needs to be reexamined.  Allan's ARG_POINTER_INVARIANT patch
might not be needed now.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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

* Re: testcase for hppa64 gcc bug
  2000-12-06  4:14     ` John David Anglin
@ 2000-12-06  5:28       ` Alan Modra
  2001-02-01  1:19         ` [parisc-linux] " Jeffrey A Law
  0 siblings, 1 reply; 194+ messages in thread
From: Alan Modra @ 2000-12-06  5:28 UTC (permalink / raw)
  To: John David Anglin; +Cc: law, gcc-bugs, gcc-patches, parisc-linux

On Tue, 5 Dec 2000, John David Anglin wrote:

> >   > 2000-11-07  John David Anglin  <dave@hiauly1.hia.nrc.ca>
> >   > 
> >   > 	* pa-linux64.h (ARG_POINTER_INVARIANT): Define even when the
> >   > 	arg_pointer is being eliminated.
> >   > 	(ELIMINABLE_REGS): Enable elimination of the arg_pointer.
> >   > 	(INITIAL_ELIMINATION_OFFSET): Revise offsets for arg_pointer.
> >   > 	* pa.md (mulsi3, divsi3, udivsi3, modsi3, umodsi3 and
> >   > 	canonicalize_funcptr_for_compare): Put "(reg:SI 26)" inside
> >   > 	unspec to prevent elimination.
> >   > 	(call, call_value): Always USE the arg_pointer for TARGET_64BIT.
> >   > 	Use the new addmovdi3 insn to load the arg_pointer register.
> >   > 	(addmovdi3 and mov_from_r29_si): New insn and expand which prevent
> >   > 	r29 from being eliminated in call setups and millicode returns.
> > I haven't followed this discussion too closely.  Is this patch still needed
> > after some of the recent changes in how we compute liveness for the argument
> > pointer?
> 
> I think this needs to be reexamined.  Allan's ARG_POINTER_INVARIANT patch
> might not be needed now.

It's still needed.  The problem is that gcc thinks the arg pointer is
unchanged from the entry value to a function, even when the arg pointer
needs to be set to call other functions.

Actually, given the nature of the problem, I'm inclined to think that all
targets that use an arg pointer should probably define
ARG_POINTER_INVARIANT = 0.  Or equivalently, don't apply my
ARG_POINTER_INVARIANT patch and simply remove tests for arg_pointer_rtx in
rtx_unstable_p, rtx_varies_p, rtx_addr_can_trap_p, function_invariant_p,
loop_invariant_p, and possibly other places I've missed.

Here's the testcase again:

extern void abort(void);

char p;

int f1 (char **);
int f2 (char *, char **);

char *f3 (char *a, char *b)
{
  char *c = 0;

  if (f1 (&b) != 0)
    goto out;

  /* hppa64 passes bogus value for b */
  f2 (b, &c);

out:
  return c;
}

int f1 (char **x)
{
  if (*x != &p)
    abort ();
  return 0;
}

int f2 (char *a, char **b)
{
  if (a != &p)
    abort ();
  *b += 1;
  return 0;
}

int main (void)
{
  if (f3 (0, &p) != (char *) 0 + 1)
    abort ();
  return 0;
}

Results of compiling with -O2 -S for hppa64-hpux11-gcc built from CVS
of less that an hour ago.

	.LEVEL 2.0w
gcc2_compiled.:
	.IMPORT f1,ENTRY
	.IMPORT f2,ENTRY
	.text
	.align 8
	.EXPORT f3,ENTRY
f3
	.PROC
	.CALLINFO FRAME=128,CALLS,SAVE_RP,ENTRY_GR=3
	.ENTRY
	std %r2,-16(%r30)
	ldo -56(%r29),%r26	! r26 = &b = r29 - 56
	ldo 128(%r30),%r30
	std %r4,-104(%r30)
	copy %r27,%r4
	std %r25,-56(%r29)
	ldo -16(%r30),%r29
	b,l f1,%r2
	std %r0,-120(%r30)
	ldo -16(%r30),%r29	! arg pointer set to current frame
	ldo -120(%r30),%r25
	cmpib,= 0,%r28,L$0005
	copy %r4,%r27
L$0004
	ldd -120(%r30),%r28
L$0006
	ldd -144(%r30),%r2
	ldd -104(%r30),%r4
	bve (%r2)
	ldo -128(%r30),%r30
L$0005
	ldo -64(%r29),%r29	! r29 = curr_r30 - 16 - 64
	b,l f2,%r2
	ldd 8(%r29),%r26	! try to load b from r29 - 56, but
				! gcc misses fact that r29 has changed
	b L$0006
	ldd -120(%r30),%r28
	.EXIT
	.PROCEND
[snip]

-- 
Linuxcare.  Support for the Revolution.

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

* Re: pa reload problem
       [not found] <no.id>
                   ` (5 preceding siblings ...)
  2000-11-09 23:57 ` abort in eliminate_regs compiling glob.c from glibc John David Anglin
@ 2000-12-14  0:48 ` John David Anglin
  2000-12-14  3:43   ` Jeffrey A Law
  2002-01-07 18:39 ` [parisc-linux] PIC assembly John David Anglin
                   ` (28 subsequent siblings)
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2000-12-14  0:48 UTC (permalink / raw)
  To: John David Anglin; +Cc: law, rth, alan, rhirst, parisc-linux, gcc-bugs

> I was going to deleting the hack and adding a general_operand test in
> local-alloc to see if that would fix the reload problem with "-fPIC".
> However, for the moment, there are still problems with a "normal" build
> at "-O3".  With only the yesterdays CVS source and the patch below
> to prevent rename registers walking of the return pointer, I get the
> following failure building libstdc++ v2:
> 
> /xxx/gnu/gcc-2.97/objdir/gcc/g++ -B/xxx/gnu/gcc-2.97/objdir/gcc/ -nostdinc++ -isystem /xxx/gnu/gcc-2.97/libstdc++ -isystem /xxx/gnu/gcc-2.97/libstdc++/std -isystem /xxx/gnu/gcc-2.97/libstdc++/stl -isystem /xxx/gnu/gcc-2.97/libio -isystem /xxx/gnu/gcc-2.97/objdir/hppa1.1-hp-hpux10.20/libio -L/xxx/gnu/gcc-2.97/objdir/hppa1.1-hp-hpux10.20/libstdc++ -B/usr/local/hppa1.1-hp-hpux10.20/bin/ -B/usr/local/hppa1.1-hp-hpux10.20/lib/ -isystem /usr/local/hppa1.1-hp-hpux10.20/include -c -O3 -fno-implicit-templates -I../../../libstdc++ -I../../../libstdc++/stl -I../libio -I../../../libstdc++/../libio -I../../../libstdc++/../include -I../../../libstdc++/../gcc -nostdinc++  ../../../libstdc++/exception.cc
> ../../../libstdc++/exception.cc: In function `void __check_eh_spec(int, const 
>    void**)':
> ../../../libstdc++/exception.cc:363: Internal error: Segmentation fault.

I have made some progress in locating this bug but still don't have a
complete understanding of the problem.  The problem is that a code_label
insn is "incorrectly" deleted in the loop pass.  Here is the rtl from
the gcse pass:

[snip]

(code_label 1158 1268 1439 124 "" "" [3 uses])

(note 1439 1158 262 [bb 12] NOTE_INSN_BASIC_BLOCK -1347440721)

(note 262 1439 1159 85 NOTE_INSN_EH_REGION_END -1347440721)

[snip]

(insn 788 787 789 (set (reg/f:SI 209)
        (high:SI (label_ref:SI 1158))) 87 {*pa.md:2435} (nil)
    (expr_list:REG_EQUAL (high:SI (label_ref:SI 1158))
        (insn_list:REG_LABEL 1158 (nil))))

(insn 789 788 791 (set (reg/f:SI 208)
        (lo_sum:SI (reg/f:SI 209)
            (label_ref:SI 1158))) 90 {*pa.md:2467} (nil)
    (insn_list:REG_LABEL 1158 (expr_list:REG_EQUAL (label_ref:SI 1158)
            (nil))))

Here is the rtl after loop:

Loop from 576 to 1288: 105 real insns.
Continue at insn 1278.

[snip]

Insn 788: regno 209 (life 2), move-insn savings 2  moved to 1530
Insn 789: regno 208 (life 1), move-insn forces 788 savings 1  moved to 1532

[snip]

(insn 1531 1528 1532 (set (reg/f:SI 337)
        (high:SI (label_ref:SI 1158))) -1 (nil)
    (expr_list:REG_LABEL (code_label/v 1158 1268 1439 124 "" "" [0 uses])
        (nil)))

(insn 1532 1531 1535 (set (reg/f:SI 208)
        (lo_sum:SI (reg/f:SI 337)
            (label_ref:SI 1158))) -1 (nil)
    (expr_list:REG_EQUAL (label_ref:SI 1158)
        (expr_list:REG_LABEL (code_label/v 1158 1268 1439 124 "" "" [0 uses])
            (nil))))

The code_label 1158 is deleted by delete_trivially_dead_insns apparently 
because the preceding call to loop_optimize in toplev.c has reduced the
number of uses to 1.  Maybe somebody can see how this occurs.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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

* Re: pa reload problem
  2000-12-14  0:48 ` pa reload problem John David Anglin
@ 2000-12-14  3:43   ` Jeffrey A Law
  2000-12-14 16:40     ` John David Anglin
  2000-12-16 20:38     ` [parisc-linux] PATCH: Adjust label usage count for new insns [was Re: pa reload problem] John David Anglin
  0 siblings, 2 replies; 194+ messages in thread
From: Jeffrey A Law @ 2000-12-14  3:43 UTC (permalink / raw)
  To: John David Anglin; +Cc: rth, alan, rhirst, parisc-linux, gcc-bugs


  In message <200012140048.TAA02603@hiauly1.hia.nrc.ca>you write:
  > I have made some progress in locating this bug but still don't have a
  > complete understanding of the problem.  The problem is that a code_label
  > insn is "incorrectly" deleted in the loop pass.  Here is the rtl from
  > the gcse pass:
  > 
  > [snip]
  > 
  > (code_label 1158 1268 1439 124 "" "" [3 uses])
  > 
  > (note 1439 1158 262 [bb 12] NOTE_INSN_BASIC_BLOCK -1347440721)
  > 
  > (note 262 1439 1159 85 NOTE_INSN_EH_REGION_END -1347440721)
  > 
  > [snip]
  > 
  > (insn 788 787 789 (set (reg/f:SI 209)
  >         (high:SI (label_ref:SI 1158))) 87 {*pa.md:2435} (nil)
  >     (expr_list:REG_EQUAL (high:SI (label_ref:SI 1158))
  >         (insn_list:REG_LABEL 1158 (nil))))
  > 
  > (insn 789 788 791 (set (reg/f:SI 208)
  >         (lo_sum:SI (reg/f:SI 209)
  >             (label_ref:SI 1158))) 90 {*pa.md:2467} (nil)
  >     (insn_list:REG_LABEL 1158 (expr_list:REG_EQUAL (label_ref:SI 1158)
  >             (nil))))
  > 
  > Here is the rtl after loop:
  > 
  > Loop from 576 to 1288: 105 real insns.
  > Continue at insn 1278.
  > 
  > [snip]
  > 
  > Insn 788: regno 209 (life 2), move-insn savings 2  moved to 1530
  > Insn 789: regno 208 (life 1), move-insn forces 788 savings 1  moved to 1532
  > 
  > [snip]
  > 
  > (insn 1531 1528 1532 (set (reg/f:SI 337)
  >         (high:SI (label_ref:SI 1158))) -1 (nil)
  >     (expr_list:REG_LABEL (code_label/v 1158 1268 1439 124 "" "" [0 uses])
  >         (nil)))
  > 
  > (insn 1532 1531 1535 (set (reg/f:SI 208)
  >         (lo_sum:SI (reg/f:SI 337)
  >             (label_ref:SI 1158))) -1 (nil)
  >     (expr_list:REG_EQUAL (label_ref:SI 1158)
  >         (expr_list:REG_LABEL (code_label/v 1158 1268 1439 124 "" "" [0 uses
  > ])
  >             (nil))))
  > 
  > The code_label 1158 is deleted by delete_trivially_dead_insns apparently 
  > because the preceding call to loop_optimize in toplev.c has reduced the
  > number of uses to 1.  Maybe somebody can see how this occurs.
Seems to me we have a reference counting problem.  There is clearly 
a reference to label 1158 (insn 1531/1532), but it's reference count
is zero.

Seems to me that if you find that reference counting bug that you'll
fix this problem.

jeff

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

* Re: pa reload problem
  2000-12-14  3:43   ` Jeffrey A Law
@ 2000-12-14 16:40     ` John David Anglin
  2000-12-27 20:08       ` Jeffrey A Law
  2000-12-16 20:38     ` [parisc-linux] PATCH: Adjust label usage count for new insns [was Re: pa reload problem] John David Anglin
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2000-12-14 16:40 UTC (permalink / raw)
  To: law; +Cc: rth, alan, rhirst, parisc-linux, gcc-bugs

>   In message <200012140048.TAA02603@hiauly1.hia.nrc.ca>you write:
>   > I have made some progress in locating this bug but still don't have a
>   > complete understanding of the problem.  The problem is that a code_label
>   > insn is "incorrectly" deleted in the loop pass.  Here is the rtl from
>   > the gcse pass:
>   > 
>   > [snip]
>   > 
>   > (code_label 1158 1268 1439 124 "" "" [3 uses])
>   > 
>   > (note 1439 1158 262 [bb 12] NOTE_INSN_BASIC_BLOCK -1347440721)
>   > 
>   > (note 262 1439 1159 85 NOTE_INSN_EH_REGION_END -1347440721)
>   > 
>   > [snip]
>   > 
>   > (insn 788 787 789 (set (reg/f:SI 209)
>   >         (high:SI (label_ref:SI 1158))) 87 {*pa.md:2435} (nil)
>   >     (expr_list:REG_EQUAL (high:SI (label_ref:SI 1158))
>   >         (insn_list:REG_LABEL 1158 (nil))))
>   > 
>   > (insn 789 788 791 (set (reg/f:SI 208)
>   >         (lo_sum:SI (reg/f:SI 209)
>   >             (label_ref:SI 1158))) 90 {*pa.md:2467} (nil)
>   >     (insn_list:REG_LABEL 1158 (expr_list:REG_EQUAL (label_ref:SI 1158)
>   >             (nil))))
>   > 
>   > Here is the rtl after loop:
>   > 
>   > Loop from 576 to 1288: 105 real insns.
>   > Continue at insn 1278.
>   > 
>   > [snip]
>   > 
>   > Insn 788: regno 209 (life 2), move-insn savings 2  moved to 1530
>   > Insn 789: regno 208 (life 1), move-insn forces 788 savings 1  moved to 1532
>   > 
>   > [snip]
>   > 
>   > (insn 1531 1528 1532 (set (reg/f:SI 337)
>   >         (high:SI (label_ref:SI 1158))) -1 (nil)
>   >     (expr_list:REG_LABEL (code_label/v 1158 1268 1439 124 "" "" [0 uses])
>   >         (nil)))
>   > 
>   > (insn 1532 1531 1535 (set (reg/f:SI 208)
>   >         (lo_sum:SI (reg/f:SI 337)
>   >             (label_ref:SI 1158))) -1 (nil)
>   >     (expr_list:REG_EQUAL (label_ref:SI 1158)
>   >         (expr_list:REG_LABEL (code_label/v 1158 1268 1439 124 "" "" [0 uses
>   > ])
>   >             (nil))))
>   > 
>   > The code_label 1158 is deleted by delete_trivially_dead_insns apparently 
>   > because the preceding call to loop_optimize in toplev.c has reduced the
>   > number of uses to 1.  Maybe somebody can see how this occurs.
> Seems to me we have a reference counting problem.  There is clearly 
> a reference to label 1158 (insn 1531/1532), but it's reference count
> is zero.

That's what I thought.  It would appear to occur when the above two insns
get moved out of a loop.  The count gets decremented when the old insns
are deleted but not incremented when the new insns are created.  The puzzle
is why the count is zero rather than 1.  Maybe what happens is the two
insns in the loop are deleted first, then the label is deleted?  Notice
that insn 788 is moved to insn 1530.  However, the insn becomes 1531 and
the reg changes to 337 from 208.

I will try to step through the code later.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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

* [parisc-linux] PATCH: Adjust label usage count for new insns [was Re: pa reload problem]
  2000-12-14  3:43   ` Jeffrey A Law
  2000-12-14 16:40     ` John David Anglin
@ 2000-12-16 20:38     ` John David Anglin
  2001-01-02  9:51       ` Jeffrey A Law
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2000-12-16 20:38 UTC (permalink / raw)
  To: law; +Cc: rth, alan, rhirst, parisc-linux, gcc-bugs

>   > Here is the rtl after loop:

>   > (insn 1531 1528 1532 (set (reg/f:SI 337)
>   >         (high:SI (label_ref:SI 1158))) -1 (nil)
>   >     (expr_list:REG_LABEL (code_label/v 1158 1268 1439 124 "" "" [0 uses])
>   >         (nil)))
>   > 
>   > (insn 1532 1531 1535 (set (reg/f:SI 208)
>   >         (lo_sum:SI (reg/f:SI 337)
>   >             (label_ref:SI 1158))) -1 (nil)
>   >     (expr_list:REG_EQUAL (label_ref:SI 1158)
>   >         (expr_list:REG_LABEL (code_label/v 1158 1268 1439 124 "" "" [0 uses
>   > ])
>   >             (nil))))
>   > 
>   > The code_label 1158 is deleted by delete_trivially_dead_insns apparently 
>   > because the preceding call to loop_optimize in toplev.c has reduced the
>   > number of uses to 1.  Maybe somebody can see how this occurs.
> Seems to me we have a reference counting problem.  There is clearly 
> a reference to label 1158 (insn 1531/1532), but it's reference count
> is zero.

These insns result from "moving" insns with label_ref's out of a loop.  The
old insns are deleted by delete_insn which reduces the LABEL_NUSES count.
However, the LABEL_NUSES count is not incremented when the new insns
are created.  This leaves the number of uses of the label at 1 and
delete_trivially_dead_insns deletes the code_label after loop_optimize
completes.

The simplest solution is to modify add_label_notes to increment the usage
count for CODE_LABEL's.  As far as I can tell, add_label_notes is only
used in loop.c when a new insn is created and an old one deleted.  An
alternative solution might be to actually move the old insn in the list
rather than deleting it.

There appears to be a similar situation in gcse.c.

I have run a complete bootstrap and check at -O3 under hpux 10.20 with this
patch and the patch previously posted at
<http://gcc.gnu.org/ml/gcc-bugs/2000-12/msg00156.html>.  It fixes register
rename walking over the return pointer.  The test results are here
<http://gcc.gnu.org/ml/gcc-testresults/2000-12/msg00172.html>.  I have also
run a complete bootstrap and check under i686 linux.

Please review and install if OK.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

2000-12-14  John David Anglin  <dave@hiauly1.hia.nrc.ca>

	* loop.c (add_label_notes): Increment the label usage count when
	a note is added to an insn which refers to a CODE_LABEL.
	* gcse.c (add_label_notes): Likewise.

--- loop.c.orig	Thu Nov 30 12:22:29 2000
+++ loop.c	Fri Dec 15 17:25:46 2000
@@ -1589,7 +1589,8 @@
 }
 \f
 /* If X contains any LABEL_REF's, add REG_LABEL notes for them to all
-  insns in INSNS which use the reference.  */
+   insns in INSNS which use the reference.  LABEL_NUSES for CODE_LABEL
+   references is incremented once for each added note. */
 
 static void
 add_label_notes (x, insns)
@@ -1610,8 +1611,12 @@
          mark_jump_label for additional information).  */
       for (insn = insns; insn; insn = NEXT_INSN (insn))
 	if (reg_mentioned_p (XEXP (x, 0), insn))
-	  REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL, XEXP (x, 0),
-						REG_NOTES (insn));
+	  {
+	    REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL, XEXP (x, 0),
+						  REG_NOTES (insn));
+	    if (LABEL_P (XEXP (x, 0)))
+	      LABEL_NUSES (XEXP (x, 0))++;
+	  }
     }
 
   fmt = GET_RTX_FORMAT (code);
--- gcse.c.orig	Wed Dec  6 16:16:30 2000
+++ gcse.c	Fri Dec 15 17:23:06 2000
@@ -4839,8 +4839,9 @@
 }
 \f
 /* If X contains any LABEL_REF's, add REG_LABEL notes for them to INSN.
-   We have to add REG_LABEL notes, because the following loop optimization
-   pass requires them.  */
+   If notes are added to an insn which references a CODE_LABEL, the
+   LABEL_NUSES count is incremented.  We have to add REG_LABEL notes,
+   because the following loop optimization pass requires them.  */
 
 /* ??? This is very similar to the loop.c add_label_notes function.  We
    could probably share code here.  */
@@ -4868,6 +4869,8 @@
 
       REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_LABEL, XEXP (x, 0),
 					    REG_NOTES (insn));
+      if (LABEL_P (XEXP (x, 0)))
+        LABEL_NUSES (XEXP (x, 0))++;
       return;
     }
 

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

* Re: pa reload problem
  2000-12-14 16:40     ` John David Anglin
@ 2000-12-27 20:08       ` Jeffrey A Law
  2000-12-28  5:18         ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Jeffrey A Law @ 2000-12-27 20:08 UTC (permalink / raw)
  To: John David Anglin; +Cc: rth, alan, rhirst, parisc-linux, gcc-bugs

  In message <200012141640.LAA03285@hiauly1.hia.nrc.ca>you write:
  > That's what I thought.  It would appear to occur when the above two insns
  > get moved out of a loop.  The count gets decremented when the old insns
  > are deleted but not incremented when the new insns are created.  The puzzle
  > is why the count is zero rather than 1.  Maybe what happens is the two
  > insns in the loop are deleted first, then the label is deleted?  Notice
  > that insn 788 is moved to insn 1530.  However, the insn becomes 1531 and
  > the reg changes to 337 from 208.
In this case we typically will bump the number of uses before we delete
the insns that way the label doesn't go away unexpectedly.

jeff

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

* Re: pa reload problem
  2000-12-27 20:08       ` Jeffrey A Law
@ 2000-12-28  5:18         ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2000-12-28  5:18 UTC (permalink / raw)
  To: law; +Cc: rth, alan, rhirst, parisc-linux, gcc-bugs

>   In message <200012141640.LAA03285@hiauly1.hia.nrc.ca>you write:
>   > That's what I thought.  It would appear to occur when the above two insns
>   > get moved out of a loop.  The count gets decremented when the old insns
>   > are deleted but not incremented when the new insns are created.  The puzzle
>   > is why the count is zero rather than 1.  Maybe what happens is the two
>   > insns in the loop are deleted first, then the label is deleted?  Notice
>   > that insn 788 is moved to insn 1530.  However, the insn becomes 1531 and
>   > the reg changes to 337 from 208.
> In this case we typically will bump the number of uses before we delete
> the insns that way the label doesn't go away unexpectedly.

As far I can tell, move_movables doesn't do this when it moves an insn
out of a loop.  It does this by deleting the old insn and creating a new
one.  It calls add_label_notes if notes need to be added to the new insn.

I sent a patch to add_label_notes for review which I think fixes the
problem.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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

* Re: PATCH: Adjust label usage count for new insns [was Re: pa reload problem]
  2000-12-16 20:38     ` [parisc-linux] PATCH: Adjust label usage count for new insns [was Re: pa reload problem] John David Anglin
@ 2001-01-02  9:51       ` Jeffrey A Law
  0 siblings, 0 replies; 194+ messages in thread
From: Jeffrey A Law @ 2001-01-02  9:51 UTC (permalink / raw)
  To: John David Anglin; +Cc: rth, alan, rhirst, parisc-linux, gcc-bugs


  In message <200012162038.PAA25535@hiauly1.hia.nrc.ca>you write:
  > 2000-12-14  John David Anglin  <dave@hiauly1.hia.nrc.ca>
  > 
  > 	* loop.c (add_label_notes): Increment the label usage count when
  > 	a note is added to an insn which refers to a CODE_LABEL.
  > 	* gcse.c (add_label_notes): Likewise.
Thanks.  Installed.

jeff

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

* Re: abort in eliminate_regs compiling glob.c from glibc
  2000-11-14 21:40   ` John David Anglin
@ 2001-01-27 20:12     ` Richard Henderson
  0 siblings, 0 replies; 194+ messages in thread
From: Richard Henderson @ 2001-01-27 20:12 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux, gcc-bugs, gcc-patches

On Tue, Nov 14, 2000 at 04:40:52PM -0500, John David Anglin wrote:
>      case USE:
> +      /* Handle insn_list USE that a call to a pure functions ...
> +      new = eliminate_regs (XEXP (x, 0), 0, insn);
> +      if (GET_CODE (new) == MEM)
> +	return XEXP (new, 0);

This is not correct.  You want to return something that still
looks like a USE.  Probably you want

	new = eliminate_regs (XEXP (x, 0), 0, insn);
	if (new != XEXP (x, 0))
	  return gen_rtx_USE (GET_MODE (x), new);
	return x;


r~

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

* [parisc-linux] Re: testcase for hppa64 gcc bug
  2000-12-06  5:28       ` Alan Modra
@ 2001-02-01  1:19         ` Jeffrey A Law
  0 siblings, 0 replies; 194+ messages in thread
From: Jeffrey A Law @ 2001-02-01  1:19 UTC (permalink / raw)
  To: Alan Modra; +Cc: John David Anglin, gcc-bugs, gcc-patches, parisc-linux

  In message <Pine.LNX.4.21.0012061607530.16721-100000@front.linuxcare.com.au>y
ou write:
  > > I think this needs to be reexamined.  Allan's ARG_POINTER_INVARIANT patch
  > > might not be needed now.
  > 
  > It's still needed.  The problem is that gcc thinks the arg pointer is
  > unchanged from the entry value to a function, even when the arg pointer
  > needs to be set to call other functions.
But the incoming argument pointer should have been copied into a pseudo at
the start of the function and the new pseudo used to address incoming args.

That's the real problem here I think.

jeff

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

* Re: [parisc-linux] PIC assembly
       [not found] <no.id>
                   ` (6 preceding siblings ...)
  2000-12-14  0:48 ` pa reload problem John David Anglin
@ 2002-01-07 18:39 ` John David Anglin
  2002-01-09  1:05   ` Grant Grundler
  2002-07-15 17:21 ` [parisc-linux] compiling kernels with gcc-3.1 John David Anglin
                   ` (27 subsequent siblings)
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2002-01-07 18:39 UTC (permalink / raw)
  To: John David Anglin; +Cc: randolph, parisc-linux

> This page contains links to various useful documents including the 32-bit
> runtime:
> 
> <http://h21007.www2.hp.com/dspp/tech/tech_TechTypeListingPage_IDX/1,1704,10403,00.html>.
> 
> The document itself is here:
> 
> <http://devresource.hp.com/STK/partner/rad_10_20.pdf>.

Maybe copies of these documents could be made accessible from the PA-RISC
LINUX Tech Documentation page as some of these are hard to find.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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

* Re: [parisc-linux] PIC assembly
  2002-01-07 18:39 ` [parisc-linux] PIC assembly John David Anglin
@ 2002-01-09  1:05   ` Grant Grundler
  2002-01-11 20:45     ` Grant Grundler
  0 siblings, 1 reply; 194+ messages in thread
From: Grant Grundler @ 2002-01-09  1:05 UTC (permalink / raw)
  To: John David Anglin; +Cc: randolph, parisc-linux

"John David Anglin" wrote:
> > This page contains links to various useful documents including the 32-bit
> > runtime:
> > 
> > <http://h21007.www2.hp.com/dspp/tech/tech_TechTypeListingPage_IDX/1,1704,10
>   403,00.html>.
> > 
> > The document itself is here:
> > 
> > <http://devresource.hp.com/STK/partner/rad_10_20.pdf>.
> 
> Maybe copies of these documents could be made accessible from the PA-RISC
> LINUX Tech Documentation page as some of these are hard to find.

I've been given the OK to link into h21007.www2.hp.com website and promised
the URLs for specific documents wouldn't change (too) suddenly.
I'll add those links in the next couple of days to p-l.org
"Tech Documentation" to those.

grant

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

* Re: [parisc-linux] PIC assembly
  2002-01-09  1:05   ` Grant Grundler
@ 2002-01-11 20:45     ` Grant Grundler
  0 siblings, 0 replies; 194+ messages in thread
From: Grant Grundler @ 2002-01-11 20:45 UTC (permalink / raw)
  To: parisc-linux

Grant Grundler wrote:
> I've been given the OK to link into h21007.www2.hp.com website and promised
> the URLs for specific documents wouldn't change (too) suddenly.
> I'll add those links in the next couple of days to p-l.org
> "Tech Documentation" to those.

I've added links for PA 1.1 and PA 2.0 Instruction Sets among other things.
Please reload:
	http://www.parisc-linux.org/documentation/index.html

Please continue to post requests for links to docs here.
(I'm not promising any new docs at this point).

thanks,
grant

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

* Re: [parisc-linux] compiling kernels with gcc-3.1
       [not found] <no.id>
                   ` (7 preceding siblings ...)
  2002-01-07 18:39 ` [parisc-linux] PIC assembly John David Anglin
@ 2002-07-15 17:21 ` John David Anglin
  2002-07-15 17:32   ` Randolph Chung
  2002-07-16  9:02   ` joel.soete
  2002-07-16 17:01 ` [parisc-linux] gcc-3.[02] alignment problem John David Anglin
                   ` (26 subsequent siblings)
  35 siblings, 2 replies; 194+ messages in thread
From: John David Anglin @ 2002-07-15 17:21 UTC (permalink / raw)
  To: John David Anglin; +Cc: tausq, joel.soete, parisc-linux

> Is --disable-indexing used in kernel builds?  This should stop gcc
> from generating the above.

Oops, that should be "-mdisable-indexing".

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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

* Re: [parisc-linux] compiling kernels with gcc-3.1
  2002-07-15 17:21 ` [parisc-linux] compiling kernels with gcc-3.1 John David Anglin
@ 2002-07-15 17:32   ` Randolph Chung
  2002-07-15 17:43     ` Matthew Wilcox
  2002-07-16  9:02   ` joel.soete
  1 sibling, 1 reply; 194+ messages in thread
From: Randolph Chung @ 2002-07-15 17:32 UTC (permalink / raw)
  To: John David Anglin; +Cc: joel.soete, parisc-linux

In reference to a message from John David Anglin, dated Jul 15:
> > Is --disable-indexing used in kernel builds?  This should stop gcc
> > from generating the above.
> 
> Oops, that should be "-mdisable-indexing".

right now we use:
-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -D__linux__ -pipe -fno-strength-reduce
-mno-space-regs -mfast-indirect-calls -mdisable-fpregs
-ffunction-sections -march=2.0 -mschedule=8000

(the last two are only for pa8x00 builds...)

i'll try the disable-indexing stuff...

randolph
--  
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/

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

* Re: [parisc-linux] compiling kernels with gcc-3.1
  2002-07-15 17:32   ` Randolph Chung
@ 2002-07-15 17:43     ` Matthew Wilcox
  2002-07-15 18:18       ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Matthew Wilcox @ 2002-07-15 17:43 UTC (permalink / raw)
  To: Randolph Chung; +Cc: John David Anglin, joel.soete, parisc-linux

On Mon, Jul 15, 2002 at 10:32:33AM -0700, Randolph Chung wrote:
> In reference to a message from John David Anglin, dated Jul 15:
> > > Is --disable-indexing used in kernel builds?  This should stop gcc
> > > from generating the above.
> > 
> > Oops, that should be "-mdisable-indexing".
> 
> right now we use:
> -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
> -fno-strict-aliasing -fno-common -D__linux__ -pipe -fno-strength-reduce
> -mno-space-regs -mfast-indirect-calls -mdisable-fpregs
> -ffunction-sections -march=2.0 -mschedule=8000
> 
> (the last two are only for pa8x00 builds...)
> 
> i'll try the disable-indexing stuff...

while we're on the subject of gcc flags ...

right now, we have an interesting patch in the kernel to get around a
fun feature of the PA ABI that no other ABI seems to have:

-asmlinkage ssize_t sys_pread(unsigned int fd, char * buf,
-                            size_t count, loff_t pos)
+static inline
+ssize_t do_pread(unsigned int fd, char * buf, size_t count, loff_t pos)
[...]
+#if BITS_PER_LONG == 32
+#ifdef __BIG_ENDIAN
+#define LOFF_T(high, low) unsigned int high, unsigned int low
+#else
+#define LOFF_T(high, low) unsigned int low, unsigned int high
+#endif
+
+asmlinkage
+ssize_t sys_pread(unsigned int fd, char *buf, size_t count, LOFF_T(high, low))
+{
+       return do_pread(fd, buf, count, (loff_t)high << 32 | low);
+}
+
+ssize_t sys_pwrite(unsigned int fd, char *buf, size_t count, LOFF_T(high, low))
+{
+       return do_pwrite(fd, buf, count, (loff_t)high << 32 | low);
+}

the problem is that the PA ABI specifies that quantities shall be
`naturally' aligned, even 64-bit quantities on 32-bit machines.  so the
kernel is expecting to see:

	fd (32 bits)
	buf (32 bits)
	count (32 bits)
	(empty)
	pos (64 bits)

what it _actually_ gets (because glibc is hideously broken, IMO):

	fd
	buf
	count
	(pos >> 32)
	pos & 0xffffffff

is there any chance of having a flag (or maybe an __attribute__ that
we could #define asmlinkage to?) which would change the ABI to be more
compressed like all the other architectures?

-- 
Revolutions do not require corporate support.

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

* Re: [parisc-linux] compiling kernels with gcc-3.1
  2002-07-15 17:43     ` Matthew Wilcox
@ 2002-07-15 18:18       ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2002-07-15 18:18 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: randolph, joel.soete, parisc-linux

> the problem is that the PA ABI specifies that quantities shall be
> `naturally' aligned, even 64-bit quantities on 32-bit machines.  so the
> kernel is expecting to see:
> 
> 	fd (32 bits)
> 	buf (32 bits)
> 	count (32 bits)
> 	(empty)
> 	pos (64 bits)
> 
> what it _actually_ gets (because glibc is hideously broken, IMO):
> 
> 	fd
> 	buf
> 	count
> 	(pos >> 32)
> 	pos & 0xffffffff

It's probably a whole lot easier to fix glibc than change gcc.

> is there any chance of having a flag (or maybe an __attribute__ that
> we could #define asmlinkage to?) which would change the ABI to be more
> compressed like all the other architectures?

I think this is basically a bad idea as it will have a whole lot
of nasty side effects.  How will gdb know which ABI, varargs, etc?

You would need to use a compiler switch and modify
FUNCTION_ARG_PARTIAL_NREGS and FUNCTION_ARG appropriately.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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

* Re: [parisc-linux] compiling kernels with gcc-3.1
  2002-07-15 17:21 ` [parisc-linux] compiling kernels with gcc-3.1 John David Anglin
  2002-07-15 17:32   ` Randolph Chung
@ 2002-07-16  9:02   ` joel.soete
  1 sibling, 0 replies; 194+ messages in thread
From: joel.soete @ 2002-07-16  9:02 UTC (permalink / raw)
  To: John David Anglin; +Cc: tausq, joel.soete, parisc-linux

Quoting John David Anglin <dave@hiauly1.hia.nrc.ca>:

> > Is --disable-indexing used in kernel builds?  This should stop gcc
> > from generating the above.
> 
> Oops, that should be "-mdisable-indexing".

Sorry Dave,

it do not help (system still crashing)

Joel


-------------------------------------------------
This mail sent through Tiscali Webmail (http://webmail.tiscali.be)

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

* Re: [parisc-linux] gcc-3.[02] alignment problem
       [not found] <no.id>
                   ` (9 preceding siblings ...)
  2002-07-16 17:01 ` [parisc-linux] gcc-3.[02] alignment problem John David Anglin
@ 2002-07-16 17:01 ` John David Anglin
  2002-07-16 17:22   ` Randolph Chung
  2002-07-16 17:22   ` Randolph Chung
  2002-07-16 17:27 ` [parisc-linux] gcc-3.2 bootstrap? John David Anglin
                   ` (24 subsequent siblings)
  35 siblings, 2 replies; 194+ messages in thread
From: John David Anglin @ 2002-07-16 17:01 UTC (permalink / raw)
  To: John David Anglin; +Cc: randolph, parisc-linux, gcc

> These messages are coming from the assembler (remove "-pipe").  The
> first is from "std %r4,44(%r3)".  The offset "44" is not correct for
> a store double.  This is probably a problem with pointer arithmetic
> in the source.

Check the definition of RTA_ALIGNTO in linux/rtnetlink.h.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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

* Re: [parisc-linux] gcc-3.[02] alignment problem
       [not found] <no.id>
                   ` (8 preceding siblings ...)
  2002-07-15 17:21 ` [parisc-linux] compiling kernels with gcc-3.1 John David Anglin
@ 2002-07-16 17:01 ` John David Anglin
  2002-07-16 17:01 ` John David Anglin
                   ` (25 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2002-07-16 17:01 UTC (permalink / raw)
  To: John David Anglin; +Cc: randolph, parisc-linux, gcc

> These messages are coming from the assembler (remove "-pipe").  The
> first is from "std %r4,44(%r3)".  The offset "44" is not correct for
> a store double.  This is probably a problem with pointer arithmetic
> in the source.

Check the definition of RTA_ALIGNTO in linux/rtnetlink.h.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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

* Re: [parisc-linux] gcc-3.[02] alignment problem
  2002-07-16 17:01 ` John David Anglin
  2002-07-16 17:22   ` Randolph Chung
@ 2002-07-16 17:22   ` Randolph Chung
  2002-07-16 17:24     ` Matthew Wilcox
                       ` (3 more replies)
  1 sibling, 4 replies; 194+ messages in thread
From: Randolph Chung @ 2002-07-16 17:22 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux, gcc

In reference to a message from John David Anglin, dated Jul 16:
> > These messages are coming from the assembler (remove "-pipe").  The
> > first is from "std %r4,44(%r3)".  The offset "44" is not correct for
> > a store double.  This is probably a problem with pointer arithmetic
> > in the source.
> 
> Check the definition of RTA_ALIGNTO in linux/rtnetlink.h.

ah, this is not it, but i see what it is now.

include/linux/tcp_diag.h defines:

struct tcpdiag_sockid
{
        __u16   tcpdiag_sport;
        __u16   tcpdiag_dport;
        __u32   tcpdiag_src[4];
        __u32   tcpdiag_dst[4];
        __u32   tcpdiag_if;
        __u32   tcpdiag_cookie[2]; 
#define TCPDIAG_NOCOOKIE (~0U)
};

the code goes on to do:
        *((struct sock **)&r->id.tcpdiag_cookie) = sk;
and
            sk != *((struct sock **)&req->id.tcpdiag_cookie[0]))

even tho tcpdiag_cookie looks like it can be 64-bit aligned in the
struct, it appears that it isn't.... 

the "vomit grade hack" alan mentioned in another post is that in our
tree, we have:

struct tcpdiag_sockid
{
        __u16   tcpdiag_sport;
        __u16   tcpdiag_dport;
        __u32   tcpdiag_src[4];
        __u32   tcpdiag_dst[4];
        __u32   tcpdiag_if;
#if defined (__hppa__) && defined (__LP64__)
        char * parisc_hack_to_align_tcpdiag_cookie;
#endif
        __u32   tcpdiag_cookie[2];
#define TCPDIAG_NOCOOKIE (~0U)
};

why is the offset of tcpdiag_cookie[0] 44 and not 40?

randolph
--  
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/

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

* Re: [parisc-linux] gcc-3.[02] alignment problem
  2002-07-16 17:01 ` John David Anglin
@ 2002-07-16 17:22   ` Randolph Chung
  2002-07-16 17:22   ` Randolph Chung
  1 sibling, 0 replies; 194+ messages in thread
From: Randolph Chung @ 2002-07-16 17:22 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux, gcc

In reference to a message from John David Anglin, dated Jul 16:
> > These messages are coming from the assembler (remove "-pipe").  The
> > first is from "std %r4,44(%r3)".  The offset "44" is not correct for
> > a store double.  This is probably a problem with pointer arithmetic
> > in the source.
> 
> Check the definition of RTA_ALIGNTO in linux/rtnetlink.h.

ah, this is not it, but i see what it is now.

include/linux/tcp_diag.h defines:

struct tcpdiag_sockid
{
        __u16   tcpdiag_sport;
        __u16   tcpdiag_dport;
        __u32   tcpdiag_src[4];
        __u32   tcpdiag_dst[4];
        __u32   tcpdiag_if;
        __u32   tcpdiag_cookie[2]; 
#define TCPDIAG_NOCOOKIE (~0U)
};

the code goes on to do:
        *((struct sock **)&r->id.tcpdiag_cookie) = sk;
and
            sk != *((struct sock **)&req->id.tcpdiag_cookie[0]))

even tho tcpdiag_cookie looks like it can be 64-bit aligned in the
struct, it appears that it isn't.... 

the "vomit grade hack" alan mentioned in another post is that in our
tree, we have:

struct tcpdiag_sockid
{
        __u16   tcpdiag_sport;
        __u16   tcpdiag_dport;
        __u32   tcpdiag_src[4];
        __u32   tcpdiag_dst[4];
        __u32   tcpdiag_if;
#if defined (__hppa__) && defined (__LP64__)
        char * parisc_hack_to_align_tcpdiag_cookie;
#endif
        __u32   tcpdiag_cookie[2];
#define TCPDIAG_NOCOOKIE (~0U)
};

why is the offset of tcpdiag_cookie[0] 44 and not 40?

randolph
--  
Randolph Chung
Debian GNU/Linux Developer, hppa/ia64 ports
http://www.tausq.org/

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

* Re: [parisc-linux] gcc-3.[02] alignment problem
  2002-07-16 17:22   ` Randolph Chung
@ 2002-07-16 17:24     ` Matthew Wilcox
  2002-07-17  3:19       ` Randolph Chung
  2002-07-17  3:19       ` Randolph Chung
  2002-07-16 17:24     ` Matthew Wilcox
                       ` (2 subsequent siblings)
  3 siblings, 2 replies; 194+ messages in thread
From: Matthew Wilcox @ 2002-07-16 17:24 UTC (permalink / raw)
  To: Randolph Chung; +Cc: John David Anglin, parisc-linux, gcc

On Tue, Jul 16, 2002 at 10:22:55AM -0700, Randolph Chung wrote:
> include/linux/tcp_diag.h defines:
> 
> struct tcpdiag_sockid
> {
>         __u16   tcpdiag_sport;
>         __u16   tcpdiag_dport;
>         __u32   tcpdiag_src[4];
>         __u32   tcpdiag_dst[4];
>         __u32   tcpdiag_if;
>         __u32   tcpdiag_cookie[2]; 
> #define TCPDIAG_NOCOOKIE (~0U)
> };

> why is the offset of tcpdiag_cookie[0] 44 and not 40?

0	tcpdiag_sport
2	tcpdiag_dport
4	tcpdiag_src
20	tcpdiag_dst
36	tcpdiag_if
40	tcpdiag_cookie

hmm.. worth checking that dport is at offset 2, not offset 4?

-- 
Revolutions do not require corporate support.

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

* Re: [parisc-linux] gcc-3.[02] alignment problem
  2002-07-16 17:22   ` Randolph Chung
  2002-07-16 17:24     ` Matthew Wilcox
@ 2002-07-16 17:24     ` Matthew Wilcox
  2002-07-16 20:21     ` Richard Henderson
  2002-07-16 20:21     ` Richard Henderson
  3 siblings, 0 replies; 194+ messages in thread
From: Matthew Wilcox @ 2002-07-16 17:24 UTC (permalink / raw)
  To: Randolph Chung; +Cc: John David Anglin, parisc-linux, gcc

On Tue, Jul 16, 2002 at 10:22:55AM -0700, Randolph Chung wrote:
> include/linux/tcp_diag.h defines:
> 
> struct tcpdiag_sockid
> {
>         __u16   tcpdiag_sport;
>         __u16   tcpdiag_dport;
>         __u32   tcpdiag_src[4];
>         __u32   tcpdiag_dst[4];
>         __u32   tcpdiag_if;
>         __u32   tcpdiag_cookie[2]; 
> #define TCPDIAG_NOCOOKIE (~0U)
> };

> why is the offset of tcpdiag_cookie[0] 44 and not 40?

0	tcpdiag_sport
2	tcpdiag_dport
4	tcpdiag_src
20	tcpdiag_dst
36	tcpdiag_if
40	tcpdiag_cookie

hmm.. worth checking that dport is at offset 2, not offset 4?

-- 
Revolutions do not require corporate support.

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

* Re: [parisc-linux] gcc-3.2 bootstrap?
       [not found] <no.id>
                   ` (10 preceding siblings ...)
  2002-07-16 17:01 ` John David Anglin
@ 2002-07-16 17:27 ` John David Anglin
  2003-01-31 21:27 ` [parisc-linux] PATCH hppa ordered load absolute ops John David Anglin
                   ` (23 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2002-07-16 17:27 UTC (permalink / raw)
  To: John David Anglin; +Cc: joel.soete, parisc-linux

> > but when I try to use it to compile kernel-2.4.18-pa54 I got following error:
> > `gcc -print-libgcc-file-name`
> > /Develop/parisc-linux/src/linux-2.4.18-pa54/arch/parisc/lib/lib.a
> > /Develop/parisc-linux/src/linux-2.4.18-pa54/lib/lib.a  \
> >         --end-group \
> >         -o vmlinux
> > arch/parisc/kernel/kernel.o(__ksymtab+0x258): undefined reference to `$$mulU'  

> $$mulU is a millicode routine in libgcc.a.

Sorry, this routine is no longer in libgcc.a.  It was in the 32-bit
library for 3.0.x.  However, we have switched to the "64-bit" millicode
for both 32 and 64 bit code.  Gcc doesn't use it anymore but I see there
are a couple of remnants to clean up.

Your problem appears to be with arch/parisc/kernel/parisc_ksyms.c.
It imports the symbol.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)

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

* Re: [parisc-linux] gcc-3.[02] alignment problem
  2002-07-16 17:22   ` Randolph Chung
                       ` (2 preceding siblings ...)
  2002-07-16 20:21     ` Richard Henderson
@ 2002-07-16 20:21     ` Richard Henderson
  3 siblings, 0 replies; 194+ messages in thread
From: Richard Henderson @ 2002-07-16 20:21 UTC (permalink / raw)
  To: Randolph Chung; +Cc: John David Anglin, parisc-linux, gcc

On Tue, Jul 16, 2002 at 10:22:55AM -0700, Randolph Chung wrote:
>         __u32   tcpdiag_cookie[2]; 
> #define TCPDIAG_NOCOOKIE (~0U)
> };
> 
> the code goes on to do:
>         *((struct sock **)&r->id.tcpdiag_cookie) = sk;
> and
>             sk != *((struct sock **)&req->id.tcpdiag_cookie[0]))

This is absolutely awful.

> the "vomit grade hack" alan mentioned in another post is that in our
> tree, we have:
> 
> struct tcpdiag_sockid
> {
>         __u16   tcpdiag_sport;
>         __u16   tcpdiag_dport;
>         __u32   tcpdiag_src[4];
>         __u32   tcpdiag_dst[4];
>         __u32   tcpdiag_if;
> #if defined (__hppa__) && defined (__LP64__)
>         char * parisc_hack_to_align_tcpdiag_cookie;
> #endif
>         __u32   tcpdiag_cookie[2];

An only marginally better fix is

	__u32 tcpdiag_cookie[2] __attribute__((aligned(sizeof(void*))));

Note that this should be unconditional so that the other
64-bit ports don't take an alignment trap here too.

A much nicer fix would be to, gasp, use a union.



r~

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

* Re: [parisc-linux] gcc-3.[02] alignment problem
  2002-07-16 17:22   ` Randolph Chung
  2002-07-16 17:24     ` Matthew Wilcox
  2002-07-16 17:24     ` Matthew Wilcox
@ 2002-07-16 20:21     ` Richard Henderson
  2002-07-16 20:21     ` Richard Henderson
  3 siblings, 0 replies; 194+ messages in thread
From: Richard Henderson @ 2002-07-16 20:21 UTC (permalink / raw)
  To: Randolph Chung; +Cc: John David Anglin, parisc-linux, gcc

On Tue, Jul 16, 2002 at 10:22:55AM -0700, Randolph Chung wrote:
>         __u32   tcpdiag_cookie[2]; 
> #define TCPDIAG_NOCOOKIE (~0U)
> };
> 
> the code goes on to do:
>         *((struct sock **)&r->id.tcpdiag_cookie) = sk;
> and
>             sk != *((struct sock **)&req->id.tcpdiag_cookie[0]))

This is absolutely awful.

> the "vomit grade hack" alan mentioned in another post is that in our
> tree, we have:
> 
> struct tcpdiag_sockid
> {
>         __u16   tcpdiag_sport;
>         __u16   tcpdiag_dport;
>         __u32   tcpdiag_src[4];
>         __u32   tcpdiag_dst[4];
>         __u32   tcpdiag_if;
> #if defined (__hppa__) && defined (__LP64__)
>         char * parisc_hack_to_align_tcpdiag_cookie;
> #endif
>         __u32   tcpdiag_cookie[2];

An only marginally better fix is

	__u32 tcpdiag_cookie[2] __attribute__((aligned(sizeof(void*))));

Note that this should be unconditional so that the other
64-bit ports don't take an alignment trap here too.

A much nicer fix would be to, gasp, use a union.



r~

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

* Re: [parisc-linux] gcc-3.[02] alignment problem
  2002-07-16 17:24     ` Matthew Wilcox
@ 2002-07-17  3:19       ` Randolph Chung
  2002-07-17  3:19       ` Randolph Chung
  1 sibling, 0 replies; 194+ messages in thread
From: Randolph Chung @ 2002-07-17  3:19 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: John David Anglin, parisc-linux, gcc

> > why is the offset of tcpdiag_cookie[0] 44 and not 40?
> 
> 0	tcpdiag_sport
> 2	tcpdiag_dport
> 4	tcpdiag_src
> 20	tcpdiag_dst
> 36	tcpdiag_if
> 40	tcpdiag_cookie
> 
> hmm.. worth checking that dport is at offset 2, not offset 4?

oic, it's embedded inside another structure:

struct tcpdiagmsg
{
        __u8    tcpdiag_family;
        __u8    tcpdiag_state;
        __u8    tcpdiag_timer;
        __u8    tcpdiag_retrans;

        struct tcpdiag_sockid id;

        __u32   tcpdiag_expires;
        __u32   tcpdiag_rqueue;
        __u32   tcpdiag_wqueue;
        __u32   tcpdiag_uid;
        __u32   tcpdiag_inode;
};

that's why it's 44...

randolph

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

* Re: [parisc-linux] gcc-3.[02] alignment problem
  2002-07-16 17:24     ` Matthew Wilcox
  2002-07-17  3:19       ` Randolph Chung
@ 2002-07-17  3:19       ` Randolph Chung
  1 sibling, 0 replies; 194+ messages in thread
From: Randolph Chung @ 2002-07-17  3:19 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: John David Anglin, parisc-linux, gcc

> > why is the offset of tcpdiag_cookie[0] 44 and not 40?
> 
> 0	tcpdiag_sport
> 2	tcpdiag_dport
> 4	tcpdiag_src
> 20	tcpdiag_dst
> 36	tcpdiag_if
> 40	tcpdiag_cookie
> 
> hmm.. worth checking that dport is at offset 2, not offset 4?

oic, it's embedded inside another structure:

struct tcpdiagmsg
{
        __u8    tcpdiag_family;
        __u8    tcpdiag_state;
        __u8    tcpdiag_timer;
        __u8    tcpdiag_retrans;

        struct tcpdiag_sockid id;

        __u32   tcpdiag_expires;
        __u32   tcpdiag_rqueue;
        __u32   tcpdiag_wqueue;
        __u32   tcpdiag_uid;
        __u32   tcpdiag_inode;
};

that's why it's 44...

randolph

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

* Re: [parisc-linux] PATCH hppa ordered load absolute ops
       [not found] <no.id>
                   ` (11 preceding siblings ...)
  2002-07-16 17:27 ` [parisc-linux] gcc-3.2 bootstrap? John David Anglin
@ 2003-01-31 21:27 ` John David Anglin
  2003-01-31 21:27 ` John David Anglin
                   ` (22 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2003-01-31 21:27 UTC (permalink / raw)
  To: John David Anglin; +Cc: grundler, bug-binutils, parisc-linux

I installed the following after testing on hppa-unknown-linux-gnu.

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

2003-01-31  Grant Grundler  <grundler@dsl2.external.hp.com>

        * hppa.h (ldwa, ldda): Add ordered opcodes.

Index: opcode/hppa.h
===================================================================
RCS file: /cvs/src/src/include/opcode/hppa.h,v
retrieving revision 1.49
diff -u -3 -p -r1.49 hppa.h
--- opcode/hppa.h	16 Dec 2002 09:57:03 -0000	1.49
+++ opcode/hppa.h	31 Jan 2003 21:13:31 -0000
@@ -407,6 +407,7 @@ static const struct pa_opcode pa_opcodes
 { "ldbx",       0x0c000000, 0xfc001fc0, "cXx(b),t", pa10, 0},
 { "ldwa",       0x0c000180, 0xfc00d3c0, "cxccx(b),t", pa10, FLAG_STRICT},
 { "ldwa",	0x0c001180, 0xfc00d3c0, "cmcc5(b),t", pa10, FLAG_STRICT},
+{ "ldwa",	0x0c0011a0, 0xfc1ff3e0, "cocc@(b),t", pa20, FLAG_STRICT},
 { "ldcw",       0x0c0001c0, 0xfc0013c0, "cxcdx(s,b),t", pa10, FLAG_STRICT},
 { "ldcw",       0x0c0001c0, 0xfc0013c0, "cxcdx(b),t", pa10, FLAG_STRICT},
 { "ldcw",	0x0c0011c0, 0xfc0013c0, "cmcd5(s,b),t", pa10, FLAG_STRICT},
@@ -417,6 +418,7 @@ static const struct pa_opcode pa_opcodes
 { "stby",	0x0c001300, 0xfc0013c0, "cscCx,V(b)", pa10, FLAG_STRICT},
 { "ldda",       0x0c000100, 0xfc00d3c0, "cxccx(b),t", pa20, FLAG_STRICT},
 { "ldda",	0x0c001100, 0xfc00d3c0, "cmcc5(b),t", pa20, FLAG_STRICT},
+{ "ldda",	0x0c001120, 0xfc1ff3e0, "cocc@(b),t", pa20, FLAG_STRICT},
 { "ldcd",       0x0c000140, 0xfc0013c0, "cxcdx(s,b),t", pa20, FLAG_STRICT},
 { "ldcd",       0x0c000140, 0xfc0013c0, "cxcdx(b),t", pa20, FLAG_STRICT},
 { "ldcd",	0x0c001140, 0xfc0013c0, "cmcd5(s,b),t", pa20, FLAG_STRICT},

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

* Re: [parisc-linux] PATCH hppa ordered load absolute ops
       [not found] <no.id>
                   ` (12 preceding siblings ...)
  2003-01-31 21:27 ` [parisc-linux] PATCH hppa ordered load absolute ops John David Anglin
@ 2003-01-31 21:27 ` John David Anglin
  2003-08-31 19:10 ` [parisc-linux] Re: [glibc] tststatic failues, reduced to simp le testcase John David Anglin
                   ` (21 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2003-01-31 21:27 UTC (permalink / raw)
  To: John David Anglin; +Cc: grundler, bug-binutils, parisc-linux

I installed the following after testing on hppa-unknown-linux-gnu.

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

2003-01-31  Grant Grundler  <grundler@dsl2.external.hp.com>

        * hppa.h (ldwa, ldda): Add ordered opcodes.

Index: opcode/hppa.h
===================================================================
RCS file: /cvs/src/src/include/opcode/hppa.h,v
retrieving revision 1.49
diff -u -3 -p -r1.49 hppa.h
--- opcode/hppa.h	16 Dec 2002 09:57:03 -0000	1.49
+++ opcode/hppa.h	31 Jan 2003 21:13:31 -0000
@@ -407,6 +407,7 @@ static const struct pa_opcode pa_opcodes
 { "ldbx",       0x0c000000, 0xfc001fc0, "cXx(b),t", pa10, 0},
 { "ldwa",       0x0c000180, 0xfc00d3c0, "cxccx(b),t", pa10, FLAG_STRICT},
 { "ldwa",	0x0c001180, 0xfc00d3c0, "cmcc5(b),t", pa10, FLAG_STRICT},
+{ "ldwa",	0x0c0011a0, 0xfc1ff3e0, "cocc@(b),t", pa20, FLAG_STRICT},
 { "ldcw",       0x0c0001c0, 0xfc0013c0, "cxcdx(s,b),t", pa10, FLAG_STRICT},
 { "ldcw",       0x0c0001c0, 0xfc0013c0, "cxcdx(b),t", pa10, FLAG_STRICT},
 { "ldcw",	0x0c0011c0, 0xfc0013c0, "cmcd5(s,b),t", pa10, FLAG_STRICT},
@@ -417,6 +418,7 @@ static const struct pa_opcode pa_opcodes
 { "stby",	0x0c001300, 0xfc0013c0, "cscCx,V(b)", pa10, FLAG_STRICT},
 { "ldda",       0x0c000100, 0xfc00d3c0, "cxccx(b),t", pa20, FLAG_STRICT},
 { "ldda",	0x0c001100, 0xfc00d3c0, "cmcc5(b),t", pa20, FLAG_STRICT},
+{ "ldda",	0x0c001120, 0xfc1ff3e0, "cocc@(b),t", pa20, FLAG_STRICT},
 { "ldcd",       0x0c000140, 0xfc0013c0, "cxcdx(s,b),t", pa20, FLAG_STRICT},
 { "ldcd",       0x0c000140, 0xfc0013c0, "cxcdx(b),t", pa20, FLAG_STRICT},
 { "ldcd",	0x0c001140, 0xfc0013c0, "cmcd5(s,b),t", pa20, FLAG_STRICT},

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

* Re: [parisc-linux] Re: [glibc] tststatic failues, reduced to simp le testcase.
       [not found] <no.id>
                   ` (13 preceding siblings ...)
  2003-01-31 21:27 ` John David Anglin
@ 2003-08-31 19:10 ` John David Anglin
  2003-08-31 20:22   ` Carlos O'Donell
  2003-12-15 22:05 ` [parisc-linux] dlopen failed on 'libthread_db.so.1' - /lib/libthread_db.so.1: undefined symbol: ps_pglobal_lookup John David Anglin
                   ` (20 subsequent siblings)
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2003-08-31 19:10 UTC (permalink / raw)
  To: dave; +Cc: carlos, randolph, dave.anglin, parisc-linux

> > I've added all the caller-saves registers to our clobber lists when
> > making syscalls. Though, r19 being special, I've had to add "STW_PIC"
> > and "LDW_PIC" that do the saving and restore _only_ if we are compiled
> > PIC.
> 
> That seems overly pessimistic and will mean a lot more register saves
> in routines that do syscalls.  It appears the system saves the caller-save
> registers in all syscalls except the fork related calls.  It would
> be best to keep the number of clobbers to a minimum.  I wonder, there
> seems to be a slot in the task struct for r1, but it's never saved in
> a syscall, and r1 is clobbered.  Maybe the r1 slot could be used to save
> r2.  This might mean that we don't need to use GR21 or GR22 at all.
> It would avoid having to have special pic code.

Another possibility might be to define another couple of offsets in the
task struct.  It looks as if there is plenty of space before an alignment
boundary is reached.

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

* Re: [parisc-linux] Re: [glibc] tststatic failues, reduced to simp le testcase.
  2003-08-31 19:10 ` [parisc-linux] Re: [glibc] tststatic failues, reduced to simp le testcase John David Anglin
@ 2003-08-31 20:22   ` Carlos O'Donell
  2003-08-31 20:47     ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2003-08-31 20:22 UTC (permalink / raw)
  To: John David Anglin; +Cc: randolph, dave.anglin, parisc-linux

> Another possibility might be to define another couple of offsets in the
> task struct.  It looks as if there is plenty of space before an alignment
> boundary is reached.

That seems best. The sad fact though is that until I bump
min_kernel_version in glibc past the kernel version that last didn't
have this fix, I'm still forced to implement all this for people with
older kernels.

c.

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

* Re: [parisc-linux] Re: [glibc] tststatic failues, reduced to simp le testcase.
  2003-08-31 20:22   ` Carlos O'Donell
@ 2003-08-31 20:47     ` John David Anglin
  2003-09-01  6:05       ` Carlos O'Donell
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2003-08-31 20:47 UTC (permalink / raw)
  To: carlos; +Cc: randolph, dave.anglin, parisc-linux

> That seems best. The sad fact though is that until I bump
> min_kernel_version in glibc past the kernel version that last didn't
> have this fix, I'm still forced to implement all this for people with
> older kernels.

Why?  Things are broken now and people have lived with the bug for
sometime.  While it is possible to work around the problem in userspace,
the best fix is to do it in the kernel.  I wouldn't fix anything but
a regression.

Dave

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

* Re: [parisc-linux] Re: [glibc] tststatic failues, reduced to simp le testcase.
  2003-08-31 20:47     ` John David Anglin
@ 2003-09-01  6:05       ` Carlos O'Donell
  0 siblings, 0 replies; 194+ messages in thread
From: Carlos O'Donell @ 2003-09-01  6:05 UTC (permalink / raw)
  To: John David Anglin; +Cc: randolph, dave.anglin, parisc-linux

On Sun, Aug 31, 2003 at 04:47:59PM -0400, John David Anglin wrote:
> > That seems best. The sad fact though is that until I bump
> > min_kernel_version in glibc past the kernel version that last didn't
> > have this fix, I'm still forced to implement all this for people with
> > older kernels.
> 
> Why?  Things are broken now and people have lived with the bug for
> sometime.  While it is possible to work around the problem in userspace,
> the best fix is to do it in the kernel.  I wouldn't fix anything but
> a regression.

It's best to use an example. Debian supports HPPA as an architecture.
I provide Debian with patches to make upstream glibc cvs buildable for
this distribution. If I make all the glibc fixes in the kernel, and
submit to debian minimal patches, glibc will build and subsequent
updates will render all userspace broken. As a happy medium I need to
make, atleast for all usable distributions, a set of patches that fix it
in such a way that we don't force a kernel update (people don't like to
update their kernel). The patches I send upstream will be different.
They will, to the best of my ability, be as clean as possible. I balance
users on one side, and the "right thing" on the other.

I agree, that the kernel, sharing the context switch path, and already
saving r19 should be held responsible for restoring r19. I've already
begun to run into a number of cases where userspace restores aren't
going so well.

c.

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

* [parisc-linux] dlopen failed on 'libthread_db.so.1' - /lib/libthread_db.so.1: undefined symbol: ps_pglobal_lookup
       [not found] <no.id>
                   ` (14 preceding siblings ...)
  2003-08-31 19:10 ` [parisc-linux] Re: [glibc] tststatic failues, reduced to simp le testcase John David Anglin
@ 2003-12-15 22:05 ` John David Anglin
  2003-12-17 15:32   ` [parisc-linux] " Carlos O'Donell
  2003-12-18  0:32 ` John David Anglin
                   ` (19 subsequent siblings)
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2003-12-15 22:05 UTC (permalink / raw)
  To: John David Anglin; +Cc: carlos, parisc-linux

I hacked together of a build of debian gdb-6.0-2 this afternoon.  When
I start gdb, I see the following error:

dave@gsyprf11:~/gdb-6.0-2/objdir$ gdb/gdb


dlopen failed on 'libthread_db.so.1' - /lib/libthread_db.so.1: undefined symbol: ps_pglobal_lookup
GDB will not be able to debug pthreads.

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

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

* [parisc-linux] Re: dlopen failed on 'libthread_db.so.1' - /lib/libthread_db.so.1: undefined symbol: ps_pglobal_lookup
  2003-12-15 22:05 ` [parisc-linux] dlopen failed on 'libthread_db.so.1' - /lib/libthread_db.so.1: undefined symbol: ps_pglobal_lookup John David Anglin
@ 2003-12-17 15:32   ` Carlos O'Donell
  2003-12-17 15:53     ` Carlos O'Donell
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2003-12-17 15:32 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux

On Mon, Dec 15, 2003 at 05:05:12PM -0500, John David Anglin wrote:
> I hacked together of a build of debian gdb-6.0-2 this afternoon.  When
> I start gdb, I see the following error:

My friend, that's amazing!
 
> dave@gsyprf11:~/gdb-6.0-2/objdir$ gdb/gdb
> dlopen failed on 'libthread_db.so.1' - /lib/libthread_db.so.1: undefined symbol: ps_pglobal_lookup
> GDB will not be able to debug pthreads.

Every pogram that links libthread_db.so.1 must provide a set of process
control primities that will allow libthread_db to access memory and
registers in the target process, start and stop the process, and lookup
symbols. ps_pglobal_lookup is always UND in libthread_db, and gdb should
have exported an arch version for the library to use :)

c.

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

* Re: [parisc-linux] Re: dlopen failed on 'libthread_db.so.1' - /lib/libthread_db.so.1: undefined symbol: ps_pglobal_lookup
  2003-12-17 15:32   ` [parisc-linux] " Carlos O'Donell
@ 2003-12-17 15:53     ` Carlos O'Donell
  2003-12-17 16:43       ` [parisc-linux] Re: dlopen failed on 'libthread_db.so.1' - John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2003-12-17 15:53 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux

On Wed, Dec 17, 2003 at 10:32:20AM -0500, Carlos O'Donell wrote:
> Every pogram that links libthread_db.so.1 must provide a set of process
> control primities that will allow libthread_db to access memory and
> registers in the target process, start and stop the process, and lookup
> symbols. ps_pglobal_lookup is always UND in libthread_db, and gdb should
> have exported an arch version for the library to use :)

See:

gdb/proc-service.c
gdb/gdbserver/proc-service.c

*unless* You are insinuating that the loader has messed up the symbol
resolution and ps_pglobal_lookup exists but isn't resolved properly...
which is a whole 'nother can of wormns :)

c.

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

* Re: [parisc-linux] Re: dlopen failed on 'libthread_db.so.1' -
  2003-12-17 15:53     ` Carlos O'Donell
@ 2003-12-17 16:43       ` John David Anglin
  2003-12-17 18:35         ` Carlos O'Donell
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2003-12-17 16:43 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: parisc-linux

> See:
> 
> gdb/proc-service.c
> gdb/gdbserver/proc-service.c
> 
> *unless* You are insinuating that the loader has messed up the symbol
> resolution and ps_pglobal_lookup exists but isn't resolved properly...
> which is a whole 'nother can of wormns :)

I'll take a look.  Based on what you have said, it's likely the gdb-6.0
isn't being linked correctly on hppa-linux.  Debian gdb-6.0-2 doesn't
build as is, and I had to make some minor mod's to the patch set and hack 
a config file to include linux-nat.o in the required files.

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

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

* Re: [parisc-linux] Re: dlopen failed on 'libthread_db.so.1' -
  2003-12-17 16:43       ` [parisc-linux] Re: dlopen failed on 'libthread_db.so.1' - John David Anglin
@ 2003-12-17 18:35         ` Carlos O'Donell
  2003-12-18  0:21           ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2003-12-17 18:35 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux

On Wed, Dec 17, 2003 at 11:43:48AM -0500, John David Anglin wrote:
> > See:
> > 
> > gdb/proc-service.c
> > gdb/gdbserver/proc-service.c
> > 
> > *unless* You are insinuating that the loader has messed up the symbol
> > resolution and ps_pglobal_lookup exists but isn't resolved properly...
> > which is a whole 'nother can of wormns :)
> 
> I'll take a look.  Based on what you have said, it's likely the gdb-6.0
> isn't being linked correctly on hppa-linux.  Debian gdb-6.0-2 doesn't
> build as is, and I had to make some minor mod's to the patch set and hack 
> a config file to include linux-nat.o in the required files.

AFAIK there was major work required. I shy'd away completely as glibc
was taking up all my time and seemed like a better place to start :)

Current todo:

- Giving up on fixing dlopen from static app, too tough for me right
  now.
- Atomic ups are up next, with possibly a review of time functions,
  monotonicity and a fast gettimeofday.

c.

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

* Re: [parisc-linux] Re: dlopen failed on 'libthread_db.so.1' -
  2003-12-17 18:35         ` Carlos O'Donell
@ 2003-12-18  0:21           ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2003-12-18  0:21 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: parisc-linux

> On Wed, Dec 17, 2003 at 11:43:48AM -0500, John David Anglin wrote:
> > > See:
> > > 
> > > gdb/proc-service.c
> > > gdb/gdbserver/proc-service.c
> > > 
> > > *unless* You are insinuating that the loader has messed up the symbol
> > > resolution and ps_pglobal_lookup exists but isn't resolved properly...
> > > which is a whole 'nother can of wormns :)
> > 
> > I'll take a look.  Based on what you have said, it's likely the gdb-6.0
> > isn't being linked correctly on hppa-linux.  Debian gdb-6.0-2 doesn't
> > build as is, and I had to make some minor mod's to the patch set and hack 
> > a config file to include linux-nat.o in the required files.

dave@gsyprf11:~/gdb-6.0-2/objdir/gdb$ nm gdb|grep ps_pglobal_lookup
000dc904 T ps_pglobal_lookup

Looks as if there is a problem with dlopen.

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

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

* Re: [parisc-linux] Re: dlopen failed on 'libthread_db.so.1' -
       [not found] <no.id>
                   ` (15 preceding siblings ...)
  2003-12-15 22:05 ` [parisc-linux] dlopen failed on 'libthread_db.so.1' - /lib/libthread_db.so.1: undefined symbol: ps_pglobal_lookup John David Anglin
@ 2003-12-18  0:32 ` John David Anglin
  2003-12-18  0:42   ` [parisc-linux] Re: dlopen failed on 'libthread_db.so.1' -g John David Anglin
  2004-01-07 21:14 ` [parisc-linux] [Testers wanted] New glibc with profiling fixed John David Anglin
                   ` (18 subsequent siblings)
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2003-12-18  0:32 UTC (permalink / raw)
  To: John David Anglin; +Cc: carlos, parisc-linux

> dave@gsyprf11:~/gdb-6.0-2/objdir/gdb$ nm gdb|grep ps_pglobal_lookup
> 000dc904 T ps_pglobal_lookup
> 
> Looks as if there is a problem with dlopen.

No, the problem is ps_pglobal_lookup isn't in gdb's dynamic symbol
table.  I'll have to figure out how this is done.

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

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

* Re: [parisc-linux] Re: dlopen failed on 'libthread_db.so.1' -g
  2003-12-18  0:32 ` John David Anglin
@ 2003-12-18  0:42   ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2003-12-18  0:42 UTC (permalink / raw)
  To: John David Anglin; +Cc: carlos, parisc-linux

> No, the problem is ps_pglobal_lookup isn't in gdb's dynamic symbol
> table.  I'll have to figure out how this is done.

Adding --export-dynamic to the gdb link command resolves the problem.

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

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

* Re: [parisc-linux] [Testers wanted] New glibc with profiling fixed.
       [not found] <no.id>
                   ` (16 preceding siblings ...)
  2003-12-18  0:32 ` John David Anglin
@ 2004-01-07 21:14 ` John David Anglin
  2004-01-07 21:14 ` John David Anglin
                   ` (17 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2004-01-07 21:14 UTC (permalink / raw)
  To: John David Anglin; +Cc: carlos, parisc-linux, debian-hppa

> Did I miss something?

Yup.

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

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

* Re: [parisc-linux] [Testers wanted] New glibc with profiling fixed.
       [not found] <no.id>
                   ` (17 preceding siblings ...)
  2004-01-07 21:14 ` [parisc-linux] [Testers wanted] New glibc with profiling fixed John David Anglin
@ 2004-01-07 21:14 ` John David Anglin
  2004-08-31  4:23 ` [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please test John David Anglin
                   ` (16 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2004-01-07 21:14 UTC (permalink / raw)
  To: John David Anglin; +Cc: carlos, parisc-linux, debian-hppa

> Did I miss something?

Yup.

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

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

* [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please test.
       [not found] <no.id>
                   ` (18 preceding siblings ...)
  2004-01-07 21:14 ` John David Anglin
@ 2004-08-31  4:23 ` John David Anglin
  2004-08-31 20:43   ` [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please te John David Anglin
  2005-03-05 21:53 ` [parisc-linux] Re: Comments? John David Anglin
                   ` (15 subsequent siblings)
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2004-08-31  4:23 UTC (permalink / raw)
  To: John David Anglin; +Cc: James.Bottomley, parisc-linux, tausq

> > This is more important for you, approximately 48 hours ago, Linus
> > commited a fix for a signal handling race.
> > 
> > http://linux.bkbits.net:8080/linux-2.6/cset@1.1846.1.48?nav=index.html|Chang
> > eSet@-2d
> 
> I have the patch under test on hiauly6 with todays CVS.

I've been running this now for three days on hiauly6 with a 32-bit
2.6.8.1-pa7 kernel (default c3000 config) doing almost continuous gcc
builds.  Things seem pretty promising.  No random SIGSEGVs and expect
seems to be behaving itself.

> I had another SIGSEGV on gsyprf11.  It looks as if this was in /bin/sh
> although gdb doesn't say which program the fault ocurred in.

This is definitely not the case with the 64-bit SMP kernel on gsyprf11.
There I've been testing with an unpatched kernel.  Expect works better with
tcl8.3 but there are still some tests that fail when they shouldn't, and
the output with tests which produce a large amount of output gets
truncated.  With tcl8.4, expect has major problems.  The Tcl_Finalize
patch doesn't fix them.  I think we need to try Carlos's patch on a
64-bit SMP system to see if it helps the expect and SEGV problems.

I'm off to Korea early Thursday morning so I can't do much more on
this until I'm back in a couple of weeks.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please te
  2004-08-31  4:23 ` [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please test John David Anglin
@ 2004-08-31 20:43   ` John David Anglin
  2004-09-01 20:08     ` John David Anglin
  2004-09-02  6:29     ` [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please te Carlos O'Donell
  0 siblings, 2 replies; 194+ messages in thread
From: John David Anglin @ 2004-08-31 20:43 UTC (permalink / raw)
  To: John David Anglin; +Cc: James.Bottomley, parisc-linux, tausq

> I've been running this now for three days on hiauly6 with a 32-bit
> 2.6.8.1-pa7 kernel (default c3000 config) doing almost continuous gcc
> builds.  Things seem pretty promising.  No random SIGSEGVs and expect
> seems to be behaving itself.

As usual, I have to eat my words.  The libjava "PR218 -O3 execution -
source compiled test" hung in the libjava testsuite on the next gcc
build.  Looking at libjava.log, I see that there is no "WARNING:
program timed out." message for this test.  Thus, the alarm signal
for this test somehow got lost.  The testsuite continued after I
killed PR218.exe.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please te
  2004-08-31 20:43   ` [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please te John David Anglin
@ 2004-09-01 20:08     ` John David Anglin
  2004-09-11  7:24       ` [parisc-linux] Another SIGSEGV, this time in /bin/sh John David Anglin
  2004-09-02  6:29     ` [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please te Carlos O'Donell
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2004-09-01 20:08 UTC (permalink / raw)
  To: John David Anglin; +Cc: James.Bottomley, parisc-linux, tausq

Hi Randolph,

> > I've been running this now for three days on hiauly6 with a 32-bit
> > 2.6.8.1-pa7 kernel (default c3000 config) doing almost continuous gcc
> > builds.  Things seem pretty promising.  No random SIGSEGVs and expect
> > seems to be behaving itself.
> 
> As usual, I have to eat my words.  The libjava "PR218 -O3 execution -
> source compiled test" hung in the libjava testsuite on the next gcc
> build.  Looking at libjava.log, I see that there is no "WARNING:
> program timed out." message for this test.  Thus, the alarm signal
> for this test somehow got lost.  The testsuite continued after I
> killed PR218.exe.

Ok, the next time around on gsyprf11 expect did a SIGSEGV after the
exact same test.  The timeout warning was printed in the log this time.

The core dump, core.20875, is in my home directory.  The expect
program is /home/dave/opt/gnu/bin/expect.  I can see that expect
died because %r4 has apparently gotten clobbered.  It contains
0.  %r4 was used to restore the pic register after the last call.
We then die in a stub that uses the pic register.

Is there any chance you could look at fixing the backtrace command
in gdb?  Here is the bt:

(gdb) bt
#0  0x406a0ef4 in NativePathInFilesystem () from /usr/lib/libtcl8.4.so.0
#1  0x406d5be4 in Tcl_WaitForEvent () from /usr/lib/libtcl8.4.so.0
#2  0x00000000 in ?? ()
#3  0x00000000 in ?? ()
(gdb) maint print unwind 0x406d5be4
unwind_table_entry (0x6a6744):
        region_start = 0x406d59b0 <Tcl_WaitForEvent+784>
	region_end = 0x406d5e0c <Tcl_WaitForEvent+1900>
	flags = Save_RP
	Region_description = 0x1
	Entry_FR = 0x0
	Entry_GR = 0x10
	Total_frame_size = 0x48
(gdb) disass 0x406a0ee4 0x406a0f04
Dump of assembler code from 0x406a0ee4 to 0x406a0f04:
0x406a0ee4 <NativePathInFilesystem+1668>:       ldw 518(,r1),r21
0x406a0ee8 <NativePathInFilesystem+1672>:       bv r0(r21)
0x406a0eec <NativePathInFilesystem+1676>:       ldw 51c(,r1),r19
0x406a0ef0 <NativePathInFilesystem+1680>:       addil -1800,r19,%r1
0x406a0ef4 <NativePathInFilesystem+1684>:       ldw 320(,r1),r21
0x406a0ef8 <NativePathInFilesystem+1688>:       bv r0(r21)
0x406a0efc <NativePathInFilesystem+1692>:       ldw 324(,r1),r19
0x406a0f00 <NativePathInFilesystem+1696>:       addil -1800,r19,%r1
(gdb) disass 0x406d5bc4 0x406d5bf4
Dump of assembler code from 0x406d5bc4 to 0x406d5bf4:
0x406d5bc4 <Tcl_WaitForEvent+1316>:     stw r8,-34(,sp)
0x406d5bc8 <Tcl_WaitForEvent+1320>:     copy r4,r19
0x406d5bcc <Tcl_WaitForEvent+1324>:     copy r5,r26
0x406d5bd0 <Tcl_WaitForEvent+1328>:     ldo -238(sp),r25
0x406d5bd4 <Tcl_WaitForEvent+1332>:     ldo -1b8(sp),r24
0x406d5bd8 <Tcl_WaitForEvent+1336>:     ldo -138(sp),r23
0x406d5bdc <Tcl_WaitForEvent+1340>:     b,l 0x406a2394 <NativePathInFilesystem+6
964>,rp
0x406d5be0 <Tcl_WaitForEvent+1344>:     ldi 60,r7
0x406d5be4 <Tcl_WaitForEvent+1348>:     cmpib,= -1,ret0,0x406d5b24 <Tcl_WaitForE
vent+1156>
0x406d5be8 <Tcl_WaitForEvent+1352>:     copy r4,r19
0x406d5bec <Tcl_WaitForEvent+1356>:     b,l 0x406a0ef0 <NativePathInFilesystem+1
680>,rp
0x406d5bf0 <Tcl_WaitForEvent+1360>:     copy r14,r26
(gdb) p/x $rp
$1 = 0x406d5bf7
(gdb) disass 0x406a2394 0x406a23a4
Dump of assembler code from 0x406a2394 to 0x406a23a4:
0x406a2394 <NativePathInFilesystem+6964>:       addil -800,r19,%r1
0x406a2398 <NativePathInFilesystem+6968>:       ldw a0(,r1),r21
0x406a239c <NativePathInFilesystem+6972>:       bv r0(r21)

I'm not quite sure how we got to the point of the segfault.  However,
with respect to gdb, the back trace uses the wrong function symbol
in both frames 0 and 1.  We are in a stub in frame 0.  I'm fairly
sure that this is why the bt fails at frame 2.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please te
  2004-08-31 20:43   ` [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please te John David Anglin
  2004-09-01 20:08     ` John David Anglin
@ 2004-09-02  6:29     ` Carlos O'Donell
  1 sibling, 0 replies; 194+ messages in thread
From: Carlos O'Donell @ 2004-09-02  6:29 UTC (permalink / raw)
  To: John David Anglin; +Cc: James.Bottomley, parisc-linux, tausq

On Tue, Aug 31, 2004 at 04:43:11PM -0400, John David Anglin wrote:
> > I've been running this now for three days on hiauly6 with a 32-bit
> > 2.6.8.1-pa7 kernel (default c3000 config) doing almost continuous gcc
> > builds.  Things seem pretty promising.  No random SIGSEGVs and expect
> > seems to be behaving itself.
> 
> As usual, I have to eat my words.  The libjava "PR218 -O3 execution -
> source compiled test" hung in the libjava testsuite on the next gcc
> build.  Looking at libjava.log, I see that there is no "WARNING:
> program timed out." message for this test.  Thus, the alarm signal
> for this test somehow got lost.  The testsuite continued after I
> killed PR218.exe.

Losing signals under load is very bad, I don't see where or why this
might be happening. I don't really know what that test does, if it uses
compare_and_swap in any way then it's non-atomic and all sorts of bad
things could happen under load.

I'm still writing my paper, so I can't add the hooks in for this.

c.

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Another SIGSEGV, this time in /bin/sh
  2004-09-01 20:08     ` John David Anglin
@ 2004-09-11  7:24       ` John David Anglin
  2004-09-13 15:01         ` [parisc-linux] " Carlos O'Donell
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2004-09-11  7:24 UTC (permalink / raw)
  To: John David Anglin; +Cc: James.Bottomley, parisc-linux, tausq

I had another SIGSEGV today building gcc on gsyprf11.

dave@gsyprf11:~/gcc-3.5/objdir$ gdb /bin/sh gcc/core.save.1
GNU gdb 2004-09-01-cvs
...
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/debug/libncurses.so.5...done.
Loaded symbols for /usr/lib/debug/libncurses.so.5
Reading symbols from /usr/lib/debug/libdl.so.2...done.
Loaded symbols for /usr/lib/debug/libdl.so.2
Reading symbols from /usr/lib/debug/libc.so.6...done.
Loaded symbols for /usr/lib/debug/libc.so.6
Reading symbols from /lib/ld.so.1...done.
Loaded symbols for /lib/ld.so.1
#0  0xf7025554 in ?? ()

Looking at %r2, it appears that the fault has occurred in an indirect
call from __strtoll_internal:

(gdb) p/x $rp
$1 = 0x40785883
(gdb) disass 0x40785860 0x40785888
Dump of assembler code from 0x40785860 to 0x40785888:
0x40785860 <*__GI___strtoll_internal+2972>:     copy r19,r4
0x40785864 <*__GI___strtoll_internal+2976>:     b,l 0x4076c508 <__gconv_read_conf+916>,r31
0x40785868 <*__GI___strtoll_internal+2980>:     copy r31,rp
0x4078586c <*__GI___strtoll_internal+2984>:     b,l 0x40785848 <*__GI___strtoll_internal+2948>,r0
0x40785870 <*__GI___strtoll_internal+2988>:     copy r4,r19
0x40785874 <*__GI___strtoll_internal+2992>:     copy r19,r4
0x40785878 <*__GI___strtoll_internal+2996>:     b,l 0x4076c508 <__gconv_read_conf+916>,r31
0x4078587c <*__GI___strtoll_internal+3000>:     copy r31,rp

We appear to have reached 0x40785874 from the following code:

0x40784d40 <*__GI___strtoll_internal+124>:      ldi 24,r20
0x40784d44 <*__GI___strtoll_internal+128>:      cmpb,>= r20,r9,0x40784db8 <*__GI___strtoll_internal+244>
0x40784d48 <*__GI___strtoll_internal+132>:      addil 1000,r19,%r1
...
0x40784db8 <*__GI___strtoll_internal+244>:      ldw -124(,sp),r7
0x40784dbc <*__GI___strtoll_internal+248>:      ldi 20,r10
---Type <return> to continue, or q <return> to quit---
0x40784dc4 <*__GI___strtoll_internal+256>:      stw r7,-f0(,sp)
0x40784dc8 <*__GI___strtoll_internal+260>:      addil 1000,r19,%r1
0x40784dcc <*__GI___strtoll_internal+264>:      copy r3,r8
0x40784dd0 <*__GI___strtoll_internal+268>:      ldw 390(,r1),r6
0x40784dd4 <*__GI___strtoll_internal+272>:      ldw 98(,r3),r22
0x40784dd8 <*__GI___strtoll_internal+276>:      addil 1000,r19,%r1
0x40784ddc <*__GI___strtoll_internal+280>:      cmpib,<> 0,r22,0x40785874 <*__GI
I___strtoll_internal+2992>

The address for the indirect call, r22, was loaded as follows:
(gdb) p/x *($r3 + 0x98)
$20 = 0xf7025555

Some interesting registers:
(gdb) p/x $r10
$23 = 0x20
(gdb) p/x $r3
$13 = 0xe3c08
(gdb) p/x $r8
$16 = 0xe3c08
(gdb) p/x $r6
$18 = 0x408a1c8c
(gdb) p/x *($r19 + 0x1000 + 0x390)
$17 = 0x408a1c8c
(gdb) p/x $r7
$21 = 0xd65e8
(gdb) p/x *($sp - 0xf0)
$22 = 0xd65e8

This establishes how we got to the failure point.

It would appear that r3 has either been clobbered by the kernel, or there
is a problem with the memory access by which it was loaded:

(gdb) p/x *($r19 + 0x1000 + 0x354)
$12 = 0x408a98fc

This should have given the r3 value.  The same procedure gave the r6 value.

(gdb) p/x *(*($r19 + 0x1000 + 0x354) + 0x98)
$19 = 0x0

This is probably the value that r22 should have had.

The failure doesn't happen consistently as rerunning the script which failed
was successful.

Any thoughts?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: Another SIGSEGV, this time in /bin/sh
  2004-09-11  7:24       ` [parisc-linux] Another SIGSEGV, this time in /bin/sh John David Anglin
@ 2004-09-13 15:01         ` Carlos O'Donell
  0 siblings, 0 replies; 194+ messages in thread
From: Carlos O'Donell @ 2004-09-13 15:01 UTC (permalink / raw)
  To: John David Anglin; +Cc: James.Bottomley, parisc-linux, tausq

jda,

What kernel is this btw?

> Program terminated with signal 11, Segmentation fault.
> Reading symbols from /usr/lib/debug/libncurses.so.5...done.
> Loaded symbols for /usr/lib/debug/libncurses.so.5
> Reading symbols from /usr/lib/debug/libdl.so.2...done.
> Loaded symbols for /usr/lib/debug/libdl.so.2
> Reading symbols from /usr/lib/debug/libc.so.6...done.
> Loaded symbols for /usr/lib/debug/libc.so.6
> Reading symbols from /lib/ld.so.1...done.
> Loaded symbols for /lib/ld.so.1

Why isn't this the debug ld.so?

> Looking at %r2, it appears that the fault has occurred in an indirect
> call from __strtoll_internal:

But it's always some place different every failure...
 
> It would appear that r3 has either been clobbered by the kernel, or there
> is a problem with the memory access by which it was loaded:

It's possible.
 
> This should have given the r3 value.  The same procedure gave the r6 value.
> (gdb) p/x *(*($r19 + 0x1000 + 0x354) + 0x98)
> $19 = 0x0

So you are saying that the code should have given that value, but
something corrupted the value before it was used?

It definately looks signal related. It feels a lot like some return path
in the kernel might be clobbering r3. Time for another witch hunt?

c.

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: Comments?
       [not found] <no.id>
                   ` (19 preceding siblings ...)
  2004-08-31  4:23 ` [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please test John David Anglin
@ 2005-03-05 21:53 ` John David Anglin
  2005-03-06  0:22   ` John David Anglin
  2005-07-16  2:55 ` [parisc-linux] Re: Non-inline math, and inline math broken, GCC to blame? (1 hppa tls toolchain regression) John David Anglin
                   ` (14 subsequent siblings)
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2005-03-05 21:53 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux, tausq

> > > I think we have somehow broken __cffc.  I did a binutils build
> > > yesterday and various ld tests are now failing.  These are tests
> > > that compare function pointers.
> > 
> > I didn't feed anything new into debian-glibc. All my patches have always
> > strived to keep __cffc working, if I messup the function pointer
> > comparison I get a slew of glibc testsuite failures which I always
> > patchup by making sure __cffc works :)
> 
> I haven't touched fptr.c either, although there is a change in GCC
> 4.0 with respect to canonicalization.  I'm using the debian glibc,
> 2.3.2.ds1-20, on the system on which I noticed this problem.

Ok, ld is broken in the binutils CVS head.
__canonicalize_funcptr_for_compare doesn't load the correct address
for _GLOBAL_OFFSET_TABLE_ in shared libraries.  It loads the address
used by main.  As a result, it thinks the plabel for the function
has been resolved ;(

The testcase is:

foo.c:

extern void bar (void);
typedef void (*func_t)(void);
int
foo (func_t f)
{
  return f == bar;
}

bar.c:

void bar (void) {};
int
main ()
{
  if (!foo (bar))
    abort ();
  return 0;
}

gcc -g -fPIC -S foo.c
gcc -shared -fPIC -o foo.sl foo.o
gcc -c -g -w bar.c
gcc -o bar bar.o foo.sl

nm foo.sl
...
00010ab0 a _GLOBAL_OFFSET_TABLE_

nm bar
...
00020c54 d _GLOBAL_OFFSET_TABLE_

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: Comments?
  2005-03-05 21:53 ` [parisc-linux] Re: Comments? John David Anglin
@ 2005-03-06  0:22   ` John David Anglin
  2005-03-08 17:32     ` Carlos O'Donell
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2005-03-06  0:22 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux, tausq

> Ok, ld is broken in the binutils CVS head.
> __canonicalize_funcptr_for_compare doesn't load the correct address
> for _GLOBAL_OFFSET_TABLE_ in shared libraries.  It loads the address
> used by main.  As a result, it thinks the plabel for the function
> has been resolved ;(

Found it:

2004-11-02  Hans-Peter Nilsson  <hp@axis.com>

        * elflink.c (_bfd_elf_create_got_section): Hide _GLOBAL_OFFSET_TABLE_.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: Comments?
  2005-03-06  0:22   ` John David Anglin
@ 2005-03-08 17:32     ` Carlos O'Donell
  2005-03-08 17:44       ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2005-03-08 17:32 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux, tausq

On Sat, Mar 05, 2005 at 07:22:27PM -0500, John David Anglin wrote:
> > Ok, ld is broken in the binutils CVS head.
> > __canonicalize_funcptr_for_compare doesn't load the correct address
> > for _GLOBAL_OFFSET_TABLE_ in shared libraries.  It loads the address
> > used by main.  As a result, it thinks the plabel for the function
> > has been resolved ;(
> 
> Found it:
> 
> 2004-11-02  Hans-Peter Nilsson  <hp@axis.com>
> 
>         * elflink.c (_bfd_elf_create_got_section): Hide _GLOBAL_OFFSET_TABLE_.

I'd seen that fly by on binutils and it caused a certain amount of grief
in glibc. I'm not quite sure what the rational was behind hiding _GOT_.

c.

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: Comments?
  2005-03-08 17:32     ` Carlos O'Donell
@ 2005-03-08 17:44       ` John David Anglin
  2005-03-08 17:54         ` Carlos O'Donell
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2005-03-08 17:44 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: parisc-linux, tausq

> > 2004-11-02  Hans-Peter Nilsson  <hp@axis.com>
> > 
> >         * elflink.c (_bfd_elf_create_got_section): Hide _GLOBAL_OFFSET_TABLE_.
> 
> I'd seen that fly by on binutils and it caused a certain amount of grief
> in glibc. I'm not quite sure what the rational was behind hiding _GOT_.

I believe that the idea was that main code would see its _GOT_ address
and shared libraries their respective _GOT_ address.  It turns out that
it was sort of a fluke that function pointer canonicalization worked.
Only function pointers in the main part of an application are not
resolved.  Shared library function pointers are resolved when the
library is loaded.  __cffc was always looking at the _GOT_ address
for the main app (i.e., the main _GLOBAL_OFFSET_TABLE_ value overrode
the shared library symbol).

This problem was fixed yesterday by Alan Modra.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: Comments?
  2005-03-08 17:44       ` John David Anglin
@ 2005-03-08 17:54         ` Carlos O'Donell
  2005-03-08 19:02           ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2005-03-08 17:54 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux, tausq

On Tue, Mar 08, 2005 at 12:44:53PM -0500, John David Anglin wrote:
> > > 2004-11-02  Hans-Peter Nilsson  <hp@axis.com>
> > > 
> > >         * elflink.c (_bfd_elf_create_got_section): Hide _GLOBAL_OFFSET_TABLE_.
> > 
> > I'd seen that fly by on binutils and it caused a certain amount of grief
> > in glibc. I'm not quite sure what the rational was behind hiding _GOT_.
> 
> I believe that the idea was that main code would see its _GOT_ address
> and shared libraries their respective _GOT_ address.  It turns out that
> it was sort of a fluke that function pointer canonicalization worked.
> Only function pointers in the main part of an application are not
> resolved.  Shared library function pointers are resolved when the
> library is loaded.  __cffc was always looking at the _GOT_ address
> for the main app (i.e., the main _GLOBAL_OFFSET_TABLE_ value overrode
> the shared library symbol).
> 
> This problem was fixed yesterday by Alan Modra.

I'm not sure what you mean in your statement "shared library function
pointers are resolved when the library is loaded?" The function pointers
exist as two-byte entries in the PLT, and are non-unique, and they
aren't resolved until call time with lazy resolution.

I would imagine that the main _GOT_ is supposed to override the shared
library _GOT_. __cffc is only looking at the _GOT_ to get the fptr that
the dynamic loader wrote there during setup, so that it can get called
for symbol resolution. This setup is done for all objects, which
includes all the _GOT_'s, from the application to all the loaded shared
libraries.

Or rather are you saying, that from a shared library, the library saw
only the _GOT_ from the main applicaiton? I would think that this 
wouldn't effect the library since the loader setup r19 properly, and
aslong as it doesn't use _GOT_ then it's fine.

c.

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: Comments?
  2005-03-08 17:54         ` Carlos O'Donell
@ 2005-03-08 19:02           ` John David Anglin
  2005-03-08 21:08             ` [parisc-linux] OPD's on hppa-linux, and what to do about __cffc's fragility Carlos O'Donell
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2005-03-08 19:02 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: parisc-linux, tausq

> > This problem was fixed yesterday by Alan Modra.
> 
> I'm not sure what you mean in your statement "shared library function
> pointers are resolved when the library is loaded?" The function pointers
> exist as two-byte entries in the PLT, and are non-unique, and they
> aren't resolved until call time with lazy resolution.

This is what Alasn said:

  I checked.  &_GLOBAL_OFFSET_TABLE_ in fptr.c does resolve to the main
  app GOT before the change.  That in fact is what is needed, because
  according to what I see in dl-machine.h, plabels in shared libs will be
  resolved.  I think it's only plabels in the main app for global
  functions that won't be resolved (because they point into the plt).

  Hmm.  If PLABEL32 relocs in the main app were emitted as dynamic relocs,
  then ld.so would call _dl_make_fptr for them.  I think you wouldn't need
  __canonicalize_funcptr_for_compare any more..

I don't think we could completely do away with __cffc but if the
plabels were always resolved we could just look inside the plabel
to get the function address.

> I would imagine that the main _GOT_ is supposed to override the shared
> library _GOT_. __cffc is only looking at the _GOT_ to get the fptr that
> the dynamic loader wrote there during setup, so that it can get called
> for symbol resolution. This setup is done for all objects, which
> includes all the _GOT_'s, from the application to all the loaded shared
> libraries.

If the dynamic loader always uses the main app's got for the trampoline,
__cffc would work for plabels in shared libraries that used lazy linking.

> Or rather are you saying, that from a shared library, the library saw
> only the _GOT_ from the main applicaiton? I would think that this 
> wouldn't effect the library since the loader setup r19 properly, and
> aslong as it doesn't use _GOT_ then it's fine.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] OPD's on hppa-linux, and what to do about __cffc's fragility.
  2005-03-08 19:02           ` John David Anglin
@ 2005-03-08 21:08             ` Carlos O'Donell
  2005-03-08 21:48               ` [parisc-linux] " John David Anglin
  2005-03-08 22:25               ` Alan Modra
  0 siblings, 2 replies; 194+ messages in thread
From: Carlos O'Donell @ 2005-03-08 21:08 UTC (permalink / raw)
  To: John David Anglin; +Cc: Alan Modra, parisc-linux, tausq

On Tue, Mar 08, 2005 at 02:02:33PM -0500, John David Anglin wrote:
> > > This problem was fixed yesterday by Alan Modra.
> > 
> > I'm not sure what you mean in your statement "shared library function
> > pointers are resolved when the library is loaded?" The function pointers
> > exist as two-byte entries in the PLT, and are non-unique, and they
> > aren't resolved until call time with lazy resolution.

Once, we start quoting Alan, I believe it's time to atleast let him read
some of the remarks. Perhaps he will have some insightful comment.
 
> This is what Alasn said:
> 
>   I checked.  &_GLOBAL_OFFSET_TABLE_ in fptr.c does resolve to the main
>   app GOT before the change.  That in fact is what is needed, because
>   according to what I see in dl-machine.h, plabels in shared libs will be
>   resolved.  I think it's only plabels in the main app for global
>   functions that won't be resolved (because they point into the plt).
> 
>   Hmm.  If PLABEL32 relocs in the main app were emitted as dynamic relocs,
>   then ld.so would call _dl_make_fptr for them.  I think you wouldn't need
>   __canonicalize_funcptr_for_compare any more..
> 
> I don't think we could completely do away with __cffc but if the
> plabels were always resolved we could just look inside the plabel
> to get the function address.

Perhaps some background and clarification...

Okay, *ABS* (R_PARISC_IPLT, r_sym == 0) entries are automatically
relocated at startup, because we have enough information, we are already
walking the PLT list, and it takes only a single add to complete the
relocation. 

Next, anything else (R_PARISC_IPLT, r_sym != 0) is pointed at the
plt/got stub (which calls the trampoline _dl_runtime_resolve) since it
will require symbol resolution to fixup.

I don't quite understand what Alan is getting at when he says "If
PLABEL32 relocs in the main app were emitted as dynamic relocs,"

I'm really a stickler for nomeclature. In my mind a "resolved" plabel is
one whose ip/gp point to the true and final function address after the ELF
symbol resolution rules have been followed for that symbol. Is this the
generally accepted definition? I interchangably think plabel == fptr.

> > I would imagine that the main _GOT_ is supposed to override the shared
> > library _GOT_. __cffc is only looking at the _GOT_ to get the fptr that
> > the dynamic loader wrote there during setup, so that it can get called
> > for symbol resolution. This setup is done for all objects, which
> > includes all the _GOT_'s, from the application to all the loaded shared
> > libraries.
> 
> If the dynamic loader always uses the main app's got for the trampoline,
> __cffc would work for plabels in shared libraries that used lazy linking.

To clarify this, you mean to say if the loader always uses the main
app's plt/got stub then everything would be okay. The check in __cffc to
see if the plabel has been resolved would work (e.g. got !=
&_GLOBAL_OFFSET_TABLE_).

It didn't make a difference in the past because the shared library
plabels were already resolved? Wouldn't this mean that lazy linking
wasn't working at all?

So only the main app symbols had to be resolved, and this worked fine.
Thus the comparison worked fine.

I don't quite understand why this broke, if someone would be so kind as
the point out the error in my thinking.

c.

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: OPD's on hppa-linux, and what to do about __cffc's fragility.
  2005-03-08 21:08             ` [parisc-linux] OPD's on hppa-linux, and what to do about __cffc's fragility Carlos O'Donell
@ 2005-03-08 21:48               ` John David Anglin
  2005-03-08 21:52                 ` John David Anglin
  2005-03-08 22:25               ` Alan Modra
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2005-03-08 21:48 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: amodra, parisc-linux, tausq

> I'm really a stickler for nomeclature. In my mind a "resolved" plabel is
> one whose ip/gp point to the true and final function address after the ELF
> symbol resolution rules have been followed for that symbol. Is this the
> generally accepted definition? I interchangably think plabel == fptr.

I agree with the former definition regarding a resolved plabel.  I believe
that the term plabel is interchangeable with the term function descriptor.
A function pointer on the otherhand may point either directly to the
code address of the function or to a plabel.

> > > I would imagine that the main _GOT_ is supposed to override the shared
> > > library _GOT_. __cffc is only looking at the _GOT_ to get the fptr that
> > > the dynamic loader wrote there during setup, so that it can get called
> > > for symbol resolution. This setup is done for all objects, which
> > > includes all the _GOT_'s, from the application to all the loaded shared
> > > libraries.
> > 
> > If the dynamic loader always uses the main app's got for the trampoline,
> > __cffc would work for plabels in shared libraries that used lazy linking.
> 
> To clarify this, you mean to say if the loader always uses the main
> app's plt/got stub then everything would be okay. The check in __cffc to
> see if the plabel has been resolved would work (e.g. got !=
> &_GLOBAL_OFFSET_TABLE_).

Yes.

> It didn't make a difference in the past because the shared library
> plabels were already resolved? Wouldn't this mean that lazy linking
> wasn't working at all?

If shared libraries used the main app's &_GLOBAL_OFFSET_TABLE_, then
lazy linking could be working.   The testcase that I posted had a
plabel constructor in the shared library.  I recall now that the got
pointer for the plabel was the main app's &_GLOBAL_OFFSET_TABLE_.

> I don't quite understand why this broke, if someone would be so kind as
> the point out the error in my thinking.

Hiding _GLOBAL_OFFSET_TABLE_, resulted in _GLOBAL_OFFSET_TABLE_
being local to shared libraries, as a result __cffc no longer used
the main app's &_GLOBAL_OFFSET_TABLE_.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: OPD's on hppa-linux, and what to do about __cffc's fragility.
  2005-03-08 21:48               ` [parisc-linux] " John David Anglin
@ 2005-03-08 21:52                 ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2005-03-08 21:52 UTC (permalink / raw)
  To: John David Anglin; +Cc: amodra, parisc-linux, tausq

> A function pointer on the otherhand may point either directly to the
> code address of the function or to a plabel.

Further, there are some special function pointers like -1.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: OPD's on hppa-linux, and what to do about __cffc's fragility.
  2005-03-08 21:08             ` [parisc-linux] OPD's on hppa-linux, and what to do about __cffc's fragility Carlos O'Donell
  2005-03-08 21:48               ` [parisc-linux] " John David Anglin
@ 2005-03-08 22:25               ` Alan Modra
  2005-03-10 15:31                 ` Carlos O'Donell
  1 sibling, 1 reply; 194+ messages in thread
From: Alan Modra @ 2005-03-08 22:25 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: John David Anglin, parisc-linux, tausq

On Tue, Mar 08, 2005 at 04:08:51PM -0500, Carlos O'Donell wrote:
> On Tue, Mar 08, 2005 at 02:02:33PM -0500, John David Anglin wrote:
> > > > This problem was fixed yesterday by Alan Modra.
> > > 
> > > I'm not sure what you mean in your statement "shared library function
> > > pointers are resolved when the library is loaded?" The function pointers
> > > exist as two-byte entries in the PLT, and are non-unique, and they
> > > aren't resolved until call time with lazy resolution.

No, in an hppa-linux shared lib, a function pointer is accessed via a
word with a PLABEL32 reloc on it.  This reloc is processed before any
code in the shared lib runs, to point to a function descriptor created
by _dl_make_fptr.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: OPD's on hppa-linux, and what to do about __cffc's fragility.
  2005-03-08 22:25               ` Alan Modra
@ 2005-03-10 15:31                 ` Carlos O'Donell
  2005-03-10 22:27                   ` Alan Modra
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2005-03-10 15:31 UTC (permalink / raw)
  To: Alan Modra; +Cc: John David Anglin, parisc-linux, tausq

On Wed, Mar 09, 2005 at 08:55:13AM +1030, Alan Modra wrote:
> No, in an hppa-linux shared lib, a function pointer is accessed via a
> word with a PLABEL32 reloc on it.  This reloc is processed before any
> code in the shared lib runs, to point to a function descriptor created
> by _dl_make_fptr.

In shared libraries the function pointer is also allocated a PLT slot
and an IPLT relocation. 

I don't understand the reasons for the allocation of a PLT slot if all
references generated go through the local label word that has the
PLABEL32 reloc, which now contains the address returned by
_dl_make_ftpr.

I'm still trying to understand your earlier recommendation. Do you
suggest that the executable have PLABEL32 relocs for all the symbols,
local and global, which assures that _dl_make_fptr creates a unique OPD?

Alan, thanks for your input.

c.

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: OPD's on hppa-linux, and what to do about __cffc's fragility.
  2005-03-10 15:31                 ` Carlos O'Donell
@ 2005-03-10 22:27                   ` Alan Modra
  2005-03-11 18:05                     ` [parisc-linux] Solution to OPD's in hppa-linux, including a transition plan? Carlos O'Donell
  0 siblings, 1 reply; 194+ messages in thread
From: Alan Modra @ 2005-03-10 22:27 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: John David Anglin, parisc-linux, tausq

On Thu, Mar 10, 2005 at 10:31:20AM -0500, Carlos O'Donell wrote:
> On Wed, Mar 09, 2005 at 08:55:13AM +1030, Alan Modra wrote:
> > No, in an hppa-linux shared lib, a function pointer is accessed via a
> > word with a PLABEL32 reloc on it.  This reloc is processed before any
> > code in the shared lib runs, to point to a function descriptor created
> > by _dl_make_fptr.
> 
> In shared libraries the function pointer is also allocated a PLT slot
> and an IPLT relocation. 
> 
> I don't understand the reasons for the allocation of a PLT slot if all
> references generated go through the local label word that has the
> PLABEL32 reloc, which now contains the address returned by
> _dl_make_ftpr.

There probably isn't a good reason.  Blame that on me not understanding
what I was doing when dhd and I hacked together ld and glibc hppa-linux
support.

> I'm still trying to understand your earlier recommendation. Do you
> suggest that the executable have PLABEL32 relocs for all the symbols,
> local and global, which assures that _dl_make_fptr creates a unique OPD?

I was really just thinking of global symbols.  If ld handles descriptors
for locals, you save on dynamic relocs and program startup time.  I
haven't spent a great deal of time thinking about it though, so it's
highly likely that there is some reason why it won't work.  eg. You
wouldn't want dynamic plabel relocs to appear in read-only sections.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Solution to OPD's in hppa-linux, including a transition plan?
  2005-03-10 22:27                   ` Alan Modra
@ 2005-03-11 18:05                     ` Carlos O'Donell
  2005-03-12  0:49                       ` [parisc-linux] " John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2005-03-11 18:05 UTC (permalink / raw)
  To: Alan Modra; +Cc: John David Anglin, parisc-linux, tausq

On Fri, Mar 11, 2005 at 08:57:51AM +1030, Alan Modra wrote:
> > In shared libraries the function pointer is also allocated a PLT slot
> > and an IPLT relocation. 
> > 
> > I don't understand the reasons for the allocation of a PLT slot if all
> > references generated go through the local label word that has the
> > PLABEL32 reloc, which now contains the address returned by
> > _dl_make_ftpr.
> 
> There probably isn't a good reason.  Blame that on me not understanding
> what I was doing when dhd and I hacked together ld and glibc hppa-linux
> support.

I understand why you allocate a PLT slot, because function calls seem to
go through the PLT only without reference to the PLABEL32 word (in
shared libraries). This saves an indirection through the PLABEL32 word
during a call. I believe this to be what is happening, and I verfiied it
lightly.

I went through the sources again, and you made some argument in a
comment about passing "local function pointers" to other objects.

The only way to verify my ideas is to run some tests, so here is the
apparent summary.

- Executable passes local function pointer to shared object.
 = Passes the address of the PLT entry.
 = PLT entry has IPLT reloc.

- Shared object passes local function pointer to other shared object.
 = Passes the address of *(PLABEL32 word) which points to a fdesc
   made by _dl_make_fptr.
 = The PLABEL32 word has a PLABEL32 reloc.

- Shared object calls a local or global function.
 = Calls through the PLT, which has an IPLT reloc.

- Executable calls local function.
 = Jumps directly to address.

- Executable calls global function.
 = Uses dyncall on the address of hte PLT
 = PLT has IPLT reloc.

> > I'm still trying to understand your earlier recommendation. Do you
> > suggest that the executable have PLABEL32 relocs for all the symbols,
> > local and global, which assures that _dl_make_fptr creates a unique OPD?
> 
> I was really just thinking of global symbols.  If ld handles descriptors
> for locals, you save on dynamic relocs and program startup time.  I
> haven't spent a great deal of time thinking about it though, so it's
> highly likely that there is some reason why it won't work.  eg. You
> wouldn't want dynamic plabel relocs to appear in read-only sections.

I thought about this, and you are correct. Technically if the shared
object can do a comparison then the symbol must have been global, and
passed into the function.

How do I do this in a backwards compatible way?

Action
=======
If we emit a PLABEL32 reloc for all global symbols in the executable,
baring relocs in read-only sections, which I'm sure shared libraries
have the same problems, then the executable passes the address stored
in the plabel word.

Case 1:
=======
For these new executables gcc will not generate __cffc comparisons.
For new libraries gcc will not generate __cffc comparisons.

Case 2:
=======
Old executables will still pass the address of the plt entry, and
comparisons in new shared libraries will fail.

Case 3:
=======
New executables and old shared libraries will work just fine, since
__cffc will think that everything has been resolved properly and just
do comparison.

Fixes:
======
Transition all executables to use PLABEL32 relocs for global symbols,
the same as shared libraries. Keep gcc generating __cffc.
One day when all the executables have been rebuilt, we can start turning
off the generation of __cffc and "Case 2" will fail, but hopefully we
have transitioned away from that happening.

Thoughts?

Cheers,
Carlos.

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: Solution to OPD's in hppa-linux, including a transition plan?
  2005-03-11 18:05                     ` [parisc-linux] Solution to OPD's in hppa-linux, including a transition plan? Carlos O'Donell
@ 2005-03-12  0:49                       ` John David Anglin
       [not found]                         ` <20050315220842.GC22872@baldric.uwo.ca>
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2005-03-12  0:49 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: tausq, amodra, parisc-linux

> On Fri, Mar 11, 2005 at 08:57:51AM +1030, Alan Modra wrote:
> > > In shared libraries the function pointer is also allocated a PLT slot
> > > and an IPLT relocation. 
> > > 
> > > I don't understand the reasons for the allocation of a PLT slot if all
> > > references generated go through the local label word that has the
> > > PLABEL32 reloc, which now contains the address returned by
> > > _dl_make_ftpr.
> > 
> > There probably isn't a good reason.  Blame that on me not understanding
> > what I was doing when dhd and I hacked together ld and glibc hppa-linux
> > support.
> 
> I understand why you allocate a PLT slot, because function calls seem to
> go through the PLT only without reference to the PLABEL32 word (in
> shared libraries). This saves an indirection through the PLABEL32 word
> during a call. I believe this to be what is happening, and I verfiied it
> lightly.

I believe the PLT exists to support 'LTP and 'RTP relocations.
GCC doesn't generate these relocations as this support doesn't
work under HP-UX, although the HP-UX assembler manual describes
them.  GCC generates 32-bit plabels (deferred) when it encounters
a situation where a 'LTP/'RTP sequence would be desireable.  Thus,
we may not need the PLT slot.

I don't see that a level of indirection is being saved.  We either
go through the PLABEL32 word or the PLT.

I believe that GCC always create the PLABEL32 words in the data
section (definitely true for HP-UX) so that the word can be
successfully relocated when a shared library is loaded.

> I thought about this, and you are correct. Technically if the shared
> object can do a comparison then the symbol must have been global, and
> passed into the function.

I don't think this is correct.  It's theoretically possible to pass
two function pointers that both point to local functions in one object
and have the comparison done in another (shared) object.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: Solution to OPD's in hppa-linux, including a transition plan?
       [not found]                           ` <20050315224142.GC21148@bubble.modra.org>
@ 2005-03-16 20:36                             ` Carlos O'Donell
  2005-03-16 23:54                               ` Alan Modra
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2005-03-16 20:36 UTC (permalink / raw)
  To: Alan Modra; +Cc: John David Anglin, parisc-linux, tausq

On Wed, Mar 16, 2005 at 09:11:42AM +1030, Alan Modra wrote:
> On Tue, Mar 15, 2005 at 05:08:48PM -0500, Carlos O'Donell wrote:
> > The problem is that in a normal executable those words just point at the
> > PLT and they shouldn't. That case should just generate a PLABEL32 reloc
> > in the executable. 
> 
> ld still needs to generate function descriptors for plabels that resolve
> locally, eg. because the symbol is for a static function.

I don't understand how this case changes the situation, can you elaborate a 
bit more?

Thanks,
Carlos.


_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: Solution to OPD's in hppa-linux, including a transition plan?
       [not found]                           ` <200503160410.j2G4ALcu021219@hiauly1.hia.nrc.ca>
@ 2005-03-16 21:37                             ` Carlos O'Donell
  2005-03-17  3:51                               ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2005-03-16 21:37 UTC (permalink / raw)
  To: John David Anglin; +Cc: tausq, amodra, parisc-linux

On Tue, Mar 15, 2005 at 11:10:21PM -0500, John David Anglin wrote:
> > No. Read further, if I'm wrong please correct me.
> > 
> > The PLABEL32 contains the address of the function descriptor, while the
> > data in the PLT *is* the function descriptor. There is an extra lookup.
> > 
> > You have to load the address of the PLABEL32, load the value from there,
> > and then use that as your function descriptor. We currently *don't* do
> > this. The reason the indirection is there for PLABEL32 is such that the
> > dynamic loader can acutally assign the address of the OPD into that
> > word. 
> 
> No, I don't believe this is correct.  We do load the address
> from the PLABEL32 word.  That's the function pointer and what's
> passed to __cffc.  The problem is we don't have an OPD for the
> functions called in this manner.  We have more than one function
> descriptor for a any given function (possibly one for every
> PLABEL32 relocation).

We *do* have a n OPD for functions called in this manner, but only if
the plabel word carried a PLABEL32 reloc. The use of _dl_make_fptr
makes sure each symbol gets a unique function descriptor and will never
create duplicates.

The problem is that in the executable, we lazily point all the plabel
words at their associated plt entries and *splat* they are no longer
unique. Please note this *only* happens in the executable. Executables
do not generate PLABEL32 relocs for their plabel words.

I want to recommend that the executable emit PLABEL32 relocs against all
plabel word entries. The dynamic loader would then fill these entries
with unique OPD's as it has done so for shared libraries (this code was
originall wirtten by Bame et. al. and I ported hppa to use Lu's
non-locking generic version).
 
> On hppa64-hpux, we use essentially the same code to load function
> pointers from FPTR64 double words.  There we don't need to
> canonicalize the pointers because they point to the OPD for the
> function.

Sure, but the hpux libc probably does all the work to make sure that the
plabel words point to OPD's even for the executable :)

> > The problem is that in a normal executable those words just point at the
> > PLT and they shouldn't. That case should just generate a PLABEL32 reloc
> > in the executable. 
> > 
> > Do I understand the code correctly?
> 
> I think the situation envisioned in the parisc elf specification
> always envisioned a two level lookup.  In the relocations defined
> for 32-bit elf, the only way to load the address of a function
> descriptor is using the PLABEL32 relocation.  The 64-bit elf
> table also provides the LTOFF_FPTR21L and LTOFF_FPTR14R relocations.
> In this case, I believe that code has to load the address of the function
> descriptor from the linkage table, so it's still a two level lookup.

Yes, correct, I agree. Loading the *address* of a function descriptor
always requires a PLABEL32 reloction. The PLABEL32 reloction is handled
by the dynamic loader, which creates the OPD, and places the address of
the OPD into the plabel word.

Yes, as long as LTOFF_FTPR* load the address of the descriptor from the
linkage table (plt) then the system still works.

Hence, why I suggest executables also use PLABEL32 relocs if they take
the address of a function.

> The 32-bit ABI has the complication of the plabel bit in the function
> pointer.  While it might be possible to directly load the address
> of the function descriptor with an addil/ldo sequence if suitable
> relocations existed, saving one memory access, the code would still
> have to call $$dyncall or perform equivalent operations inline to
> test and strip off the plabel bit.

Yes, calling a function descriptor will always involve clearing the
plabel bit. I don't quite understand the performance gain to be made in
detecting that the plabel word contained a local address as opposed to a
function descriptor?

Yes, with a new relocation it *might* be possible to load the function
descriptor address directly from the plabel word, but as you say it 
would require writing into the code to change offsets?

> There are several disadvantages in the approach.  Plabels and linkage
> table entries can be shared for many calls to a given function.  Thus,
> the dynamic loader probably has an easier job doing the relocations.
> Also, I think that relocations might have to be redone (at least under
> hpux) when shared libraries are dynamically loaded by an application.
> This would require that the dynamic loader have the capability to
> write to code space after a program has started execution.  This is
> probably a security risk, particularly for shared libraries that are
> not privately mapped.  As I noted previously, the plabel words have
> to go in a read/write section because of this issue.

Do you really mean "disadvantages?"

Can you explain how plabels and plt entries can be shared for many calls
to a given function?

Are we still talking about the new reloc that could load the function
descriptor address directly?

Yes, plabel words go in read/write since they are written to by the
dynamic loader (only if they have a PLABEL32 reloc though).

---

This has definately been a good learning discussion, from the viewpoint
of optimal schemes for this type of architecture :)

Cheers,
Carlos.
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: Solution to OPD's in hppa-linux, including a transition plan?
  2005-03-16 20:36                             ` Carlos O'Donell
@ 2005-03-16 23:54                               ` Alan Modra
  0 siblings, 0 replies; 194+ messages in thread
From: Alan Modra @ 2005-03-16 23:54 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: John David Anglin, parisc-linux, tausq

On Wed, Mar 16, 2005 at 03:36:57PM -0500, Carlos O'Donell wrote:
> On Wed, Mar 16, 2005 at 09:11:42AM +1030, Alan Modra wrote:
> > On Tue, Mar 15, 2005 at 05:08:48PM -0500, Carlos O'Donell wrote:
> > > The problem is that in a normal executable those words just point at the
> > > PLT and they shouldn't. That case should just generate a PLABEL32 reloc
> > > in the executable. 
> > 
> > ld still needs to generate function descriptors for plabels that resolve
> > locally, eg. because the symbol is for a static function.
> 
> I don't understand how this case changes the situation, can you elaborate a 
> bit more?

If you take the address of a static function (or a hidden function),
you'll need a plabel somewhere.  You can't expect ld.so to handle this
via _dl_make_fptr, because the static function symbol isn't available to
ld.so.  Also, don't forget that ld needs to do everything for a fully
static link.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: Solution to OPD's in hppa-linux, including a transition plan?
  2005-03-16 21:37                             ` Carlos O'Donell
@ 2005-03-17  3:51                               ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2005-03-17  3:51 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: tausq, amodra, parisc-linux

> We *do* have a n OPD for functions called in this manner, but only if
> the plabel word carried a PLABEL32 reloc. The use of _dl_make_fptr
> makes sure each symbol gets a unique function descriptor and will never
> create duplicates.
> 
> The problem is that in the executable, we lazily point all the plabel
> words at their associated plt entries and *splat* they are no longer
> unique. Please note this *only* happens in the executable. Executables
> do not generate PLABEL32 relocs for their plabel words.
> 
> I want to recommend that the executable emit PLABEL32 relocs against all
> plabel word entries. The dynamic loader would then fill these entries
> with unique OPD's as it has done so for shared libraries (this code was
> originall wirtten by Bame et. al. and I ported hppa to use Lu's
> non-locking generic version).

I think you are correct.  I hadn't realized that we are only dropping
the PLABEL32 in executables.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] Re: Non-inline math, and inline math broken, GCC to blame? (1 hppa tls toolchain regression).
       [not found] <no.id>
                   ` (20 preceding siblings ...)
  2005-03-05 21:53 ` [parisc-linux] Re: Comments? John David Anglin
@ 2005-07-16  2:55 ` John David Anglin
  2005-07-16 16:16   ` Carlos O'Donell
  2005-08-16  3:32 ` [parisc-linux] Re: gsyprf11 and 2.6.13-rc3-pa1 John David Anglin
                   ` (13 subsequent siblings)
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2005-07-16  2:55 UTC (permalink / raw)
  To: John David Anglin; +Cc: carlos, tausq, parisc-linux

> > I think gcc is to blame, or the constraints in the assembly?
> > 
> > --- GCC 4.0 ---
> > 
> > 0x40349890 <feclearexcept+0>:   ldo 40(sp),sp
> > 0x40349894 <feclearexcept+4>:   ldo -38(sp),ret0
> > 0x40349898 <feclearexcept+8>:   stw r19,-20(,sp)
> > 0x4034989c <feclearexcept+12>:  fstd fr0,0(,ret0)
> > 0x403498a0 <feclearexcept+16>:  fldd 0(,ret0),fr0
> > 0x403498a4 <feclearexcept+20>:  ldi 0,ret0
> > 0x403498a8 <feclearexcept+24>:  bv r0(rp)
> > 0x403498ac <feclearexcept+28>:  ldo -40(sp),sp
> 
> PR time.  Please add danglin@gcc.gnu.org to the CC list.

Changed my mind.  It's not a GCC bug.  The second asm has to show that
it uses the memory set by the first:

#include <fenv.h>

int
feclearexcept (int excepts)
{
  struct { unsigned int sw[2]; } s;

  /* Get the current status word. */
  __asm__ volatile ("fstd %%fr0,0(%1)" : "=m" (s) : "r" (&s));

  /* Clear all the relevant bits. */
  s.sw[0] &= ~((excepts & FE_ALL_EXCEPT) << 27);
  __asm__ volatile ("fldd 0(%0),%%fr0" : : "r" (&s), "m" (s));

  /* Success.  */
  return 0;
}

I used a struct so that GCC would know exactly what memory was affected.

There is one other issue that I'm not sure about.  I presume that you
used fldd to access the floating-point status register to avoid the
situation where a floating-point identify instruction has been previously
been executed and the status register is in format three.  It's not
clear from the arch whether the fldd returns the result of the identify
or not.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] Re: Non-inline math, and inline math broken, GCC to blame? (1 hppa tls toolchain regression).
  2005-07-16  2:55 ` [parisc-linux] Re: Non-inline math, and inline math broken, GCC to blame? (1 hppa tls toolchain regression) John David Anglin
@ 2005-07-16 16:16   ` Carlos O'Donell
  2005-07-16 17:37     ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2005-07-16 16:16 UTC (permalink / raw)
  To: John David Anglin; +Cc: tausq, parisc-linux

On Fri, Jul 15, 2005 at 10:55:26PM -0400, John David Anglin wrote:
> > PR time.  Please add danglin@gcc.gnu.org to the CC list.
> 
> Changed my mind.  It's not a GCC bug.  The second asm has to show that
> it uses the memory set by the first:

Ah, thank you for the clarification. I'll try to examine the rest of
them and cleanup the assembly.
 
> #include <fenv.h>
> 
> int
> feclearexcept (int excepts)
> {
>   struct { unsigned int sw[2]; } s;
> 
>   /* Get the current status word. */
>   __asm__ volatile ("fstd %%fr0,0(%1)" : "=m" (s) : "r" (&s));
> 
>   /* Clear all the relevant bits. */
>   s.sw[0] &= ~((excepts & FE_ALL_EXCEPT) << 27);
>   __asm__ volatile ("fldd 0(%0),%%fr0" : : "r" (&s), "m" (s));
> 
>   /* Success.  */
>   return 0;
> }
> 
> I used a struct so that GCC would know exactly what memory was affected.
> 
> There is one other issue that I'm not sure about.  I presume that you
> used fldd to access the floating-point status register to avoid the
> situation where a floating-point identify instruction has been previously
> been executed and the status register is in format three.  It's not
> clear from the arch whether the fldd returns the result of the identify
> or not.

Who previously executed the COPR,0,0?

I use the fldd to set the new cleared state of the status register.

If the thread had previously executed 'fstd' followed by a 'copr,0,0'
and had not immediately thereafter executed another 'fstd' then the
operation is *undefined* as per PA 1.1 6-63.

Context switching should save and restore the states properly for this
to work.

I think the arch is very clear about the issue, but perhaps I'm
misreading something. Do you have a case where the above wouldn't work?

c.

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] Re: Non-inline math, and inline math broken, GCC to blame? (1 hppa tls toolchain regression).
  2005-07-16 16:16   ` Carlos O'Donell
@ 2005-07-16 17:37     ` John David Anglin
  2005-07-16 17:54       ` John David Anglin
  2005-07-16 19:15       ` Carlos O'Donell
  0 siblings, 2 replies; 194+ messages in thread
From: John David Anglin @ 2005-07-16 17:37 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: tausq, parisc-linux

> Who previously executed the COPR,0,0?

I dunno, incorrect identify sequence?  I agree the 1.1 arch is specific
about how to do an identify sequence.

> I use the fldd to set the new cleared state of the status register.

I had been wondering if fstw and fldw could be used, but it's an
undefined operation to set T with fldw and fstd clears T, so I believe
your use of fstd and fldd is correct in this sequence.

However, you have to be careful in using fstd to get the fp status
register as it clears T after the insn.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] Re: Non-inline math, and inline math broken, GCC to blame? (1 hppa tls toolchain regression).
  2005-07-16 17:37     ` John David Anglin
@ 2005-07-16 17:54       ` John David Anglin
  2005-07-16 19:41         ` Carlos O'Donell
  2005-07-16 19:15       ` Carlos O'Donell
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2005-07-16 17:54 UTC (permalink / raw)
  To: John David Anglin; +Cc: carlos, tausq, parisc-linux

> However, you have to be careful in using fstd to get the fp status
> register as it clears T after the insn.

And, indeed the following is wrong for the above reason:

#include <fenv.h>

int
fetestexcept (int excepts)
{
  unsigned int sw[2];

  /* Get the current status word. */
  __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));

  return (sw[0] >> 27) & excepts & FE_ALL_EXCEPT;
}

You need to add a 'fldd' to the asm to restore the T bit.  Another
option might be to use fstw to access the status register in this
situation.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] Re: Non-inline math, and inline math broken, GCC to blame? (1 hppa tls toolchain regression).
  2005-07-16 17:37     ` John David Anglin
  2005-07-16 17:54       ` John David Anglin
@ 2005-07-16 19:15       ` Carlos O'Donell
  1 sibling, 0 replies; 194+ messages in thread
From: Carlos O'Donell @ 2005-07-16 19:15 UTC (permalink / raw)
  To: John David Anglin; +Cc: tausq, parisc-linux

On Sat, Jul 16, 2005 at 01:37:50PM -0400, John David Anglin wrote:
> > Who previously executed the COPR,0,0?
> 
> I dunno, incorrect identify sequence?  I agree the 1.1 arch is specific
> about how to do an identify sequence.
 
There is no way to prevent this. An application can always shoot itself
in the foot.

And since the identify sequence should be written in assembly the
compiler can't schedule it around.

It should also be save to execute such a sequence at any point in the
insn stream.

> > I use the fldd to set the new cleared state of the status register.
> 
> I had been wondering if fstw and fldw could be used, but it's an
> undefined operation to set T with fldw and fstd clears T, so I believe
> your use of fstd and fldd is correct in this sequence.

I have to read this again to make sure I did it all right.

> However, you have to be careful in using fstd to get the fp status
> register as it clears T after the insn.

Yes, I might have some mistakes there.

c.
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] Re: Non-inline math, and inline math broken, GCC to blame? (1 hppa tls toolchain regression).
  2005-07-16 17:54       ` John David Anglin
@ 2005-07-16 19:41         ` Carlos O'Donell
  2005-07-16 19:56           ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2005-07-16 19:41 UTC (permalink / raw)
  To: John David Anglin; +Cc: tausq, parisc-linux

On Sat, Jul 16, 2005 at 01:54:48PM -0400, John David Anglin wrote:
> > However, you have to be careful in using fstd to get the fp status
> > register as it clears T after the insn.
> 
> And, indeed the following is wrong for the above reason:
> 
> #include <fenv.h>
> 
> int
> fetestexcept (int excepts)
> {
>   unsigned int sw[2];
> 
>   /* Get the current status word. */
>   __asm__ ("fstd %%fr0,0(%1)" : "=m" (*sw) : "r" (sw));
> 
>   return (sw[0] >> 27) & excepts & FE_ALL_EXCEPT;
> }
> 
> You need to add a 'fldd' to the asm to restore the T bit.  Another
> option might be to use fstw to access the status register in this
> situation.

I'm going to test the use of fstw.

fegetexcept, fegetround also need this fix (maybe more).

There is another potential bug, I should make sure the fr0 restore is
always at the end too incase it rearms a trap.

c.
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] Re: Non-inline math, and inline math broken, GCC to blame? (1 hppa tls toolchain regression).
  2005-07-16 19:41         ` Carlos O'Donell
@ 2005-07-16 19:56           ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2005-07-16 19:56 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: tausq, parisc-linux

> There is another potential bug, I should make sure the fr0 restore is
> always at the end too incase it rearms a trap.

hpux uses two little hand-coded functions to avoid this problem.  The
get operation uses fstd but it immediately restores the previous status
value with fldd.  The put does the restore in the delay slot of the return.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] Re: gsyprf11 and 2.6.13-rc3-pa1
       [not found] <no.id>
                   ` (21 preceding siblings ...)
  2005-07-16  2:55 ` [parisc-linux] Re: Non-inline math, and inline math broken, GCC to blame? (1 hppa tls toolchain regression) John David Anglin
@ 2005-08-16  3:32 ` John David Anglin
  2005-12-26 19:58 ` [parisc-linux] strtold John David Anglin
                   ` (12 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2005-08-16  3:32 UTC (permalink / raw)
  To: John David Anglin; +Cc: James.Bottomley, parisc-linux

> > static void sighandler(int sig)
> > {
> >         printf("Got signal %d\n", sig);
> >         exit(0);
> 
> I think you need to use _exit in a signal handler although this may
> not be an issue when there is only one thread.

GCC uses exit.  Either way, the kernel shouldn't hang.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] strtold
       [not found] <no.id>
                   ` (22 preceding siblings ...)
  2005-08-16  3:32 ` [parisc-linux] Re: gsyprf11 and 2.6.13-rc3-pa1 John David Anglin
@ 2005-12-26 19:58 ` John David Anglin
  2006-01-07 21:07   ` [parisc-linux] strtold Carlos O'Donell
  2005-12-26 21:54 ` [parisc-linux] Re: nscd: error while loading shared libraries: unexpected reloc type 0x42 John David Anglin
                   ` (11 subsequent siblings)
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2005-12-26 19:58 UTC (permalink / raw)
  To: John David Anglin; +Cc: carlos, tausq, parisc-linux

With libc6 2.3.5-8:

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

dave@gsyprf11:~/gcc_test$ gcc -o ld1 ld1.c
dave@gsyprf11:~/gcc_test$ ./ld1
0.000000

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: nscd: error while loading shared libraries: unexpected reloc type 0x42
       [not found] <no.id>
                   ` (23 preceding siblings ...)
  2005-12-26 19:58 ` [parisc-linux] strtold John David Anglin
@ 2005-12-26 21:54 ` John David Anglin
  2006-01-07 23:53   ` Carlos O'Donell
  2006-02-04 23:41 ` [parisc-linux] long double on hppa64-*-linux* John David Anglin
                   ` (10 subsequent siblings)
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2005-12-26 21:54 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux

> So they must come from an asm or assembly code.  I think libc used this
> reloc for loading the address of the function descriptor of main.

objdump -R nscd
...
00005970 R_PARISC_PLABEL21L  main
00005974 R_PARISC_PLABEL14R  main
00005980 R_PARISC_PLABEL21L  __libc_csu_init
00005984 R_PARISC_PLABEL14R  __libc_csu_init
00005988 R_PARISC_PLABEL21L  __libc_csu_fini
0000598c R_PARISC_PLABEL14R  __libc_csu_fini

If I recall correctly, there was a dynamic loader fix to handle these
relocations.  However, it doesn't seem to be in libc6 2.3.5-8.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: strtold
  2005-12-26 19:58 ` [parisc-linux] strtold John David Anglin
@ 2006-01-07 21:07   ` Carlos O'Donell
  2006-01-07 22:41     ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2006-01-07 21:07 UTC (permalink / raw)
  To: John David Anglin; +Cc: tausq, parisc-linux

On Mon, Dec 26, 2005 at 02:58:40PM -0500, John David Anglin wrote:
> With libc6 2.3.5-8:
> 
> #include <stdlib.h>
> int
> main ()
> {
>   printf ("%Lf\n", strtold ("1", NULL));
>     return 0;
> }
> 
> dave@gsyprf11:~/gcc_test$ gcc -o ld1 ld1.c
> dave@gsyprf11:~/gcc_test$ ./ld1
> 0.000000

strtold will never work, gcc and libc have different sizes for long
double. This is probably a side-effect of this.

If we really want long double to work we need to do something like set
it to be the same as double.

128-bit long double is just going to be a pain, and I don't know how
well the 80-bit long double from IBM supports IEEE modes.

c.

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: strtold
  2006-01-07 21:07   ` [parisc-linux] strtold Carlos O'Donell
@ 2006-01-07 22:41     ` John David Anglin
  2006-01-07 23:42       ` Carlos O'Donell
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2006-01-07 22:41 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: tausq, parisc-linux

> strtold will never work, gcc and libc have different sizes for long
> double. This is probably a side-effect of this.

I'm not sure what has changed but this is the source of a number
of gfortran and libstdc++ regressions when using the current version
of libc in unstable.

> If we really want long double to work we need to do something like set
> it to be the same as double.

Long double has always been the same as double in GCC.  It allowed
by the C and C++ standards.  It fast and the hardware and corner
cases are well understood.

I've given up hope that HP will release their IEEE long double emulation
code for PA-RISC.  Although I don't have any hard evidence of bugs in it,
there is the suggestion from the ada testsuite run under hpux that there
may be bugs in the rounding and exception support.

> 128-bit long double is just going to be a pain, and I don't know how
> well the 80-bit long double from IBM supports IEEE modes.

The only viable alternatives at this point are:

  1) long double == double (64 bit long double), or
  2) IBM 128-bit double double implementation used by powerpc.

After more than a year of using the double-double format, the powerpc
folks are still working the bugs out from the corner cases.  While I
guess it more or less works, I wouldn't want to rely on it for
critical calculations.  RTH recented indicated that this would be a
poor choice for another port in the same situation.  The same viewpoint
was expressed to me by an Ada maintainer at the last GCC summit.  Ada
probably has the best numerics support in GCC.

There is no support for the 80-bit format (either in hardware or
software) on PA-RISC as far as I know.  So, this alternative isn't viable.

C99 requires long double support.  Thus, I believe we should go with
option 1 and libc should be changed.  We aren't the only target with
this problem, so there must be some libc support for 64-bit long double.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: strtold
  2006-01-07 22:41     ` John David Anglin
@ 2006-01-07 23:42       ` Carlos O'Donell
  2006-01-07 23:49         ` John David Anglin
                           ` (2 more replies)
  0 siblings, 3 replies; 194+ messages in thread
From: Carlos O'Donell @ 2006-01-07 23:42 UTC (permalink / raw)
  To: John David Anglin; +Cc: tausq, parisc-linux

On Sat, Jan 07, 2006 at 05:41:52PM -0500, John David Anglin wrote:
> > strtold will never work, gcc and libc have different sizes for long
> > double. This is probably a side-effect of this.
> 
> I'm not sure what has changed but this is the source of a number
> of gfortran and libstdc++ regressions when using the current version
> of libc in unstable.

strold has always done funny things in the glibc testsuite, consider
yourself lucky.
 
> > If we really want long double to work we need to do something like set
> > it to be the same as double.
> 
> Long double has always been the same as double in GCC.  It allowed
> by the C and C++ standards.  It fast and the hardware and corner
> cases are well understood.

So long doubles have always been DFmode in GCC, okay, I thought it was
something else.

glibc thinks long double is 128-bit. If you want strtold to work then I
need to make the changes in glibc.

> I've given up hope that HP will release their IEEE long double emulation
> code for PA-RISC.  Although I don't have any hard evidence of bugs in it,
> there is the suggestion from the ada testsuite run under hpux that there
> may be bugs in the rounding and exception support.

I agree, I don't think it will ever be released. If it is released then
we'll jigger it out some other way :)

> > 128-bit long double is just going to be a pain, and I don't know how
> > well the 80-bit long double from IBM supports IEEE modes.
> 
> The only viable alternatives at this point are:
> 
>   1) long double == double (64 bit long double), or
>   2) IBM 128-bit double double implementation used by powerpc.

Or write our own library! ;-)

> After more than a year of using the double-double format, the powerpc
> folks are still working the bugs out from the corner cases.  While I
> guess it more or less works, I wouldn't want to rely on it for
> critical calculations.  RTH recented indicated that this would be a
> poor choice for another port in the same situation.  The same viewpoint
> was expressed to me by an Ada maintainer at the last GCC summit.  Ada
> probably has the best numerics support in GCC.

I say we go for (1).

> There is no support for the 80-bit format (either in hardware or
> software) on PA-RISC as far as I know.  So, this alternative isn't viable.

Okay.

> C99 requires long double support.  Thus, I believe we should go with
> option 1 and libc should be changed.  We aren't the only target with
> this problem, so there must be some libc support for 64-bit long double.

I believe it will only require removing the implies line for ldbl-128
from glibc.

I am building you a new debian glibc based on 2.3.5-8 for you to test,
would this be good?

c.

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: strtold
  2006-01-07 23:42       ` Carlos O'Donell
@ 2006-01-07 23:49         ` John David Anglin
  2006-01-07 23:56         ` John David Anglin
  2006-01-08  4:28         ` Grant Grundler
  2 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2006-01-07 23:49 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: tausq, parisc-linux

> I believe it will only require removing the implies line for ldbl-128
> from glibc.

Excellent.

> I am building you a new debian glibc based on 2.3.5-8 for you to test,
> would this be good?

Yes.

Do you also have a fix for FP exception support?

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] Re: nscd: error while loading shared libraries: unexpected reloc type 0x42
  2005-12-26 21:54 ` [parisc-linux] Re: nscd: error while loading shared libraries: unexpected reloc type 0x42 John David Anglin
@ 2006-01-07 23:53   ` Carlos O'Donell
  2006-01-08  0:16     ` [parisc-linux] Re: nscd: error while loading shared libraries: John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2006-01-07 23:53 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux

On Mon, Dec 26, 2005 at 04:54:42PM -0500, John David Anglin wrote:
> > So they must come from an asm or assembly code.  I think libc used this
> > reloc for loading the address of the function descriptor of main.
> 
> objdump -R nscd
> ...
> 00005970 R_PARISC_PLABEL21L  main
> 00005974 R_PARISC_PLABEL14R  main
> 00005980 R_PARISC_PLABEL21L  __libc_csu_init
> 00005984 R_PARISC_PLABEL14R  __libc_csu_init
> 00005988 R_PARISC_PLABEL21L  __libc_csu_fini
> 0000598c R_PARISC_PLABEL14R  __libc_csu_fini
> 
> If I recall correctly, there was a dynamic loader fix to handle these
> relocations.  However, it doesn't seem to be in libc6 2.3.5-8.

It is in the one I have installed on my system :)

The proper fix was this:
http://cvs.parisc-linux.org/glibc/sysdeps/hppa/elf/start.S?r1=1.2&r2=1.3

Please verify.

c.

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: strtold
  2006-01-07 23:42       ` Carlos O'Donell
  2006-01-07 23:49         ` John David Anglin
@ 2006-01-07 23:56         ` John David Anglin
  2006-01-08  4:28         ` Grant Grundler
  2 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2006-01-07 23:56 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: tausq, parisc-linux

> So long doubles have always been DFmode in GCC, okay, I thought it was
> something else.

linux long doubles are DFmode (hardware+kernel support).  hpux long
doubles are TFmode (software emulation).  Sometimes I wish there was
an option to switch between hardware and software long doubles on
hpux.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] Re: nscd: error while loading shared libraries:
  2006-01-07 23:53   ` Carlos O'Donell
@ 2006-01-08  0:16     ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2006-01-08  0:16 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: parisc-linux

> The proper fix was this:
> http://cvs.parisc-linux.org/glibc/sysdeps/hppa/elf/start.S?r1=1.2&r2=1.3
> 
> Please verify.

Looks right.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] Re: strtold
  2006-01-07 23:42       ` Carlos O'Donell
  2006-01-07 23:49         ` John David Anglin
  2006-01-07 23:56         ` John David Anglin
@ 2006-01-08  4:28         ` Grant Grundler
  2 siblings, 0 replies; 194+ messages in thread
From: Grant Grundler @ 2006-01-08  4:28 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: John David Anglin, tausq, parisc-linux

On Sat, Jan 07, 2006 at 06:42:30PM -0500, Carlos O'Donell wrote:
...
> > I've given up hope that HP will release their IEEE long double emulation
> > code for PA-RISC.  Although I don't have any hard evidence of bugs in it,
> > there is the suggestion from the ada testsuite run under hpux that there
> > may be bugs in the rounding and exception support.
> 
> I agree, I don't think it will ever be released. If it is released then
> we'll jigger it out some other way :)

Me too. But I wouldn't worry about an ABI event too much.
As long as the only dependency is debian/gentoo packages,
then I think we can tolerate an ABI event like this on the
next OS release if necessary.

grant
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] long double on hppa64-*-linux*
       [not found] <no.id>
                   ` (24 preceding siblings ...)
  2005-12-26 21:54 ` [parisc-linux] Re: nscd: error while loading shared libraries: unexpected reloc type 0x42 John David Anglin
@ 2006-02-04 23:41 ` John David Anglin
  2006-02-05  0:45   ` Grant Grundler
  2006-03-12 20:15 ` [parisc-linux] Re: gcj can't make shared libs on hppa John David Anglin
                   ` (9 subsequent siblings)
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2006-02-04 23:41 UTC (permalink / raw)
  To: John David Anglin; +Cc: carlos, parisc-linux, tausq

I noticed another long double issue.  Long double is defined to be 128
bits on all 64-bit targets on the PA.  I believe that it should be 128 bits
only on hpux.

I would like to change the long double default on PA64t o 64 bits as there
isn't any hardware support for the 128-bit type, and we currently don't
have software support for 128-bit long doubles implemented.  I can't see
this affecting anything, but it's another ABI change and I thought I should
ask.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] long double on hppa64-*-linux*
  2006-02-04 23:41 ` [parisc-linux] long double on hppa64-*-linux* John David Anglin
@ 2006-02-05  0:45   ` Grant Grundler
  2006-02-05  3:42     ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Grant Grundler @ 2006-02-05  0:45 UTC (permalink / raw)
  To: John David Anglin; +Cc: carlos, tausq, parisc-linux

On Sat, Feb 04, 2006 at 06:41:00PM -0500, John David Anglin wrote:
> I noticed another long double issue.  Long double is defined to be 128
> bits on all 64-bit targets on the PA.  I believe that it should be 128 bits
> only on hpux.
> 
> I would like to change the long double default on PA64t o 64 bits as there
> isn't any hardware support for the 128-bit type, and we currently don't
> have software support for 128-bit long doubles implemented.  I can't see
> this affecting anything, but it's another ABI change and I thought I should
> ask.

I'm ok with it. The only downside I can think of is hypothetical:
supporting HPUX binaries with "long double" on parisc-linux hmight get
interesting should any misaligned trap handlers or syscalls need to deal
with long double.

hth,
grant
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] long double on hppa64-*-linux*
  2006-02-05  0:45   ` Grant Grundler
@ 2006-02-05  3:42     ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2006-02-05  3:42 UTC (permalink / raw)
  To: Grant Grundler; +Cc: carlos, tausq, parisc-linux

> I'm ok with it. The only downside I can think of is hypothetical:
> supporting HPUX binaries with "long double" on parisc-linux hmight get
> interesting should any misaligned trap handlers or syscalls need to deal
> with long double.

The HPUX support uses various _U routines from libc.  I'm not sure
if any kernel support is involved.  Possibly, some support is needed
to handle exceptions.  This is all vague since as far as I know the
_U routines are not publicly documented.  I don't believe there is kernel
support for the quad instructions in the PA 2.0 arch.  There's no
math library support for long doubles in HPUX.  As it seems HP won't
release the _U code, only static HPUX binaries using long double would
have any chance of running on parisc-linux.  So, I'm not sure being
able to run HPUX binaries with "long double" would ever prove particularly
useful.

As things currently stand on hppa64-*-linux*, any arithmetic involving
long doubles results in a call to a libgcc stub that calls abort.

It looks as glibc 2.4 potentially provides 128-bit long double support
as an option.  See patch to make -mlong-double-128 the default:
http://gcc.gnu.org/ml/gcc-patches/2006-01/msg01958.html
The other option is the hardware support -mlong-double-64.

I'm fairly sure that the -mlong-double-128 format (except for a few
architectures) is similar to the rs6000 darwin long double format
(i.e., it's not compatible with the PA 2.0 format, IEEE quad).  It
might not be that much work to copy the rs6000 implementation.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] Re: gcj can't make shared libs on hppa
       [not found] <no.id>
                   ` (25 preceding siblings ...)
  2006-02-04 23:41 ` [parisc-linux] long double on hppa64-*-linux* John David Anglin
@ 2006-03-12 20:15 ` John David Anglin
  2006-03-13 14:24   ` Carlos O'Donell
  2006-06-09  0:56 ` [parisc-linux] User space locks -- what's wrong John David Anglin
                   ` (8 subsequent siblings)
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2006-03-12 20:15 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux

>  83c:   6b d3 3f c1     stw r19,-20(sp)
>  840:   e8 5f 1f bd     b,l 824 <_init-0x10>,rp
>  844:   08 13 02 44     copy r19,r4
>  848:   08 04 02 53     copy r4,r19
>  84c:   e8 40 01 f0     b,l 94c <frame_dummy>,rp
>  850:   08 00 02 40     nop
>  854:   e8 40 05 c0     b,l b3c <__do_global_ctors_aux>,rp
>  858:   08 00 02 40     nop
>  85c:   4b c2 3f 59     ldw -54(sp),rp
>  860:   08 04 02 53     copy r4,r19
>  864:   e8 40 c0 00     bv r0(rp)

I'm testing the attached fix.

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

Index: config/pa/pa32-linux.h
===================================================================
--- config/pa/pa32-linux.h	(revision 111979)
+++ config/pa/pa32-linux.h	(working copy)
@@ -1,5 +1,5 @@
 /* Definitions for PA_RISC with ELF-32 format
-   Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2002, 2004, 2006 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -36,4 +36,29 @@
 		    aligned(sizeof(func_ptr))))				\
     = { (func_ptr) (-1) }
 
+/* This is a PIC version of CRT_CALL_STATIC_FUNCTION.  The PIC
+   register has to be saved before the call and restored after
+   the call.  We assume that register %r4 is available for this
+   purpose.  The hack prevents GCC from deleting the restore.  */
+#ifdef CRTSTUFFS_O
+#undef CRT_CALL_STATIC_FUNCTION
+#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC)	\
+static void __attribute__((__used__))			\
+call_ ## FUNC (void)					\
+{							\
+  asm (SECTION_OP);					\
+  asm volatile (".call\n\t"				\
+		"bl " #FUNC ",%%r2\n\t"			\
+		"copy %%r19,%%r4\n\t"			\
+		"copy %%r4,%%r19\n"			\
+		:					\
+		:					\
+		: "r1", "r2", "r4", "r20", "r21",	\
+		  "r22", "r24", "r24", "r25", "r26",	\
+		  "r27", "r28", "r29", "r31");		\
+  FORCE_CODE_SECTION_ALIGN				\
+  asm (TEXT_SECTION_ASM_OP);				\
+}
+#endif
+
 #define MD_UNWIND_SUPPORT "config/pa/linux-unwind.h"
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] Re: gcj can't make shared libs on hppa
  2006-03-12 20:15 ` [parisc-linux] Re: gcj can't make shared libs on hppa John David Anglin
@ 2006-03-13 14:24   ` Carlos O'Donell
  2006-03-13 20:50     ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2006-03-13 14:24 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux

> Index: config/pa/pa32-linux.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> --- config/pa/pa32-linux.h      (revision 111979)
> +++ config/pa/pa32-linux.h      (working copy)
> @@ -1,5 +1,5 @@
>  /* Definitions for PA_RISC with ELF-32 format
> -   Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
> +   Copyright (C) 2000, 2002, 2004, 2006 Free Software Foundation, Inc.
>
>  This file is part of GCC.
>
> @@ -36,4 +36,29 @@
>                     aligned(sizeof(func_ptr))))                         \
>      =3D { (func_ptr) (-1) }
>
> +/* This is a PIC version of CRT_CALL_STATIC_FUNCTION.  The PIC
> +   register has to be saved before the call and restored after
> +   the call.  We assume that register %r4 is available for this
> +   purpose.  The hack prevents GCC from deleting the restore.  */
> +#ifdef CRTSTUFFS_O
> +#undef CRT_CALL_STATIC_FUNCTION
> +#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC)     \
> +static void __attribute__((__used__))                  \
> +call_ ## FUNC (void)                                   \
> +{                                                      \
> +  asm (SECTION_OP);                                    \
> +  asm volatile (".call\n\t"                            \
> +               "bl " #FUNC ",%%r2\n\t"                 \
> +               "copy %%r19,%%r4\n\t"                   \
> +               "copy %%r4,%%r19\n"                     \
> +               :                                       \
> +               :                                       \
> +               : "r1", "r2", "r4", "r20", "r21",       \
> +                 "r22", "r24", "r24", "r25", "r26",    \
> +                 "r27", "r28", "r29", "r31");          \
> +  FORCE_CODE_SECTION_ALIGN                             \
> +  asm (TEXT_SECTION_ASM_OP);                           \
> +}
> +#endif
> +
>  #define MD_UNWIND_SUPPORT "config/pa/linux-unwind.h"

Awesome, I hope this works. Thanks Randolph and Dave for the
sleuthing!

c.
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] Re: gcj can't make shared libs on hppa
  2006-03-13 14:24   ` Carlos O'Donell
@ 2006-03-13 20:50     ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2006-03-13 20:50 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: parisc-linux

> Awesome, I hope this works.

Seems to, so I will be installing a simplified version to the GCC tree.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] User space locks -- what's wrong
       [not found] <no.id>
                   ` (26 preceding siblings ...)
  2006-03-12 20:15 ` [parisc-linux] Re: gcj can't make shared libs on hppa John David Anglin
@ 2006-06-09  0:56 ` John David Anglin
  2007-01-03  1:41 ` [parisc-linux] Re: PA8800 Status (Happy New Year) John David Anglin
                   ` (7 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2006-06-09  0:56 UTC (permalink / raw)
  To: John David Anglin; +Cc: kyle, parisc-linux

> There definitely are some funky things going on in the kernel.
> For example, if I try to build GCC with 'make -j 4 bootstrap' on
> gsyprf11, about 50% of the time make dies because of a malloc data
> corruption or a shell problem.  However, I never see this with
> just 'make bootstrap'.

This is an example:

/home/dave/gcc-4.2/objdir/./prev-gcc/xgcc -B/home/dave/gcc-4.2/objdir/./prev-gcc
/ -B/home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-linux/bin/ -c   -g -O2 -DIN_GCC   -W -
Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -pedantic -Wno-lon
g-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wmis
sing-format-attribute -Werror -fno-common   -DHAVE_CONFIG_H -I. -I. -I../../gcc/
gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include -I../../gcc/gcc/../libcpp/inclu
de  -I../../gcc/gcc/../libdecnumber -I../libdecnumber    ../../gcc/gcc/c-typeck.
c -o c-typeck.o
/bin/sh: line 6: 24262 Segmentation fault      (core dumped) make "DESTDIR=" "RP
ATH_ENVVAR=LD_LIBRARY_PATH" "TARGET_SUBDIR=hppa-linux" "bindir=/home/dave/opt/gn
u/gcc/gcc-4.2.0/bin" "datadir=/home/dave/opt/gnu/gcc/gcc-4.2.0/share" "exec_pref
ix=/home/dave/opt/gnu/gcc/gcc-4.2.0" "includedir=/home/dave/opt/gnu/gcc/gcc-4.2.
0/include" "datarootdir=/home/dave/opt/gnu/gcc/gcc-4.2.0/share" "docdir=/home/da
ve/opt/gnu/gcc/gcc-4.2.0/share/doc" "infodir=/home/dave/opt/gnu/gcc/gcc-4.2.0/in
fo" "htmldir=/home/dave/opt/gnu/gcc/gcc-4.2.0/share/doc" "libdir=/home/dave/opt/
gnu/gcc/gcc-4.2.0/lib" "libexecdir=/home/dave/opt/gnu/gcc/gcc-4.2.0/libexec" "li
spdir=" "localstatedir=/home/dave/opt/gnu/gcc/gcc-4.2.0/var" "mandir=/home/dave/
opt/gnu/gcc/gcc-4.2.0/man" "oldincludedir=/usr/include" "prefix=/home/dave/opt/g
nu/gcc/gcc-4.2.0" "sbindir=/home/dave/opt/gnu/gcc/gcc-4.2.0/sbin" "sharedstatedi
r=/home/dave/opt/gnu/gcc/gcc-4.2.0/com" "sysconfdir=/home/dave/opt/gnu/gcc/gcc-4
.2.0/etc" "tooldir=/home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-linux" "build_tooldir=/
home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-linux" "target_alias=hppa-linux" "BISON=bis
on" "CC_FOR_BUILD=gcc" "CFLAGS_FOR_BUILD=-g -O2" "CXX_FOR_BUILD=c++" "EXPECT=/ho
me/dave/opt/gnu/bin/expect" "FLEX=flex" "INSTALL=/usr/bin/install -c" "INSTALL_D
ATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_S
CRIPT=/usr/bin/install -c" "LEX=flex" "M4=m4" "MAKE=make" "RUNTEST=runtest" "RUN
TESTFLAGS=" "SHELL=/bin/sh" "YACC=bison -y" "`echo 'ADAFLAGS=' | sed -e s'/[^=][
^=]*=$/XFOO=/'`" "AR_FLAGS=rc" "`echo 'BOOT_ADAFLAGS=' | sed -e s'/[^=][^=]*=$/X
FOO=/'`" "BOOT_CFLAGS=-g -O2" "BOOT_LDFLAGS=" "CFLAGS=-g -O2" "CXXFLAGS=-g -O2"
"LDFLAGS=" "LIBCFLAGS=-g -O2" "LIBCXXFLAGS=-g -O2 -fno-implicit-templates" "STAG
E1_CFLAGS=-g" "STAGE1_LANGUAGES=c,ada" "AR_FOR_TARGET=ar" "AS_FOR_TARGET=as" "CC
_FOR_TARGET=/home/dave/gcc-4.2/objdir/./gcc/xgcc -B/home/dave/gcc-4.2/objdir/./g
cc/ -B/home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-linux/bin/ -B/home/dave/opt/gnu/gcc/
gcc-4.2.0/hppa-linux/lib/ -isystem /home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-linux/i
nclude -isystem /home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-linux/sys-include" "CFLAGS
_FOR_TARGET=-O2 -g -O2 " "CPPFLAGS_FOR_TARGET=" "CXX_FOR_TARGET=/home/dave/gcc-4
.2/objdir/./gcc/g++ -B/home/dave/gcc-4.2/objdir/./gcc/ -nostdinc++  -L/home/dave
/gcc-4.2/objdir/hppa-linux/libstdc++-v3/src -L/home/dave/gcc-4.2/objdir/hppa-lin
ux/libstdc++-v3/src/.libs -B/home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-linux/bin/ -B/
home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-linux/lib/ -isystem /home/dave/opt/gnu/gcc/
gcc-4.2.0/hppa-linux/include -isystem /home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-linu
x/sys-include" "CXXFLAGS_FOR_TARGET=-g -O2  -D_GNU_SOURCE" "DLLTOOL_FOR_TARGET=d
lltool" "GCJ_FOR_TARGET=/home/dave/gcc-4.2/objdir/./gcc/gcj -B/home/dave/gcc-4.2
/objdir/./gcc/ -B/home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-linux/bin/ -B/home/dave/o
pt/gnu/gcc/gcc-4.2.0/hppa-linux/lib/ -isystem /home/dave/opt/gnu/gcc/gcc-4.2.0/h
ppa-linux/include -isystem /home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-linux/sys-inclu
de" "GFORTRAN_FOR_TARGET=/home/dave/gcc-4.2/objdir/./gcc/gfortran -B/home/dave/g
cc-4.2/objdir/./gcc/ -B/home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-linux/bin/ -B/home/
dave/opt/gnu/gcc/gcc-4.2.0/hppa-linux/lib/ -isystem /home/dave/opt/gnu/gcc/gcc-4
.2.0/hppa-linux/include -isystem /home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-linux/sys
-include" "LD_FOR_TARGET=ld" "LIPO_FOR_TARGET=lipo" "LDFLAGS_FOR_TARGET=" "LIBCF
LAGS_FOR_TARGET=-O2 -g -O2 " "LIBCXXFLAGS_FOR_TARGET=-g -O2  -D_GNU_SOURCE -fno-
implicit-templates" "NM_FOR_TARGET=nm" "OBJDUMP_FOR_TARGET=objdump" "RANLIB_FOR_
TARGET=ranlib" "STRIP_FOR_TARGET=strip" "WINDRES_FOR_TARGET=windres" "`echo 'LAN
GUAGES=' | sed -e s'/[^=][^=]*=$/XFOO=/'`" "LEAN=false" "CONFIG_SHELL=/bin/sh" "
MAKEINFO=makeinfo --split-size=5000000 --split-size=5000000 --split-size=5000000
" 'AR=ar' 'AS=as' 'CC=gcc' 'CXX=c++' 'DLLTOOL=dlltool' 'LD=ld' 'LIPO=lipo' 'NM=n
m' 'OBJDUMP=objdump' 'RANLIB=ranlib' 'STRIP=strip' 'WINDRES=windres' CC="${CC}"
CC_FOR_BUILD="${CC_FOR_BUILD}" STAGE_PREFIX=$r/prev-gcc/ CFLAGS="-g -O2" LIBCFLA
GS="-g -O2" LDFLAGS="" "`echo 'ADAFLAGS=' | sed -e s'/[^=][^=]*=$/XFOO=/'`" "GCC
_FOR_TARGET= $r/./gcc/xgcc -B$r/./gcc/ -B/home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-l
inux/bin/ -B/home/dave/opt/gnu/gcc/gcc-4.2.0/hppa-linux/lib/ -isystem /home/dave
/opt/gnu/gcc/gcc-4.2.0/hppa-linux/include -isystem /home/dave/opt/gnu/gcc/gcc-4.
2.0/hppa-linux/sys-include" "`echo 'STMP_FIXPROTO=' | sed -e s'/[^=][^=]*=$/XFOO
=/'`" "`echo 'LIMITS_H_TEST=' | sed -e s'/[^=][^=]*=$/XFOO=/'`" "`echo 'LIBGCC2_
CFLAGS=' | sed -e s'/[^=][^=]*=$/XFOO=/'`" "`echo 'LIBGCC2_DEBUG_CFLAGS=' | sed
-e s'/[^=][^=]*=$/XFOO=/'`" "`echo 'LIBGCC2_INCLUDES=' | sed -e s'/[^=][^=]*=$/X
FOO=/'`" `if [ -f stage_last ]; then echo quickstrap ; else echo all; fi`
make[2]: *** [all-stage2-gcc] Error 139
make[2]: Leaving directory `/home/dave/gcc-4.2/objdir'
make[1]: *** [stage2-bubble] Error 2
make[1]: Leaving directory `/home/dave/gcc-4.2/objdir'
make: *** [bootstrap] Error 2
make: INTERNAL: Exiting with 1 jobserver tokens available; should be 4!
Wed Jun  7 20:19:18 PDT 2006

>>From /var/log/debug:

Jun  7 20:19:18 gsyprf11 kernel: do_page_fault() pid=24262 command='make' type=1
5 address=0x1118498f
Jun  7 20:19:18 gsyprf11 kernel: vm_start = 0x00048000, vm_end = 0x00607000
Jun  7 20:19:18 gsyprf11 kernel:
Jun  7 20:19:18 gsyprf11 kernel:      YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
Jun  7 20:19:18 gsyprf11 kernel: PSW: 00000000000001000000000000001111 Not taint
ed
Jun  7 20:19:18 gsyprf11 kernel: r00-03  0000000000000000 00000000000476e8 00000
00000029b03 00000000bff07800
Jun  7 20:19:18 gsyprf11 kernel: r04-07  000000000009b268 0000000000000000 00000
0000010fe80 00000000000d8680
Jun  7 20:19:18 gsyprf11 kernel: r08-11  00000000000d8680 0000000000000000 00000
0000010fe80 0000000000000000
Jun  7 20:19:18 gsyprf11 kernel: r12-15  000000000009b1f0 0000000000000000 00000
00000000014 0000000000000000
Jun  7 20:19:18 gsyprf11 kernel: r16-19  0000000000000001 0000000000000001 00000
000000476e8 0000000000000000
Jun  7 20:19:18 gsyprf11 kernel: r20-23  00000000001dfca0 0000000000000000 00000
000c0000003 0000000000000000
Jun  7 20:19:18 gsyprf11 kernel: r24-27  0000000000000001 0000000000000016 00000
000001dfca0 00000000000466e8
Jun  7 20:19:18 gsyprf11 kernel: r28-31  0000000011184943 0000000040000003 00000
00003bd6800 0000000003bd6800
Jun  7 20:19:18 gsyprf11 kernel:
Jun  7 20:19:18 gsyprf11 kernel: IASQ: 0000000003bd6800 0000000003bd6800 IAOQ: 0
000000000029aa3 0000000000029aa7
Jun  7 20:19:18 gsyprf11 kernel:  IIR: 4b930098    ISR: 0000000003bd6800  IOR: 0
00000001118498f
Jun  7 20:19:18 gsyprf11 kernel:  CPU:        1   CR30: 000000001abb0000 CR31: 0
000000000008020
Jun  7 20:19:18 gsyprf11 kernel:  ORIG_R28: 0000000000000000
Jun  7 20:19:18 gsyprf11 kernel:  IAOQ[0]: 0x29aa3
Jun  7 20:19:18 gsyprf11 kernel:  IAOQ[1]: 0x29aa7
Jun  7 20:19:18 gsyprf11 kernel:  RP(r2): 0x29b03

dave@hiauly6:~/opt/gnu/bin$ disasm 0x4b930098
   0:   4b 93 00 98     ldw 4c(ret0),r19

(gdb) disass 0x29a90 0x29ab0
Dump of assembler code from 0x29a90 to 0x29ab0:
0x00029a90 <close_stdout+25828>:        copy ret0,r20
0x00029a94 <close_stdout+25832>:        ldw 48(r20),ret0
0x00029a98 <close_stdout+25836>:        cmpiclr,<> 0,ret0,r0
0x00029a9c <close_stdout+25840>:        copy r20,ret0
0x00029aa0 <close_stdout+25844>:        ldw 4c(ret0),r19

%ret0 is both misaligned and appears outside the VM range for the application.

The backtrace isn't particularly enlightening (need debug version of make).

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: PA8800 Status (Happy New Year)
       [not found] <no.id>
                   ` (27 preceding siblings ...)
  2006-06-09  0:56 ` [parisc-linux] User space locks -- what's wrong John David Anglin
@ 2007-01-03  1:41 ` John David Anglin
  2007-01-03  4:24 ` John David Anglin
                   ` (6 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2007-01-03  1:41 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux

> Bad Address (null pointer deref?): Code=15 regs=0000000245b4f590 (Addr=00000625733a213a)
> 
>      YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
> PSW: 00001000000001001011110100001111 Not tainted
> r00-03  000000ff0804bd0f 000000004050f8c0 0000000040311010 0000000084f664ff
> r04-07  00000000405038c0 0000000000000002 0000000084f664c1 000000007fe0a000
> r08-11  0000000000000000 000000007fe0a000 00000000000002b1 000000007ea85600
> r12-15  000000004f2241c0 000000007e96c000 000000007fe0a000 0000000000000040
> r16-19  0000000000000000 000000007fe0a494 000000007ad0b012 00000000404ba2d4
> r20-23  3c353e25733a2046 000000004050f8c0 000000007fe0a000 0000000000000000
> r24-27  0000000084f664c1 0000000000013c43 0000000078340400 00000000405038c0
> r28-31  0000000000000003 0000000245b4f560 0000000245b4f590 00000000404ba2c0
> sr00-03  0000000001436800 0000000000000000 0000000000000000 0000000001436800
> sr04-07  0000000000000000 0000000000000000 0000000000000000 0000000000000000
> 
> IASQ: 0000000000000000 0000000000000000 IAOQ: 000000004031104c 0000000040311050
>  IIR: 4a9c01e8    ISR: 000000003c353800  IOR: 00000625733a213a
>  CPU:        0   CR30: 0000000241ee0000 CR31: 00000000404c4000
>  ORIG_R28: 00000054000000c8
>  IAOQ[0]: ip_route_input+0xb4/0xca8
>  IAOQ[1]: ip_route_input+0xb8/0xca8
>  RP(r2): ip_route_input+0x78/0xca8
> Kernel panic - not syncing: Bad Address (null pointer deref?)
>  <0>Rebooting in 5 seconds..

The code seems to be:

    40311008:   eb fe ac 25     b,l 4030e620 <rt_hash_code>,rp
    4031100c:   0b 97 02 28     and r23,ret0,r8
    40311010:   08 04 02 5b     copy r4,dp
    40311014:   2b 63 20 00     addil L%7000,dp,r1
    40311018:   50 3f 04 f0     ldd 278(r1),r31
    4031101c:   0f e0 10 d3     ldd 0(r31),r19
    40311020:   0e 7c 20 dc     ldd,s ret0(r19),ret0
    40311024:   9f 80 22 00     cmpb,*= r0,ret0,4031112c <ip_route_input+0x194>
    40311028:   2b 66 00 00     addil L%c000,dp,r1
    4031102c:   08 1c 02 54     copy ret0,r20
    40311030:   50 33 0e a0     ldd 750(r1),r19
    40311034:   e8 00 00 20     b,l 4031104c <ip_route_input+0xb4>,r0
    40311038:   08 01 02 55     copy r1,r21
    4031103c:   37 9c 00 02     ldo 1(ret0),ret0
    40311040:   6a 7c 00 70     stw ret0,38(r19)
    40311044:   0e 80 10 d4     ldd 0(r20),r20
    40311048:   9e 80 21 ba     cmpb,*=,n r0,r20,4031112c <ip_route_input+0x194>
    4031104c:   4a 9c 01 e8     ldw f4(r20),ret0

It seems like there must be some way to get to 4031104c avoiding the
on r20/ret0.  Don't see any branches to the region between 40311024
and 40311044 in the function, or any other direct branches to 4031104c.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: PA8800 Status (Happy New Year)
       [not found] <no.id>
                   ` (28 preceding siblings ...)
  2007-01-03  1:41 ` [parisc-linux] Re: PA8800 Status (Happy New Year) John David Anglin
@ 2007-01-03  4:24 ` John David Anglin
  2007-02-17 20:32 ` [parisc-linux] Re: call_init in libc6 2.3.6.ds1-11 John David Anglin
                   ` (5 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2007-01-03  4:24 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux

> expect (pid 20348): Protection id trap (code 27)
> Backtrace:
>       _______________________________
>      < Your System ate a SPARC! Gah! >

It looks like show_stack is broken.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* [parisc-linux] Re: call_init in libc6 2.3.6.ds1-11
       [not found] <no.id>
                   ` (29 preceding siblings ...)
  2007-01-03  4:24 ` John David Anglin
@ 2007-02-17 20:32 ` John David Anglin
  2007-09-04  1:19 ` [parisc-linux] 2.6.23-rc5 warnings John David Anglin
                   ` (4 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2007-02-17 20:32 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux

> /* The test for "addr & 2" below is to accomodate old binaries which
>    violated the ELF ABI by pointing DT_INIT and DT_FINI at a function
>    descriptor.  */
> #define DL_DT_INIT_ADDRESS(map, addr) \
>   ((Elf32_Addr)(addr) & 2 ? (addr) : DL_AUTO_FUNCTION_ADDRESS (map, addr))

This is the ia64 define:

#define DL_DT_INIT_ADDRESS(map, addr) DL_AUTO_FUNCTION_ADDRESS (map, addr)

Calls to init on ia64 always use a function descriptor.

While it's possible that DT_INIT and DT_FINI shouldn't point at function
descriptors, the above hack can't be right since DL_DT_INIT_ADDRESS is used
for calling init() from dl-init.c:

      init_t init = (init_t) DL_DT_INIT_ADDRESS
	(l, l->l_addr + l->l_info[DT_INIT]->d_un.d_ptr);

      /* Call the function.  */
      init (argc, argv, env);

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: [parisc-linux] 2.6.23-rc5 warnings
       [not found] <no.id>
                   ` (30 preceding siblings ...)
  2007-02-17 20:32 ` [parisc-linux] Re: call_init in libc6 2.3.6.ds1-11 John David Anglin
@ 2007-09-04  1:19 ` John David Anglin
  2008-08-23 16:48 ` X won't start with VisEG and 2.6.22.19 John David Anglin
                   ` (3 subsequent siblings)
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2007-09-04  1:19 UTC (permalink / raw)
  To: John David Anglin; +Cc: parisc-linux

Thumbs down on 2.6.23-rc5.  I had segmentation faults in tools like
'make' twice in a row.  Back to 2.6.22.6.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

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

* Re: X won't start with VisEG and 2.6.22.19
       [not found] <no.id>
                   ` (31 preceding siblings ...)
  2007-09-04  1:19 ` [parisc-linux] 2.6.23-rc5 warnings John David Anglin
@ 2008-08-23 16:48 ` John David Anglin
  2008-08-24 10:35   ` Helge Deller
  2009-05-03  0:48 ` Kernel Panic during init with 2.6.29-gb609308 (fresh clone of git John David Anglin
                   ` (2 subsequent siblings)
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2008-08-23 16:48 UTC (permalink / raw)
  To: John David Anglin; +Cc: deller, gmsoft, kraxel, dave.anglin, linux-parisc

> > Tracing with gdb gives the following:
> > 
> > Breakpoint 1, fbdev_modes_equal (set=0xfb5ed568, req=0xfb5ed4c8)
> >      at ../../../../hw/xfree86/fbdevhw/fbdevhw.c:256
> > 256     }
> > (gdb) p *set
> > $1 = {xres = 1024, yres = 768, xres_virtual = 1024, yres_virtual = 768, 
> > xoffset = 0, yoffset = 0,
> >    bits_per_pixel = 8, grayscale = 0, red = {offset = 0, length = 8, 
> > msb_right = 0}, green = {offset = 0,
> >      length = 8, msb_right = 0}, blue = {offset = 0, length = 8, 
> > msb_right = 0}, transp = {offset = 0,
> >      length = 0, msb_right = 0}, nonstd = 0, activate = 0, height = 0, 
> > width = 0, accel_flags = 0,
> >    pixclock = 0, left_margin = 0, right_margin = 0, upper_margin = 0, 
> > lower_margin = 0, hsync_len = 0,
> >    vsync_len = 0, sync = 0, vmode = 0, reserved = {0, 0, 0, 0, 0, 0}}
> > 
> > (gdb) p *req
> > $2 = {xres = 1024, yres = 768, xres_virtual = 1024, yres_virtual = 768, 
> > xoffset = 0, yoffset = 0,
> >    bits_per_pixel = 8, grayscale = 0, red = {offset = 0, length = 8, 
> > msb_right = 0}, green = {offset = 0,
> >      length = 8, msb_right = 0}, blue = {offset = 0, length = 8, 
> > msb_right = 0}, transp = {offset = 0,
> >      length = 0, msb_right = 0}, nonstd = 0, activate = 0, height = 0, 
> > width = 0, accel_flags = 0,
> >    pixclock = 22271, left_margin = 56, right_margin = 8, upper_margin = 
> > 41, lower_margin = 0,
> >    hsync_len = 176, vsync_len = 8, sync = 3, vmode = 1, reserved = {0, 
> > 0, 0, 0, 0, 0}}
> > 
> > (gdb) bt
> > #0  fbdev_modes_equal (set=0xfb5ed568, req=0xfb5ed4c8) at 
> > ../../../../hw/xfree86/fbdevhw/fbdevhw.c:256
> > #1  0x40bcfb64 in fbdevHWSetMode (pScrn=0x2142a0, mode=<value optimized 
> > out>, check=1)
> >      at ../../../../hw/xfree86/fbdevhw/fbdevhw.c:528
> > #2  0x40bd07e8 in fbdevHWSetVideoModes (pScrn=0x2142a0) at 
> > ../../../../hw/xfree86/fbdevhw/fbdevhw.c:568
> > #3  0x40cf5bec in ?? () from /usr/lib/xorg/modules/drivers//fbdev_drv.so
> > #4  0x00074e88 in InitOutput ()
> > #5  0x00039d04 in main ()
> > 
> > As you can see, the main video parameters are OK, while the 
> > monitor/modeline values (pixclock, left_margin, right_margin, 
> > upper_margin, lower_margin, hsync_len, vsync_len, sync and vmode)
> > were changed to zero.

It would appear that none of these values are relevant to the stifb.
The stifb.c code uses kzalloc to allocate the struct stifb_info, so
I think the above values should be zero.  Some code is clearly computing
values for pixclock, etc.  I don't see that this code is in the kernel.
It may be X that's making up these values.

I see in the log:

(II) FBDEV(0): hardware: stifb (video memory: 2048kB)
(II) FBDEV(0): checking modes against framebuffer device...
(II) FBDEV(0):  mode "1280x1024" test failed
(II) FBDEV(0): checking modes against monitor...
(--) FBDEV(0): Virtual size is 1280x1024 (pitch 1280)
(**) FBDEV(0):  Built-in mode "current": 28000.0 MHz, 21875.0 kHz, 21362.3 Hz
(II) FBDEV(0): Modeline "current"x0.0  28000.00  1280 1280 1280 1280  1024 1024 
1024 1024 -hsync -vsync -csync (21875.0 kHz)
(==) FBDEV(0): DPI set to (96, 96)

Could X be requesting a mode with invalid mode parameters?

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

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

* Re: X won't start with VisEG and 2.6.22.19
  2008-08-23 16:48 ` X won't start with VisEG and 2.6.22.19 John David Anglin
@ 2008-08-24 10:35   ` Helge Deller
  2008-08-24 14:09     ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Helge Deller @ 2008-08-24 10:35 UTC (permalink / raw)
  To: John David Anglin; +Cc: gmsoft, kraxel, dave.anglin, linux-parisc

John David Anglin wrote:
>>> Tracing with gdb gives the following:
>>>
>>> Breakpoint 1, fbdev_modes_equal (set=0xfb5ed568, req=0xfb5ed4c8)
>>>      at ../../../../hw/xfree86/fbdevhw/fbdevhw.c:256
>>> 256     }
>>> (gdb) p *set
>>> $1 = {xres = 1024, yres = 768, xres_virtual = 1024, yres_virtual = 768, 
>>> xoffset = 0, yoffset = 0,
>>>    bits_per_pixel = 8, grayscale = 0, red = {offset = 0, length = 8, 
>>> msb_right = 0}, green = {offset = 0,
>>>      length = 8, msb_right = 0}, blue = {offset = 0, length = 8, 
>>> msb_right = 0}, transp = {offset = 0,
>>>      length = 0, msb_right = 0}, nonstd = 0, activate = 0, height = 0, 
>>> width = 0, accel_flags = 0,
>>>    pixclock = 0, left_margin = 0, right_margin = 0, upper_margin = 0, 
>>> lower_margin = 0, hsync_len = 0,
>>>    vsync_len = 0, sync = 0, vmode = 0, reserved = {0, 0, 0, 0, 0, 0}}
>>>
>>> (gdb) p *req
>>> $2 = {xres = 1024, yres = 768, xres_virtual = 1024, yres_virtual = 768, 
>>> xoffset = 0, yoffset = 0,
>>>    bits_per_pixel = 8, grayscale = 0, red = {offset = 0, length = 8, 
>>> msb_right = 0}, green = {offset = 0,
>>>      length = 8, msb_right = 0}, blue = {offset = 0, length = 8, 
>>> msb_right = 0}, transp = {offset = 0,
>>>      length = 0, msb_right = 0}, nonstd = 0, activate = 0, height = 0, 
>>> width = 0, accel_flags = 0,
>>>    pixclock = 22271, left_margin = 56, right_margin = 8, upper_margin = 
>>> 41, lower_margin = 0,
>>>    hsync_len = 176, vsync_len = 8, sync = 3, vmode = 1, reserved = {0, 
>>> 0, 0, 0, 0, 0}}
>>>
>>> (gdb) bt
>>> #0  fbdev_modes_equal (set=0xfb5ed568, req=0xfb5ed4c8) at 
>>> ../../../../hw/xfree86/fbdevhw/fbdevhw.c:256
>>> #1  0x40bcfb64 in fbdevHWSetMode (pScrn=0x2142a0, mode=<value optimized 
>>> out>, check=1)
>>>      at ../../../../hw/xfree86/fbdevhw/fbdevhw.c:528
>>> #2  0x40bd07e8 in fbdevHWSetVideoModes (pScrn=0x2142a0) at 
>>> ../../../../hw/xfree86/fbdevhw/fbdevhw.c:568
>>> #3  0x40cf5bec in ?? () from /usr/lib/xorg/modules/drivers//fbdev_drv.so
>>> #4  0x00074e88 in InitOutput ()
>>> #5  0x00039d04 in main ()
>>>
>>> As you can see, the main video parameters are OK, while the 
>>> monitor/modeline values (pixclock, left_margin, right_margin, 
>>> upper_margin, lower_margin, hsync_len, vsync_len, sync and vmode)
>>> were changed to zero.
> 
> It would appear that none of these values are relevant to the stifb.
> The stifb.c code uses kzalloc to allocate the struct stifb_info, so
> I think the above values should be zero.  Some code is clearly computing
> values for pixclock, etc.  I don't see that this code is in the kernel.
> It may be X that's making up these values.
> 
> I see in the log:
> 
> (II) FBDEV(0): hardware: stifb (video memory: 2048kB)
> (II) FBDEV(0): checking modes against framebuffer device...
> (II) FBDEV(0):  mode "1280x1024" test failed
> (II) FBDEV(0): checking modes against monitor...
> (--) FBDEV(0): Virtual size is 1280x1024 (pitch 1280)
> (**) FBDEV(0):  Built-in mode "current": 28000.0 MHz, 21875.0 kHz, 21362.3 Hz
> (II) FBDEV(0): Modeline "current"x0.0  28000.00  1280 1280 1280 1280  1024 1024 
> 1024 1024 -hsync -vsync -csync (21875.0 kHz)
> (==) FBDEV(0): DPI set to (96, 96)
> 
> Could X be requesting a mode with invalid mode parameters?

In general X behaves correctly if you have a fb device, which is able to 
set sync timings.
But stifb and a few other fb drivers are not able to set sync timings, 
and for those X behaves IMHO wrong. For those X should assume that the 
timings set by the driver are correct as long as the resolution and bit 
depth are correct.

This is what happens:
1. In xorg.conf you configured a pixel resolution and bpp (e.g. 
1280x1024-16)
2. In xorg.conf you might have configured a monitor (with or without 
some timing/sync informations)
3. X reads those config parameters and try to set them through kernel calls.
4. Kernel returns that it now has set up the mode (1280x1024-16) and has 
set up the timings. Since stifb does not support timing modes, it 
returns zeros in those values (IMHO thats correct behavior if you look 
at the comments in skeletonfb.c)
5. X verifies the returned values and aborts since the timing values are 
different to what it fed to the kernel, although the resolution 
(1280x1024-16) is correctly set and returned like that.

I think X is right in noticing that the timing/sync values are not what 
it expected. Nevertheless, I would prefer that it would just warn (in 
the fbdev drivers only!) that the timings are incorrect instead of 
aborting completely. X is right to abort, if the pixel resolution and 
bpp can not be set.
So, X's tests should be like that:
a) resolution and bpp different -> abort
b) resolution and bpp correct, but sync timings/monitor timings 
different -> warn but continue

Right now X's tests are:
resolution, bpp or sync/monitor timings different -> abort.

Of course it's easily possible to change stifb in that it just takes any 
timing values, but that is not how it is documented in skeletonfb.

Helge

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

* Re: X won't start with VisEG and 2.6.22.19
  2008-08-24 10:35   ` Helge Deller
@ 2008-08-24 14:09     ` John David Anglin
  2008-08-24 14:38       ` Helge Deller
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2008-08-24 14:09 UTC (permalink / raw)
  To: Helge Deller; +Cc: gmsoft, kraxel, dave.anglin, linux-parisc

> >>> As you can see, the main video parameters are OK, while the 
> >>> monitor/modeline values (pixclock, left_margin, right_margin, 
> >>> upper_margin, lower_margin, hsync_len, vsync_len, sync and vmode)
> >>> were changed to zero.

The skeletonfb.c code makes it very clear that the only place where
a mode can be changed is in xxxfb_check_var:

*      Exception to the above rule:  Some drivers have a fixed mode, ie,
*      the hardware is already set at boot up, and cannot be changed.  In
*      this case, it is more acceptable that this function just return
*      a copy of the currently working var (info->var). Better is to not
*      implement this function, as the upper layer will do the copying
*      of the current var for you.
*
*      Note:  This is the only function where the contents of var can be
*      freely adjusted after the driver has been registered. If you find
*      that you have code outside of this function that alters the content
*      of var, then you are doing something wrong.  Note also that the
*      contents of info->var must be left untouched at all times after
*      driver registration.

As xxxfb_check_var is not implemented in stifb.c, it must be the upper
level that is changing the parameters.  Possibly, something to try is
the following:

 *      However, even if your hardware does not support mode changing,
 *      a set_par might be needed to at least initialize the hardware to
 *      a known working state, especially if it came back from another
 *      process that also modifies the same hardware, such as X.
 *
 *      If this is the case, a combination such as the following should work:
 *
 *      static int xxxfb_check_var(struct fb_var_screeninfo *var,
 *                                struct fb_info *info)
 *      {
 *              *var = info->var;
 *              return 0;
 *      }
 *
 *      static int xxxfb_set_par(struct fb_info *info)
 *      {
 *              init your hardware here
 *      }

> But stifb and a few other fb drivers are not able to set sync timings, 
> and for those X behaves IMHO wrong. For those X should assume that the 
> timings set by the driver are correct as long as the resolution and bit 
> depth are correct.
> 
> This is what happens:
> 1. In xorg.conf you configured a pixel resolution and bpp (e.g. 
> 1280x1024-16)
> 2. In xorg.conf you might have configured a monitor (with or without 
> some timing/sync informations)
> 3. X reads those config parameters and try to set them through kernel calls.
> 4. Kernel returns that it now has set up the mode (1280x1024-16) and has 
> set up the timings. Since stifb does not support timing modes, it 
> returns zeros in those values (IMHO thats correct behavior if you look 
> at the comments in skeletonfb.c)
> 5. X verifies the returned values and aborts since the timing values are 
> different to what it fed to the kernel, although the resolution 
> (1280x1024-16) is correctly set and returned like that.
> 
> I think X is right in noticing that the timing/sync values are not what 
> it expected. Nevertheless, I would prefer that it would just warn (in 
> the fbdev drivers only!) that the timings are incorrect instead of 
> aborting completely. X is right to abort, if the pixel resolution and 
> bpp can not be set.
> So, X's tests should be like that:
> a) resolution and bpp different -> abort
> b) resolution and bpp correct, but sync timings/monitor timings 
> different -> warn but continue
> 
> Right now X's tests are:
> resolution, bpp or sync/monitor timings different -> abort.
> 
> Of course it's easily possible to change stifb in that it just takes any 
> timing values, but that is not how it is documented in skeletonfb.

My sense in looking at the PR is that the freedesktop people won't
accept this approach.

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

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

* Re: X won't start with VisEG and 2.6.22.19
  2008-08-24 14:09     ` John David Anglin
@ 2008-08-24 14:38       ` Helge Deller
  0 siblings, 0 replies; 194+ messages in thread
From: Helge Deller @ 2008-08-24 14:38 UTC (permalink / raw)
  To: John David Anglin; +Cc: gmsoft, kraxel, dave.anglin, linux-parisc

John David Anglin wrote:
>>>>> As you can see, the main video parameters are OK, while the 
>>>>> monitor/modeline values (pixclock, left_margin, right_margin, 
>>>>> upper_margin, lower_margin, hsync_len, vsync_len, sync and vmode)
>>>>> were changed to zero.
> 
> The skeletonfb.c code makes it very clear that the only place where
> a mode can be changed is in xxxfb_check_var:
> 
> *      Exception to the above rule:  Some drivers have a fixed mode, ie,
> *      the hardware is already set at boot up, and cannot be changed.  In
> *      this case, it is more acceptable that this function just return
> *      a copy of the currently working var (info->var). Better is to not
> *      implement this function, as the upper layer will do the copying
> *      of the current var for you.
> *
> *      Note:  This is the only function where the contents of var can be
> *      freely adjusted after the driver has been registered. If you find
> *      that you have code outside of this function that alters the content
> *      of var, then you are doing something wrong.  Note also that the
> *      contents of info->var must be left untouched at all times after
> *      driver registration.
> 
> As xxxfb_check_var is not implemented in stifb.c, it must be the upper
> level that is changing the parameters.  Possibly, something to try is
> the following:
> 
>  *      However, even if your hardware does not support mode changing,
>  *      a set_par might be needed to at least initialize the hardware to
>  *      a known working state, especially if it came back from another
>  *      process that also modifies the same hardware, such as X.
>  *
>  *      If this is the case, a combination such as the following should work:
>  *
>  *      static int xxxfb_check_var(struct fb_var_screeninfo *var,
>  *                                struct fb_info *info)
>  *      {
>  *              *var = info->var;
>  *              return 0;
>  *      }
>  *
>  *      static int xxxfb_set_par(struct fb_info *info)
>  *      {
>  *              init your hardware here
>  *      }


Yes, exactly that would be the patch to make it work.


>> But stifb and a few other fb drivers are not able to set sync timings, 
>> and for those X behaves IMHO wrong. For those X should assume that the 
>> timings set by the driver are correct as long as the resolution and bit 
>> depth are correct.
>>
>> This is what happens:
>> 1. In xorg.conf you configured a pixel resolution and bpp (e.g. 
>> 1280x1024-16)
>> 2. In xorg.conf you might have configured a monitor (with or without 
>> some timing/sync informations)
>> 3. X reads those config parameters and try to set them through kernel calls.
>> 4. Kernel returns that it now has set up the mode (1280x1024-16) and has 
>> set up the timings. Since stifb does not support timing modes, it 
>> returns zeros in those values (IMHO thats correct behavior if you look 
>> at the comments in skeletonfb.c)
>> 5. X verifies the returned values and aborts since the timing values are 
>> different to what it fed to the kernel, although the resolution 
>> (1280x1024-16) is correctly set and returned like that.
>>
>> I think X is right in noticing that the timing/sync values are not what 
>> it expected. Nevertheless, I would prefer that it would just warn (in 
>> the fbdev drivers only!) that the timings are incorrect instead of 
>> aborting completely. X is right to abort, if the pixel resolution and 
>> bpp can not be set.
>> So, X's tests should be like that:
>> a) resolution and bpp different -> abort
>> b) resolution and bpp correct, but sync timings/monitor timings 
>> different -> warn but continue
>>
>> Right now X's tests are:
>> resolution, bpp or sync/monitor timings different -> abort.
>>
>> Of course it's easily possible to change stifb in that it just takes any 
>> timing values, but that is not how it is documented in skeletonfb.
> 
> My sense in looking at the PR is that the freedesktop people won't
> accept this approach.

Sadly I have the same feeling.
But just scan yourself through the kernel fb drivers and look how many 
drivers haven't implemented this workaround with check_var and set_par.
All those fb drivers are probably broken due to this X behavior.

Helge

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

* Re: Kernel Panic during init with 2.6.29-gb609308 (fresh clone of git
       [not found] <no.id>
                   ` (32 preceding siblings ...)
  2008-08-23 16:48 ` X won't start with VisEG and 2.6.22.19 John David Anglin
@ 2009-05-03  0:48 ` John David Anglin
  2009-08-23 21:21 ` Reproducible random python crash John David Anglin
  2009-12-23 22:18 ` futex wait failure John David Anglin
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2009-05-03  0:48 UTC (permalink / raw)
  To: John David Anglin; +Cc: T-Bone, linux-parisc

> You might try building with the 4.1 branch.  I have had more luck
> with it.

I tried building 2.6.22.19 with debian 4.3.  Boot fails here:

md: raid0 personality registered for level 0
md: raid1 personality registered for level 1
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
Freeing unused kernel memory: <0>------------[ cut here ]------------
Badness at 000000004011e44c [verbose debug info unavailable]
Backtrace:
Backtrace:
 [<00000000401128c0>] dump_stack+0x18/0x28

Have to hit 'RS' twice.  The first time there is a hpmc in the memory test:

#  Location|Alert| Encoded Field    |  Data Field    |   Keyword / Timestamp
-------------------------------------------------------------------------------
52951  SFW  0   0  0x030010D500E00000 0000000000000000 CPU_STOP
52950  SFW  0   2  0x438010EF00E01B50 00000000FFFFFFFF MEM_UNEXPECTED_HPMC
                                                      03 May 2009 00:35:26
52949  SFW  0   0  0x160000C400E00000 0000000280000000 MEM_INIT
52948  SFW  0   0  0x370000FB00E00000 000000F000004002 MEM_WARN_INIT_ONLY

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

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

* Re: Reproducible random python crash.
       [not found] <no.id>
                   ` (33 preceding siblings ...)
  2009-05-03  0:48 ` Kernel Panic during init with 2.6.29-gb609308 (fresh clone of git John David Anglin
@ 2009-08-23 21:21 ` John David Anglin
  2009-12-23 22:18 ` futex wait failure John David Anglin
  35 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2009-08-23 21:21 UTC (permalink / raw)
  To: John David Anglin
  Cc: carlos, linux-parisc, debian-hppa, James.Bottomley, dave.anglin,
	deller, kyle

> I booted 2.6.30.5 from gsyprf11 because I had one random segv and
> one command hang while running the GCC testsuite.  I suspect that some
> hangs are due to dropped signals.  I'm tempted to try the sequence
> with 2.6.22.19.

SMP 2.6.22.19 also fails with random segvs and hangs.

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

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

* futex wait failure
@ 2009-12-22 15:03 John David Anglin
  2009-12-22 15:52 ` Carlos O'Donell
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2009-12-22 15:03 UTC (permalink / raw)
  To: linux-parisc

I recently update gsyprf11 to the latest debian testing.  I also
tried 2.6.32.2, first SMP, then UP because of /bin/sh segmentation
faults.

I think the /bin/sh segmentation faults are the vfork issue, but
the vfork testcases run successfully on the above.

My first attempt at running the GCC testsuite hung:

dave@gsyprf11:~/gcc-4.5/objdir$ ps -ef|grep dave|grep 18073
dave     18073 18064  2 Dec21 ?        00:11:07 expect -- /usr/share/dejagnu/runtest.exp --tool gfortran
dave     18091 18073  0 02:09 ?        00:00:00 [gfortran] <defunct>

dave@gsyprf11:~/gcc-4.5/objdir$ strace -p 18073
Process 18073 attached - interrupt to quit
futex(0x1c538, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
Process 18073 detached
dave@gsyprf11:~/gcc-4.5/objdir$ strace -p 18091
attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted

This is the backtrace for expect:

0x4039934c in __lll_lock_wait () from /lib/libpthread.so.0
(gdb) bt
#0  0x4039934c in __lll_lock_wait () from /lib/libpthread.so.0
#1  0x4038f9c4 in pthread_mutex_lock () from /lib/libpthread.so.0
#2  0x40b73008 in pthread_mutex_lock () from /lib/libc.so.6
#3  0x4085eeb8 in Tcl_WaitForEvent () from /usr/lib/libtcl8.5.so.0
#4  0x4081ccdc in Tcl_DoOneEvent () from /usr/lib/libtcl8.5.so.0
#5  0x4003d9c4 in exp_get_next_event () from /usr/lib/libexpect.so.5.44.1.14
#6  0x4001c6bc in expRead () from /usr/lib/libexpect.so.5.44.1.14
#7  0x4001eea0 in Exp_ExpectObjCmd () from /usr/lib/libexpect.so.5.44.1.14
...

This is just a guess but I would guess that the gfortran task either
didn't update the futex address, or is blocked from doing so.

libc6 is 2.10.2-2.

This is probably related to the long standing problem with expect
and tcl8.4 and later.  expect-tcl8.3 works better.

Any thoughts?

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

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

* Re: futex wait failure
  2009-12-22 15:03 John David Anglin
@ 2009-12-22 15:52 ` Carlos O'Donell
  0 siblings, 0 replies; 194+ messages in thread
From: Carlos O'Donell @ 2009-12-22 15:52 UTC (permalink / raw)
  To: John David Anglin; +Cc: linux-parisc

On Tue, Dec 22, 2009 at 10:03 AM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
> I recently update gsyprf11 to the latest debian testing. =A0I also
> tried 2.6.32.2, first SMP, then UP because of /bin/sh segmentation
> faults.
>
> I think the /bin/sh segmentation faults are the vfork issue, but
> the vfork testcases run successfully on the above.

That's a shame, the testcase was pretty straight forward. I will try
to update the test case when I have my new kernel running.

> My first attempt at running the GCC testsuite hung:
> dave@gsyprf11:~/gcc-4.5/objdir$ strace -p 18073
> Process 18073 attached - interrupt to quit
> futex(0x1c538, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
> Process 18073 detached
> dave@gsyprf11:~/gcc-4.5/objdir$ strace -p 18091
> attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted
>
> This is the backtrace for expect:
>
> 0x4039934c in __lll_lock_wait () from /lib/libpthread.so.0
> (gdb) bt
> #0 =A00x4039934c in __lll_lock_wait () from /lib/libpthread.so.0
> #1 =A00x4038f9c4 in pthread_mutex_lock () from /lib/libpthread.so.0
> #2 =A00x40b73008 in pthread_mutex_lock () from /lib/libc.so.6
> #3 =A00x4085eeb8 in Tcl_WaitForEvent () from /usr/lib/libtcl8.5.so.0
> #4 =A00x4081ccdc in Tcl_DoOneEvent () from /usr/lib/libtcl8.5.so.0
> #5 =A00x4003d9c4 in exp_get_next_event () from /usr/lib/libexpect.so.=
5.44.1.14
> #6 =A00x4001c6bc in expRead () from /usr/lib/libexpect.so.5.44.1.14
> #7 =A00x4001eea0 in Exp_ExpectObjCmd () from /usr/lib/libexpect.so.5.=
44.1.14
> ...
>
> This is just a guess but I would guess that the gfortran task either
> didn't update the futex address, or is blocked from doing so.
>
> libc6 is 2.10.2-2.
>
> This is probably related to the long standing problem with expect
> and tcl8.4 and later. =A0expect-tcl8.3 works better.
>
> Any thoughts?

You should be looking for the thread (not process) that is supposed to
wake this thread up. It's a private futex, meaning it isn't going to
be shared with any other process. If it is shared, and the wakeup (or
pthread_mutex_unlock) is issued from another thread in another process
then it won't be seen by the thread in this process.

We might have an hppa specific glibc bug related to the futex private f=
lag.

The hppa lowlevellock.h is a copy of the generic version. Perhaps I
need to update our copy to get recent bug fixes from other targets.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
       [not found] <20091222164810.DBF3B516F@hiauly1.hia.nrc.ca>
@ 2009-12-22 20:30 ` Carlos O'Donell
  2009-12-22 22:05   ` John David Anglin
       [not found]   ` <20091222212950.8E5F74EA9@hiauly1.hia.nrc.ca>
  0 siblings, 2 replies; 194+ messages in thread
From: Carlos O'Donell @ 2009-12-22 20:30 UTC (permalink / raw)
  To: John David Anglin; +Cc: linux-parisc

On Tue, Dec 22, 2009 at 11:48 AM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
> Debian gdb 7.0 provides slightly different backtraces:
>
> (gdb) bt
> #0 =A00x4039934c in __lll_lock_wait (futex=3D0x1c538,
> =A0 =A0private=3D<value optimized out>)
> ...
>
> and
>
> (gdb) bt
> #0 =A00x4038f92c in __lll_mutex_lock (mutex=3D0x1c538)

Any idea why both threads would try to lock the same mutex? This is
never going to work?

I think we need to step back from the edge and ask ourselves what
Tcl_WaitForEvent() is trying to do with the locks.

Do you know?

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2009-12-22 20:30 ` Carlos O'Donell
@ 2009-12-22 22:05   ` John David Anglin
  2009-12-23 15:01     ` Carlos O'Donell
       [not found]   ` <20091222212950.8E5F74EA9@hiauly1.hia.nrc.ca>
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2009-12-22 22:05 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: linux-parisc

> I think we need to step back from the edge and ask ourselves what
> Tcl_WaitForEvent() is trying to do with the locks.
> 
> Do you know?

In unix/tclUnixNotify.c:

#ifdef TCL_THREADS
    /*
     * Place this thread on the list of interested threads, signal the
     * notifier thread, and wait for a response or a timeout.
     */

    Tcl_MutexLock(&notifierMutex);
    ...
#endif

    ...

#ifdef TCL_THREADS
    Tcl_MutexUnlock(&notifierMutex);
#endif /* TCL_THREADS */
    return 0;
}

There may be a timed wait while holding the lock.  Something is broken
in the tcl/expect handling of timed waits as there were a couple of
compile timeouts for compilations that shouldn't have timed out.

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

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

* Re: futex wait failure
       [not found]   ` <20091222212950.8E5F74EA9@hiauly1.hia.nrc.ca>
@ 2009-12-23 14:56     ` Carlos O'Donell
  0 siblings, 0 replies; 194+ messages in thread
From: Carlos O'Donell @ 2009-12-23 14:56 UTC (permalink / raw)
  To: John David Anglin; +Cc: linux-parisc

On Tue, Dec 22, 2009 at 4:29 PM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
> It would seem to me we have deadlock. =A0Two threads trying to lock
> the same mutex. =A0One should win... =A0It may be the mutex was left
> locked by some other thread.

Yes, it was left locked by thread #2, which then tried to acquire it
again. See below.

> This is the mutex:
>
> (gdb) p *mutex
> $1 =3D {__data =3D {__lock =3D 2, __count =3D 0, __owner =3D 18093, _=
_kind =3D 0,
> =A0 =A0__compat_padding =3D {0, 0, 0, 0}, __nusers =3D 1, {__spins =3D=
 0, __list =3D {
> =A0 =A0__next =3D 0x0}}, __reserved1 =3D 0, __reserved2 =3D 0},
> =A0 =A0__size =3D "\000\000\000\002\000\000\000\000\000\000F\255", '\=
000' <repeats 23 times>, "\001", '\000' <repeats 11 times>, __align =3D=
 2}

The __nusers field indicates that one user, namely __owner tid 18093
has already taken the lock.

The mutex owner is thread #2 in your example (tid shown in your backtra=
ce).

Thread #2 is also trying to lock the mutex again and is deadlocked.

The mutex is the default __kind of PTHREAD_MUTEX_TIMED_NP, but that
doesn't mean it's timed, only that it supports a timed lock, if you
call it using pthread_mutex_lock it will lock just like any other
mutex.

The lock value is 2, which indicates a private lock. Your backtrace
indicates you have called __lll_lock_wait_private, which is correct
for this case.

Under what conditions would thread #2 have a chance to try take it's
own lock again?

> It's hard to see what's happening because I don't seem to be able to
> single step the threads.

Yeah, there are some gdb/ptrace issues I need to sort out for the
newly minted nptl support.

>>
>> I think we need to step back from the edge and ask ourselves what
>> Tcl_WaitForEvent() is trying to do with the locks.
>>
>> Do you know?
>
> No. =A0Note thread 2 called pthread_mutex_lock from a different locat=
ion.

We need to determine under what conditions thread #2 would be able to
take the lock again and deadlock.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2009-12-22 22:05   ` John David Anglin
@ 2009-12-23 15:01     ` Carlos O'Donell
  2009-12-23 16:15       ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2009-12-23 15:01 UTC (permalink / raw)
  To: John David Anglin; +Cc: linux-parisc

On Tue, Dec 22, 2009 at 5:05 PM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
>> I think we need to step back from the edge and ask ourselves what
>> Tcl_WaitForEvent() is trying to do with the locks.
>>
>> Do you know?
>
> In unix/tclUnixNotify.c:
>
> #ifdef TCL_THREADS
> =A0 =A0/*
> =A0 =A0 * Place this thread on the list of interested threads, signal=
 the
> =A0 =A0 * notifier thread, and wait for a response or a timeout.
> =A0 =A0 */

There will never be a timeout if you call pthread_mutex_lock as the
underlying operation. So this comment is a bit odd?

> =A0 =A0Tcl_MutexLock(&notifierMutex);
> =A0 =A0...
> #endif
>
> =A0 =A0...
>
> #ifdef TCL_THREADS
> =A0 =A0Tcl_MutexUnlock(&notifierMutex);
> #endif /* TCL_THREADS */
> =A0 =A0return 0;
> }
>
> There may be a timed wait while holding the lock. =A0Something is bro=
ken
> in the tcl/expect handling of timed waits as there were a couple of
> compile timeouts for compilations that shouldn't have timed out.

There is no timed wait possible, you have called pthread_mutex_lock,
instead of pthread_mutex_timedlock.

What are Tcl's expectations here? It looks like we are stuck in
libtcl.so for both threads, which are trying to access this event
queue.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2009-12-23 15:01     ` Carlos O'Donell
@ 2009-12-23 16:15       ` John David Anglin
  2009-12-23 16:48         ` John David Anglin
  2009-12-23 20:36         ` Carlos O'Donell
  0 siblings, 2 replies; 194+ messages in thread
From: John David Anglin @ 2009-12-23 16:15 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: linux-parisc

On Wed, 23 Dec 2009, Carlos O'Donell wrote:

> On Tue, Dec 22, 2009 at 5:05 PM, John David Anglin
> <dave@hiauly1.hia.nrc.ca> wrote:
> >> I think we need to step back from the edge and ask ourselves what
> >> Tcl_WaitForEvent() is trying to do with the locks.
> >>
> >> Do you know?
> >
> > In unix/tclUnixNotify.c:
> >
> > #ifdef TCL_THREADS
> > =A0 =A0/*
> > =A0 =A0 * Place this thread on the list of interested threads, sign=
al the
> > =A0 =A0 * notifier thread, and wait for a response or a timeout.
> > =A0 =A0 */
>=20
> There will never be a timeout if you call pthread_mutex_lock as the
> underlying operation. So this comment is a bit odd?

The wait is done by Tcl_ConditionWait.  It uses  pthread_cond_wait
if timePtr is NULL, otherwise it uses
pthread_cond_timedwait(pcondPtr, pmutexPtr, &ptime).  Do these work
holding a lock?  Any chance that these try to take a lock?

It sems like bad coding to do a wait holding a lock.  In any case,
I don't think this is the problem.

As you noted, the lock is held by the other thread.  The return pc is
beyond Tcl_WaitForEvent.  The only users of the notifierMutex mutex
are in tclUnixNotfy.c.  The only interesting thing done holding the
notifierMutex mutex in code after Tcl_WaitForEvent is to call
Tcl_ConditionNotify.  It calls pthread_cond_broadcast if the condition
pointer isn't NULL.

Could this deadlock?  It's hard to see how it could since the mutex
doesn't seem to be involved.

Dave
--=20
J. David Anglin                                  dave.anglin@nrc-cnrc.g=
c.ca
National Research Council of Canada              (613) 990-0752 (FAX: 9=
52-6602)
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2009-12-23 16:15       ` John David Anglin
@ 2009-12-23 16:48         ` John David Anglin
  2009-12-23 20:39           ` John David Anglin
  2009-12-23 20:36         ` Carlos O'Donell
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2009-12-23 16:48 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: linux-parisc

On Wed, 23 Dec 2009, John David Anglin wrote:

> As you noted, the lock is held by the other thread.  The return pc is
> beyond Tcl_WaitForEvent.  The only users of the notifierMutex mutex
> are in tclUnixNotfy.c.  The only interesting thing done holding the
> notifierMutex mutex in code after Tcl_WaitForEvent is to call
> Tcl_ConditionNotify.  It calls pthread_cond_broadcast if the condition
> pointer isn't NULL.
> 
> Could this deadlock?  It's hard to see how it could since the mutex
> doesn't seem to be involved.

Actually, I see that the mutex and futex are part of the pthread_cond_t
type, so pthread_cond_broadcast could deadlock if not implemented properly.

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

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

* Re: futex wait failure
  2009-12-23 16:15       ` John David Anglin
  2009-12-23 16:48         ` John David Anglin
@ 2009-12-23 20:36         ` Carlos O'Donell
  2009-12-23 20:57           ` John David Anglin
  1 sibling, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2009-12-23 20:36 UTC (permalink / raw)
  To: John David Anglin; +Cc: linux-parisc

On Wed, Dec 23, 2009 at 11:15 AM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
>> There will never be a timeout if you call pthread_mutex_lock as the
>> underlying operation. So this comment is a bit odd?
>
> The wait is done by Tcl_ConditionWait. =A0It uses =A0pthread_cond_wai=
t
> if timePtr is NULL, otherwise it uses
> pthread_cond_timedwait(pcondPtr, pmutexPtr, &ptime). =A0Do these work
> holding a lock? =A0Any chance that these try to take a lock?

When you call pthread_cond_timedwait you must be holding pmutexPtr.

The call to pthread_cond_timedwait atomically release mutex and cause
the calling thread to sleep on the condition variable cond; atomically
here means "atomically with respect to access by another thread to
the mutex and then the condition variable". Once awoken by a broadcast,
it retakes the mutex pmutexPtr.

The glibc implementation with futexes reads pretty much exactly like
the description here:
http://www.opengroup.org/onlinepubs/000095399/functions/pthread_cond_ti=
medwait.html

> It sems like bad coding to do a wait holding a lock. =A0In any case,
> I don't think this is the problem.

You shouldn't be holding a lock while waiting. The call to
pthread_cond_timedwait
should have released the mutex before sleeping.

> As you noted, the lock is held by the other thread. =A0The return pc =
is
> beyond Tcl_WaitForEvent. =A0The only users of the notifierMutex mutex
> are in tclUnixNotfy.c. =A0The only interesting thing done holding the
> notifierMutex mutex in code after Tcl_WaitForEvent is to call
> Tcl_ConditionNotify. =A0It calls pthread_cond_broadcast if the condit=
ion
> pointer isn't NULL.
> Could this deadlock? =A0It's hard to see how it could since the mutex
> doesn't seem to be involved.

It shouldn't deadlock.

Is this a UP kernel?

Perhaps what I'm not clear about here, is which mutex is the one that
we are stuck on?

Are we stuck on the mutex we want to pass to pthread_cond_timedwait?

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2009-12-23 16:48         ` John David Anglin
@ 2009-12-23 20:39           ` John David Anglin
  2009-12-23 20:45             ` Carlos O'Donell
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2009-12-23 20:39 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: linux-parisc

On Wed, 23 Dec 2009, John David Anglin wrote:

> On Wed, 23 Dec 2009, John David Anglin wrote:
> 
> > As you noted, the lock is held by the other thread.  The return pc is
> > beyond Tcl_WaitForEvent.  The only users of the notifierMutex mutex
> > are in tclUnixNotfy.c.  The only interesting thing done holding the
> > notifierMutex mutex in code after Tcl_WaitForEvent is to call
> > Tcl_ConditionNotify.  It calls pthread_cond_broadcast if the condition
> > pointer isn't NULL.
> > 
> > Could this deadlock?  It's hard to see how it could since the mutex
> > doesn't seem to be involved.
> 
> Actually, I see that the mutex and futex are part of the pthread_cond_t
> type, so pthread_cond_broadcast could deadlock if not implemented properly.

The deadlock occurs at the third call to Tcl_MutexLock in NotifierThreadProc
(tclUnixNotfy.c:997).  This is in a while(1) loop, so I have to think
the previous call to Tcl_MutexUnlock failed, possibly because of a call
to Tcl_ConditionNotify.

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

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

* Re: futex wait failure
  2009-12-23 20:39           ` John David Anglin
@ 2009-12-23 20:45             ` Carlos O'Donell
  2009-12-23 20:46               ` Carlos O'Donell
  2009-12-23 21:08               ` John David Anglin
  0 siblings, 2 replies; 194+ messages in thread
From: Carlos O'Donell @ 2009-12-23 20:45 UTC (permalink / raw)
  To: John David Anglin; +Cc: linux-parisc

On Wed, Dec 23, 2009 at 3:39 PM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
> The deadlock occurs at the third call to Tcl_MutexLock in NotifierThr=
eadProc
> (tclUnixNotfy.c:997). =A0This is in a while(1) loop, so I have to thi=
nk
> the previous call to Tcl_MutexUnlock failed, possibly because of a ca=
ll
> to Tcl_ConditionNotify.

You might get a better idea if you run this under strace and look at
the futex syscalls being made. You won't see the locks since the fast
path is through the light-weight-syscall compare-and-swap, but you
will see the unlocks, and you can count them.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2009-12-23 20:45             ` Carlos O'Donell
@ 2009-12-23 20:46               ` Carlos O'Donell
  2009-12-23 21:08               ` John David Anglin
  1 sibling, 0 replies; 194+ messages in thread
From: Carlos O'Donell @ 2009-12-23 20:46 UTC (permalink / raw)
  To: John David Anglin; +Cc: linux-parisc

On Wed, Dec 23, 2009 at 3:45 PM, Carlos O'Donell
<carlos@systemhalted.org> wrote:
> On Wed, Dec 23, 2009 at 3:39 PM, John David Anglin
> <dave@hiauly1.hia.nrc.ca> wrote:
>> The deadlock occurs at the third call to Tcl_MutexLock in NotifierTh=
readProc
>> (tclUnixNotfy.c:997). =A0This is in a while(1) loop, so I have to th=
ink
>> the previous call to Tcl_MutexUnlock failed, possibly because of a c=
all
>> to Tcl_ConditionNotify.
>
> You might get a better idea if you run this under strace and look at
> the futex syscalls being made. You won't see the locks since the fast
> path is through the light-weight-syscall compare-and-swap, but you
> will see the unlocks, and you can count them.

Sorry, let me be clearer here. The *first* lock is through the fast
path of the lws CAS operation. All subsequent locks take the form of a
futex wait. All subsequent unlocks are a futex wake.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2009-12-23 20:36         ` Carlos O'Donell
@ 2009-12-23 20:57           ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2009-12-23 20:57 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: John David Anglin, linux-parisc

On Wed, 23 Dec 2009, Carlos O'Donell wrote:

> On Wed, Dec 23, 2009 at 11:15 AM, John David Anglin
> <dave@hiauly1.hia.nrc.ca> wrote:
> >> There will never be a timeout if you call pthread_mutex_lock as th=
e
> >> underlying operation. So this comment is a bit odd?
> >
> > The wait is done by Tcl_ConditionWait. =A0It uses =A0pthread_cond_w=
ait
> > if timePtr is NULL, otherwise it uses
> > pthread_cond_timedwait(pcondPtr, pmutexPtr, &ptime). =A0Do these wo=
rk
> > holding a lock? =A0Any chance that these try to take a lock?
>=20
> When you call pthread_cond_timedwait you must be holding pmutexPtr.
>=20
> The call to pthread_cond_timedwait atomically release mutex and cause
> the calling thread to sleep on the condition variable cond; atomicall=
y
> here means "atomically with respect to access by another thread to
> the mutex and then the condition variable". Once awoken by a broadcas=
t,
> it retakes the mutex pmutexPtr.
>=20
> The glibc implementation with futexes reads pretty much exactly like
> the description here:
> http://www.opengroup.org/onlinepubs/000095399/functions/pthread_cond_=
timedwait.html
>=20
> > It sems like bad coding to do a wait holding a lock. =A0In any case=
,
> > I don't think this is the problem.
>=20
> You shouldn't be holding a lock while waiting. The call to
> pthread_cond_timedwait
> should have released the mutex before sleeping.

No, the manpage for pthread_cond_wait and pthread_cond_timedwait
indicates that these calls atomically unlock the mutex, so the implemen=
tation
appears correct.  Before returning to the calling thread, they relock
the mutex.  So, the mutex shouldn't be held while the thread is
sleeping.

>=20
> > As you noted, the lock is held by the other thread. =A0The return p=
c is
> > beyond Tcl_WaitForEvent. =A0The only users of the notifierMutex mut=
ex
> > are in tclUnixNotfy.c. =A0The only interesting thing done holding t=
he
> > notifierMutex mutex in code after Tcl_WaitForEvent is to call
> > Tcl_ConditionNotify. =A0It calls pthread_cond_broadcast if the cond=
ition
> > pointer isn't NULL.
> > Could this deadlock? =A0It's hard to see how it could since the mut=
ex
> > doesn't seem to be involved.
>=20
> It shouldn't deadlock.
>=20
> Is this a UP kernel?

Yes.  This has now happened twice in one testsuite run.

> Perhaps what I'm not clear about here, is which mutex is the one that
> we are stuck on?

notifierMutex.  It controls all activities in tclUnixNotfy.c.

> Are we stuck on the mutex we want to pass to pthread_cond_timedwait?

Yes.

Dave
--=20
J. David Anglin                                  dave.anglin@nrc-cnrc.g=
c.ca
National Research Council of Canada              (613) 990-0752 (FAX: 9=
52-6602)
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2009-12-23 20:45             ` Carlos O'Donell
  2009-12-23 20:46               ` Carlos O'Donell
@ 2009-12-23 21:08               ` John David Anglin
  2009-12-23 21:48                 ` Carlos O'Donell
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2009-12-23 21:08 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: John David Anglin, linux-parisc

On Wed, 23 Dec 2009, Carlos O'Donell wrote:

> On Wed, Dec 23, 2009 at 3:39 PM, John David Anglin
> <dave@hiauly1.hia.nrc.ca> wrote:
> > The deadlock occurs at the third call to Tcl_MutexLock in NotifierT=
hreadProc
> > (tclUnixNotfy.c:997). =A0This is in a while(1) loop, so I have to t=
hink
> > the previous call to Tcl_MutexUnlock failed, possibly because of a =
call
> > to Tcl_ConditionNotify.
>=20
> You might get a better idea if you run this under strace and look at
> the futex syscalls being made. You won't see the locks since the fast
> path is through the light-weight-syscall compare-and-swap, but you
> will see the unlocks, and you can count them.

I would guess that the notifierMutex is locked/unlocked millions of
time in a typical GCC testsuite run.  So, the problem won't be easy
to duplicate manually.

Dave
--=20
J. David Anglin                                  dave.anglin@nrc-cnrc.g=
c.ca
National Research Council of Canada              (613) 990-0752 (FAX: 9=
52-6602)
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2009-12-23 21:08               ` John David Anglin
@ 2009-12-23 21:48                 ` Carlos O'Donell
  0 siblings, 0 replies; 194+ messages in thread
From: Carlos O'Donell @ 2009-12-23 21:48 UTC (permalink / raw)
  To: John David Anglin; +Cc: linux-parisc

On Wed, Dec 23, 2009 at 4:08 PM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
>> You might get a better idea if you run this under strace and look at
>> the futex syscalls being made. You won't see the locks since the fas=
t
>> path is through the light-weight-syscall compare-and-swap, but you
>> will see the unlocks, and you can count them.
>
> I would guess that the notifierMutex is locked/unlocked millions of
> time in a typical GCC testsuite run. =A0So, the problem won't be easy
> to duplicate manually.

You would be surprised how easy it is to duplicate some of these
problems. We need to write a small skeleton application that does
something similar to the notification done by tcl and uses
pthread_cond_timedwait. Setup main to run forever signaling the child
which does something and then goes back to waiting. Eventually this
should lock up like it does in tcl.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
       [not found] <no.id>
                   ` (34 preceding siblings ...)
  2009-08-23 21:21 ` Reproducible random python crash John David Anglin
@ 2009-12-23 22:18 ` John David Anglin
  2009-12-24  2:22   ` Carlos O'Donell
  35 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2009-12-23 22:18 UTC (permalink / raw)
  To: John David Anglin; +Cc: carlos, dave.anglin, linux-parisc

> I have noticed that the notifierMutex mutex is initialized to all
> zeros (i.e., it's declared static).  Is this ok with our nptl implementation?

Forget this, it's done in Tcl_MutexLock.

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

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

* Re: futex wait failure
  2009-12-23 22:18 ` futex wait failure John David Anglin
@ 2009-12-24  2:22   ` Carlos O'Donell
  2009-12-28 18:59     ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2009-12-24  2:22 UTC (permalink / raw)
  To: John David Anglin; +Cc: dave.anglin, linux-parisc

On Wed, Dec 23, 2009 at 5:18 PM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
>> I have noticed that the notifierMutex mutex is initialized to all
>> zeros (i.e., it's declared static). =A0Is this ok with our nptl impl=
ementation?
>
> Forget this, it's done in Tcl_MutexLock.

In NPTL the hppa locks are all zero. We no longer use
load-and-clear-word for anything in userspace.

Even the dynamic initialization will zero the lock.

We are just like every other architecture... with the exception that
we currently have more bugs :-)

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2009-12-24  2:22   ` Carlos O'Donell
@ 2009-12-28 18:59     ` John David Anglin
  2009-12-29 13:47       ` Helge Deller
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2009-12-28 18:59 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: dave.anglin, linux-parisc

[-- Attachment #1: Type: text/plain, Size: 857 bytes --]

On Wed, 23 Dec 2009, Carlos O'Donell wrote:

> We are just like every other architecture... with the exception that
> we currently have more bugs :-)

I have been looking at the lws implementation.  I've attached a patch
with a couple of tweaks:

1) I changed the unconditional branch at the entry point to a gate.
Didn't think it was a good idea to execute code at user priveledge.
This seems to have improved things (got through a complete testsuite
run on gsyprf11 without a deadlock).  However, I hit a slightly
different lockup on c3750.

2) Change return space register to sr7.  sr3 is not set correctly
if the entry number is invalid.

Have nasty suspicion that sr3 is getting hit...

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

[-- Attachment #2: syscall.S.d.1 --]
[-- Type: text/plain, Size: 1206 bytes --]

--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -47,18 +47,17 @@ ENTRY(linux_gateway_page)
 	KILL_INSN
 	.endr
 
-	/* ADDRESS 0xb0 to 0xb4, lws uses 1 insns for entry */
+	/* ADDRESS 0xb0 to 0xb8, lws uses two insns for entry */
 	/* Light-weight-syscall entry must always be located at 0xb0 */
 	/* WARNING: Keep this number updated with table size changes */
 #define __NR_lws_entries (2)
 
 lws_entry:
-	/* Unconditional branch to lws_start, located on the 
-	   same gateway page */
-	b,n	lws_start
+	gate	lws_start, %r0		/* increase privilege */
+	depi	3, 31, 2, %r31		/* Ensure we return into user mode. */
 
-	/* Fill from 0xb4 to 0xe0 */
-	.rept 11
+	/* Fill from 0xb8 to 0xe0 */
+	.rept 10
 	KILL_INSN
 	.endr
 
@@ -423,9 +422,6 @@ tracesys_sigexit:
 
 	*********************************************************/
 lws_start:
-	/* Gate and ensure we return to userspace */
-	gate	.+8, %r0
-	depi	3, 31, 2, %r31	/* Ensure we return to userspace */
 
 #ifdef CONFIG_64BIT
 	/* FIXME: If we are a 64-bit kernel just
@@ -473,7 +469,7 @@ lws_exit:
 	/* now reset the lowest bit of sp if it was set */
 	xor	%r30,%r1,%r30
 #endif
-	be,n	0(%sr3, %r31)
+	be,n	0(%sr7, %r31)
 
 
 	

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

* Re: futex wait failure
  2009-12-28 18:59     ` John David Anglin
@ 2009-12-29 13:47       ` Helge Deller
  2009-12-29 15:00         ` John David Anglin
  2009-12-31 18:14         ` Carlos O'Donell
  0 siblings, 2 replies; 194+ messages in thread
From: Helge Deller @ 2009-12-29 13:47 UTC (permalink / raw)
  To: John David Anglin; +Cc: John David Anglin, Carlos O'Donell, linux-parisc

On 12/28/2009 07:59 PM, John David Anglin wrote:
> On Wed, 23 Dec 2009, Carlos O'Donell wrote:
>
>> We are just like every other architecture... with the exception that
>> we currently have more bugs :-)
>
> I have been looking at the lws implementation.  I've attached a patch
> with a couple of tweaks:

The patch looks good.

> 1) I changed the unconditional branch at the entry point to a gate.
> Didn't think it was a good idea to execute code at user priveledge.

Can you explain that?
The branch might get interrupted, before the process get privileged?

> This seems to have improved things (got through a complete testsuite
> run on gsyprf11 without a deadlock).

Good. I'll test too.

>However, I hit a slightly different lockup on c3750.

Any info?

> 2) Change return space register to sr7.  sr3 is not set correctly
> if the entry number is invalid.

Yep.

> Have nasty suspicion that sr3 is getting hit...

Helge

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

* Re: futex wait failure
  2009-12-29 13:47       ` Helge Deller
@ 2009-12-29 15:00         ` John David Anglin
  2009-12-30 10:49           ` Randolph Chung
  2009-12-31 18:14         ` Carlos O'Donell
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2009-12-29 15:00 UTC (permalink / raw)
  To: Helge Deller; +Cc: dave.anglin, carlos, linux-parisc

> The patch looks good.
> 
> > 1) I changed the unconditional branch at the entry point to a gate.
> > Didn't think it was a good idea to execute code at user priveledge.
> 
> Can you explain that?

Not really, except that we gate immediately in the other code paths.
The gateway page is special in that processes are not supposed to get
scheduled off the page.

> The branch might get interrupted, before the process get privileged?

That was the concern.  At worst, an unnecessary branch is eliminated.
It's clear that this doesn't fix the futex deadlock, but the timing of
the lws lock code has changed resulting in slightly different symptoms.

> > This seems to have improved things (got through a complete testsuite
> > run on gsyprf11 without a deadlock).
> 
> Good. I'll test too.
> 
> >However, I hit a slightly different lockup on c3750.
> 
> Any info?

No, I restarted a new GCC build on this machine.  As with the previous
case on gsyprf11, thread 2 in expect seemed confused about its holding
the lock.  I've got a new hang on gsyprf11 to look at.

In my build last night on the c3750, expect dropped core in the GCC
testsuite.  Otherwise, it completed the GCC build and check.  I'll
look a bit at the core dump today.

On my rp3440 (UP kernel), I had several segmentation faults in /bin/sh
building GCC with 2.6.32.2.  For some reason, 2.6.31.9 is better.  I
haven't tried expect 5.44.1.14-5 on it.  It currently using expect-tcl8.3
which avoids the pthread issue.

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

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

* Re: futex wait failure
  2009-12-29 15:00         ` John David Anglin
@ 2009-12-30 10:49           ` Randolph Chung
  0 siblings, 0 replies; 194+ messages in thread
From: Randolph Chung @ 2009-12-30 10:49 UTC (permalink / raw)
  To: John David Anglin; +Cc: Helge Deller, dave.anglin, carlos, linux-parisc

> Not really, except that we gate immediately in the other code paths.
> The gateway page is special in that processes are not supposed to get
> scheduled off the page.
> 
>> The branch might get interrupted, before the process get privileged?
> 
> That was the concern.  At worst, an unnecessary branch is eliminated.
> It's clear that this doesn't fix the futex deadlock, but the timing of
> the lws lock code has changed resulting in slightly different symptoms.

IIRC we had to move the gate in the regular syscall path earlier as well 
to fix some security problems before. I don't recall the exact details, 
but I seem to recall it had to do with using ptrace(SINGLESTEP).

randolph

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

* Re: futex wait failure
  2009-12-29 13:47       ` Helge Deller
  2009-12-29 15:00         ` John David Anglin
@ 2009-12-31 18:14         ` Carlos O'Donell
  2009-12-31 19:11           ` Helge Deller
  2009-12-31 22:38           ` John David Anglin
  1 sibling, 2 replies; 194+ messages in thread
From: Carlos O'Donell @ 2009-12-31 18:14 UTC (permalink / raw)
  To: Helge Deller; +Cc: John David Anglin, John David Anglin, linux-parisc

On Tue, Dec 29, 2009 at 8:47 AM, Helge Deller <deller@gmx.de> wrote:
>> 2) Change return space register to sr7. =A0sr3 is not set correctly
>> if the entry number is invalid.
>
> Yep.
>
>> Have nasty suspicion that sr3 is getting hit...

Is the thought here that we take an interrupt, and sr3 is not
guaranteed saved/restored, while sr7 is guaranteed?

I don't see anything wrong with moving the gate earlier (unless
someone can come up with a case where an LWS may not want to gate).

It has the benefit of making the fast path 1 instruction shorter,
however I don't see that it makes the implementation more correct.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2009-12-31 18:14         ` Carlos O'Donell
@ 2009-12-31 19:11           ` Helge Deller
  2010-01-01  3:49             ` John David Anglin
  2009-12-31 22:38           ` John David Anglin
  1 sibling, 1 reply; 194+ messages in thread
From: Helge Deller @ 2009-12-31 19:11 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: John David Anglin, John David Anglin, linux-parisc

On 12/31/2009 07:14 PM, Carlos O'Donell wrote:
> On Tue, Dec 29, 2009 at 8:47 AM, Helge Deller<deller@gmx.de>  wrote:
>>> 2) Change return space register to sr7.  sr3 is not set correctly
>>> if the entry number is invalid.
>>
>> Yep.
>>
>>> Have nasty suspicion that sr3 is getting hit...
>
> Is the thought here that we take an interrupt, and sr3 is not
> guaranteed saved/restored, while sr7 is guaranteed?
>
> I don't see anything wrong with moving the gate earlier (unless
> someone can come up with a case where an LWS may not want to gate).
>
> It has the benefit of making the fast path 1 instruction shorter,
> however I don't see that it makes the implementation more correct.

I tested the patch and the testcase in
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561203
still segfaults.

Nevertheless, I think Dave's patch should be applied...

Helge

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

* Re: futex wait failure
  2009-12-31 18:14         ` Carlos O'Donell
  2009-12-31 19:11           ` Helge Deller
@ 2009-12-31 22:38           ` John David Anglin
  2010-01-01  0:36             ` John David Anglin
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2009-12-31 22:38 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: deller, dave.anglin, linux-parisc

> 
> On Tue, Dec 29, 2009 at 8:47 AM, Helge Deller <deller@gmx.de> wrote:
> >> 2) Change return space register to sr7. =A0sr3 is not set correctly
> >> if the entry number is invalid.
> >
> > Yep.
> >
> >> Have nasty suspicion that sr3 is getting hit...
> 
> Is the thought here that we take an interrupt, and sr3 is not
> guaranteed saved/restored, while sr7 is guaranteed?

sr3 isn't guaranteed because user could have changed its value.  So,
it is better to use sr7 for the return, particularly when lws entry
number isn't valid.

Regarding the handling of space registers during interruptions, they
are not saved.  syscall_exit_rfi restores them to proper values:

        /*
	 * If we aren't being traced, we never saved space registers
	 * (we don't store them in the sigcontext), so set them
	 * to "proper" values now (otherwise we'll wind up restoring
	 * whatever was last stored in the task structure, which might
	 * be inconsistent if an interrupt occured while on the gateway
	 * page). Note that we may be "trashing" values the user put in
	 * them, but we don't support the user changing them.
	*/

	STREG   %r0,PT_SR2(%r16)
	mfsp    %sr3,%r19
	STREG   %r19,PT_SR0(%r16)
	STREG   %r19,PT_SR1(%r16)
	STREG   %r19,PT_SR3(%r16)

As can be seen, sr2 set to the kernel space and sr3 to the user space.
This is consistent with the usage in the LWS code, so an interruption
shouldn't be a problem on most syscall returns via this path.  However,
execve doesn't restore the space register values (at least in this path).

The comment in the LWS code is a bit misleading:

        /* WARNING: Trashing sr2 and sr3 */
	mfsp    %sr7,%r1                        /* get userspace into sr3 */
	mtsp    %r1,%sr3
	mtsp    %r0,%sr2                        /* get kernel space into sr2 */

Actually, sr2 and sr3 are restored to their "proper" values.

The TLB code seems to assume a consistent use of sr3.  So, this may not
be a space register issue.

The syscall_restore uses a rsm/ssm pair to make the operation atomic.
Maybe we don't catch all situations where process is scheduled.

As an aside, it seems gdb doesn't print space registers correctly
when debugging a program.  I would guess this is because they are
not saved in the context.  It does print them from a core dump.

> I don't see anything wrong with moving the gate earlier (unless
> someone can come up with a case where an LWS may not want to gate).
> 
> It has the benefit of making the fast path 1 instruction shorter,
> however I don't see that it makes the implementation more correct.

I believe that it does have an effect.  See for example, the discussion
regarding delivery of signals to processes executing on the gateway page
in traps.c.  With the branch, it is possible that a signal could be
sent to a process executing on the gateway page.  See also space_check
macro in entry.S.  There's also the ptrace issue mentioned by Randolph.

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

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

* Re: futex wait failure
  2010-01-31 21:14                                       ` Helge Deller
@ 2010-01-01  0:26                                         ` John David Anglin
  2010-02-01 12:58                                           ` Carlos O'Donell
  2010-02-01 19:02                                           ` Helge Deller
  0 siblings, 2 replies; 194+ messages in thread
From: John David Anglin @ 2010-01-01  0:26 UTC (permalink / raw)
  To: Helge Deller; +Cc: carlos, dave.anglin, linux-parisc

> >> Actually I did tested this with the minifail test program, and changed
> >> thread_run() to call _exit(0) at the end instead of "return 0":
> >> void* thread_run(void* arg) {
> >>         ...
> >> /*      return (void *)&status;  */
> >>         _exit(0);
> >> }
> >> With strace I then suddenly got exit_group() which seems more correct:
> >> [pid  1910] write(1, "Thread OK.\n", 11) = 11
> >> [pid  1910] exit_group(0)               = ?

Did this fix minifail?

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

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

* Re: futex wait failure
  2009-12-31 22:38           ` John David Anglin
@ 2010-01-01  0:36             ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2010-01-01  0:36 UTC (permalink / raw)
  To: John David Anglin; +Cc: carlos, deller, dave.anglin, linux-parisc

> Regarding the handling of space registers during interruptions, they
> are not saved.  syscall_exit_rfi restores them to proper values:

This is potentially an implementation bug, particularly with respect to
interruptions.   User space probably should have sr0-sr3 available to
do icache flushes, etc.  Currently, gcc uses sr0 for icache flushes.

It may be sr0 is never clobbered, but this isn't clear.  I'm fairly sure
HP-UX saves sr0-sr4 if necessary.

Possibly, the icache flush sequence should be changed for linux to not
use sr0.

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

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

* Re: futex wait failure
  2009-12-31 19:11           ` Helge Deller
@ 2010-01-01  3:49             ` John David Anglin
  2010-01-01  5:02               ` John David Anglin
  2010-01-04 16:27               ` Helge Deller
  0 siblings, 2 replies; 194+ messages in thread
From: John David Anglin @ 2010-01-01  3:49 UTC (permalink / raw)
  To: Helge Deller; +Cc: carlos, dave.anglin, linux-parisc

> I tested the patch and the testcase in
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561203
> still segfaults.

I think the expect/tcl bug and the bug 561203 are related.  Looking
at the minifail core dump, I see:

Core was generated by `./minifail'.
Program terminated with signal 11, Segmentation fault.
#0  0x00000000 in ?? ()

So, how did we get to 0?  $rp is 0, so we might have executed a
return to this location.  $r31 conains 0x4157cc4f.

(gdb) disass 0x4157cc3c 0x4157cc5c
Dump of assembler code from 0x4157cc3c to 0x4157cc5c:
0x4157cc3c <_IO_puts+332>:      copy rp,r25
0x4157cc40 <_IO_puts+336>:      copy r6,r24
0x4157cc44 <_IO_puts+340>:      be,l b0(sr2,r0),sr0,r31
0x4157cc48 <_IO_puts+344>:      ldi 0,r20
0x4157cc4c <_IO_puts+348>:      ldi -b,r24
0x4157cc50 <_IO_puts+352>:      cmpb,=,n r24,r21,0x4157cc38 <_IO_puts+328>
0x4157cc54 <_IO_puts+356>:      nop
0x4157cc58 <_IO_puts+360>:      ldi -2d,r25

So, it would see $r31 was last set by a call to the lws code.

(gdb) info thread
  2 Thread 2397  *__GI__IO_list_lock () at genops.c:1297
* 1 Thread 2398  0x00000000 in ?? ()

(gdb) thread 2
[Switching to thread 2 (Thread 2397)]#0  *__GI__IO_list_lock ()
    at genops.c:1297
1297    genops.c: No such file or directory.
        in genops.c
(gdb) bt
#0  *__GI__IO_list_lock () at genops.c:1297
#1  0x415c06d0 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/fork.c:117
#2  0x00011068 in pure_test () at minifail.cpp:55
#3  0x00011350 in main (argc=1, argv=0xc0497028) at minifail.cpp:80

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

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

* Re: futex wait failure
  2010-01-01  3:49             ` John David Anglin
@ 2010-01-01  5:02               ` John David Anglin
  2010-01-04 16:27               ` Helge Deller
  1 sibling, 0 replies; 194+ messages in thread
From: John David Anglin @ 2010-01-01  5:02 UTC (permalink / raw)
  To: John David Anglin; +Cc: deller, carlos, dave.anglin, linux-parisc

> Core was generated by `./minifail'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x00000000 in ?? ()

I wasn't able to duplicate the above running minifail under gdb.
However, I did eventually get it to hang.

(gdb) info thread
  2 Thread 0x42169480 (LWP 3246)  0x40240760 in start_thread (arg=0x42169480)
    at pthread_create.c:293
* 1 Thread 0x400040c0 (LWP 3245)  0x40240c2c in pthread_join (
  threadid=1108776064, thread_return=0x0) at pthread_join.c:89
(gdb) bt
#0  0x40240c2c in pthread_join (threadid=1108776064, thread_return=0x0)
    at pthread_join.c:89
#1  0x00011118 in pure_test () at minifail.cpp:70
#2  0x00011350 in main (argc=1, argv=0xbffd3020) at minifail.cpp:80
(gdb) disass 0x40240c1c 0x40240c3c
Dump of assembler code from 0x40240c1c to 0x40240c3c:
0x40240c1c <pthread_join+268>:  copy r3,r26
0x40240c20 <pthread_join+272>:  copy r19,r4
0x40240c24 <pthread_join+276>:  be,l 100(sr2,r0),sr0,r31
0x40240c28 <pthread_join+280>:  ldi d2,r20
0x40240c2c <pthread_join+284>:  copy r4,r19
0x40240c30 <pthread_join+288>:  ldw 68(r5),r24
0x40240c34 <pthread_join+292>:  cmpib,<> 0,r24,0x40240c18 <pthread_join+264>
0x40240c38 <pthread_join+296>:  ldi 0,r23
End of assembler dump.

So, thread 1 is in a syscall.

(gdb) thread 2
[Switching to thread 2 (Thread 0x42169480 (LWP 3246))]#0  0x40240760 in start_thread (arg=0x42169480) at pthread_create.c:293
293     pthread_create.c: No such file or directory.
        in pthread_create.c
(gdb) bt
#0  0x40240760 in start_thread (arg=0x42169480) at pthread_create.c:293
#1  0x412082bc in clone () from /lib/libc.so.6
#2  0x00000000 in ?? ()
(gdb) disass 0x40240760 0x402407a0
Dump of assembler code from 0x40240754 to 0x402407a8:
0x40240754 <start_thread+1108>: ldw 214(ret0),rp
0x40240758 <start_thread+1112>: copy r3,r26
0x40240760 <start_thread+1120>: copy r4,r24
0x40240764 <start_thread+1124>: be,l b0(sr2,r0),sr0,r31
0x40240768 <start_thread+1128>: ldi 0,r20
0x4024076c <start_thread+1132>: ldi -b,r24
0x40240770 <start_thread+1136>: cmpb,=,n r24,r21,0x40240758 <start_thread+1112>
0x40240774 <start_thread+1140>: nop
0x40240778 <start_thread+1144>: ldi -2d,r25
0x4024077c <start_thread+1148>: cmpb,=,n r25,r21,0x40240758 <start_thread+1112>
0x40240780 <start_thread+1152>: nop
0x40240784 <start_thread+1156>: stw ret0,-1b8(sp)
0x40240788 <start_thread+1160>: sub r0,r21,r21
0x4024078c <start_thread+1164>: stw r21,-1b4(sp)
0x40240790 <start_thread+1168>: ldw -1b4(sp),ret1
0x40240794 <start_thread+1172>: cmpib,=,n e,ret1,0x40240804 <start_thread+1284>
0x40240798 <start_thread+1176>: ldw -1b4(sp),ret0
0x4024079c <start_thread+1180>: cmpb,=,n r5,ret0,0x40240804 <start_thread+1284>
0x402407a0 <start_thread+1184>: ldw -1b8(sp),ret0
0x402407a4 <start_thread+1188>: cmpb,<> ret0,rp,0x40240754 <start_thread+1108>

Thread 2 is in a loop calling the lws code.

(gdb) p/x $rp
$5 = 0x0
(gdb) p/x $ret0
$6 = 0x42169480

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

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

* Re: futex wait failure
  2010-01-01  3:49             ` John David Anglin
  2010-01-01  5:02               ` John David Anglin
@ 2010-01-04 16:27               ` Helge Deller
  2010-01-04 17:16                 ` Carlos O'Donell
                                   ` (2 more replies)
  1 sibling, 3 replies; 194+ messages in thread
From: Helge Deller @ 2010-01-04 16:27 UTC (permalink / raw)
  To: John David Anglin; +Cc: linux-parisc, dave.anglin, carlos

> > I tested the patch and the testcase in
> > http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D561203
> > still segfaults.
>=20
> I think the expect/tcl bug and the bug 561203 are related.  Looking
> at the minifail core dump, I see:
>=20
> Core was generated by `./minifail'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x00000000 in ?? ()
>=20
> So, how did we get to 0?  $rp is 0, so we might have executed a
> return to this location.  $r31 conains 0x4157cc4f.
>=20
> (gdb) disass 0x4157cc3c 0x4157cc5c
> Dump of assembler code from 0x4157cc3c to 0x4157cc5c:
> 0x4157cc3c <_IO_puts+332>:      copy rp,r25
> 0x4157cc40 <_IO_puts+336>:      copy r6,r24
> 0x4157cc44 <_IO_puts+340>:      be,l b0(sr2,r0),sr0,r31
> 0x4157cc48 <_IO_puts+344>:      ldi 0,r20
> 0x4157cc4c <_IO_puts+348>:      ldi -b,r24
> 0x4157cc50 <_IO_puts+352>:      cmpb,=3D,n r24,r21,0x4157cc38 <_IO_pu=
ts+328>
> 0x4157cc54 <_IO_puts+356>:      nop
> 0x4157cc58 <_IO_puts+360>:      ldi -2d,r25


I think I have an idea what could have happened and why it most of the =
times (but not always) crashes in the child process...

In ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h we have:
#define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
  ({                                                                   =
 \
     volatile int lws_errno;                                           =
 \
     volatile int lws_ret;                                             =
 \
     asm volatile(                                                     =
 \
=2E..some assembly...
        "stw    %%r28, %0                       \n\t"                  =
 \
        "sub    %%r0, %%r21, %%r21              \n\t"                  =
 \
        "stw    %%r21, %1                       \n\t"                  =
 \
        : "=3Dm" (lws_ret), "=3Dm" (lws_errno)                         =
     \
        : "r" (mem), "r" (oldval), "r" (newval)                        =
 \
        : _LWS_CLOBBER          =20

this means, that lws_errno and lws_ret are located on the stack.

With gdb I see this expanded to:
0x40705494 <start_thread+1204>: stw ret0,-1b8(sp)
0x40705498 <start_thread+1208>: sub r0,r21,r21
0x4070549c <start_thread+1212>: stw r21,-1b4(sp)

So, lws_ret/lws_errno are at -1b8/-1b4(sp).

And this LWS code is called from=20
=2E./nptl/sysdeps/pthread/createthread.c:
static int create_thread (struct pthread *pd, const struct pthread_attr=
 *attr, STACK_VARIABLES_PARMS)
=2E..
          int res =3D do_clone (pd, attr, clone_flags, start_thread,
                              STACK_VARIABLES_ARGS, 1);
          if (res =3D=3D 0)
            {
=2E..(line 216):
              /* Enqueue the descriptor.  */
              do
                pd->nextevent =3D __nptl_last_event;
              while (atomic_compare_and_exchange_bool_acq(&__nptl_last_=
event, pd, pd->nextevent) !=3D 0);


And here is what could have happened:
a) do_clone() creates the child process.
b) the child process gets a new stack
c) the child calls atomic_compare_and_exchange_bool_acq() and thus the =
LWS code above.
d) the LWS code writes to the stack location at -1b8(sp), which is out =
of bounds for the child process (the child stack got only ~ 0x40 bytes =
initial room)
e) Thus the child either crashes, overwrites memory of the parent or do=
es other things wrong.

Additionally:
Due to the LWS assembly code and because we don't have many registers f=
ree while using LWS, gcc used %rp as a temporary register which may hav=
e fooled us in our thinking?

0x40705458 <start_thread+1144>: ldi 0,rp
0x4070545c <start_thread+1148>: ldi fb,r3
0x40705460 <start_thread+1152>: ldw -70(sp),ret0
0x40705464 <start_thread+1156>: ldw 214(ret0),ret1
0x40705468 <start_thread+1160>: copy r5,r26
0x4070546c <start_thread+1164>: copy ret1,r25
0x40705470 <start_thread+1168>: copy rp,r24
0x40705474 <start_thread+1172>: be,l b0(sr2,r0),sr0,r31
0x40705478 <start_thread+1176>: ldi 0,r20
0x4070547c <start_thread+1180>: ldi -b,r24
0x40705480 <start_thread+1184>: cmpb,=3D,n r24,r21,0x40705468 <start_th=
read+1160>
0x40705484 <start_thread+1188>: nop
0x40705488 <start_thread+1192>: ldi -2d,r25
0x4070548c <start_thread+1196>: cmpb,=3D,n r25,r21,0x40705468 <start_th=
read+1160>
0x40705490 <start_thread+1200>: nop
0x40705494 <start_thread+1204>: stw ret0,-1b8(sp)
0x40705498 <start_thread+1208>: sub r0,r21,r21
0x4070549c <start_thread+1212>: stw r21,-1b4(sp)
0x407054a0 <start_thread+1216>: ldw -1b4(sp),ret0


If my assumptions are correct, then we either could

a) use the gcc atomic builtins instead of own atomic code in libc6:
E.g: add to ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h:
=2E..
#if __GNUC_PREREQ (4, 1)
# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
  __sync_val_compare_and_swap (mem, oldval, newval)
#  define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
  (! __sync_bool_compare_and_swap (mem, oldval, newval))

#elif __ASSUME_LWS_CAS
=2E...

b) change the assembly in=20
atomic_compare_and_exchange_val_acq()
to not put it's local variables (lws_errno and lws_ret) on the stack.

I'm currently testing option a).

Helge
(PS: I used a webmailer, so the indenting might be strange...)
--=20
GRATIS f=FCr alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2010-01-04 16:27               ` Helge Deller
@ 2010-01-04 17:16                 ` Carlos O'Donell
  2010-01-04 18:11                   ` John David Anglin
  2010-01-04 17:32                 ` John David Anglin
  2010-01-04 21:24                 ` Helge Deller
  2 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2010-01-04 17:16 UTC (permalink / raw)
  To: Helge Deller; +Cc: John David Anglin, linux-parisc, dave.anglin

On Mon, Jan 4, 2010 at 11:27 AM, Helge Deller <deller@gmx.de> wrote:
> I think I have an idea what could have happened and why it most of th=
e times (but not always) crashes in the child process...
>
> In ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h we have:
> #define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
> =A0({ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
\
> =A0 =A0 volatile int lws_errno; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\
> =A0 =A0 volatile int lws_ret; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\
> =A0 =A0 asm volatile( =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\
> ...some assembly...
> =A0 =A0 =A0 =A0"stw =A0 =A0%%r28, %0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 \n\t" =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 \
> =A0 =A0 =A0 =A0"sub =A0 =A0%%r0, %%r21, %%r21 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0\n\t" =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 \
> =A0 =A0 =A0 =A0"stw =A0 =A0%%r21, %1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 \n\t" =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 \
> =A0 =A0 =A0 =A0: "=3Dm" (lws_ret), "=3Dm" (lws_errno) =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0\
> =A0 =A0 =A0 =A0: "r" (mem), "r" (oldval), "r" (newval) =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 \
> =A0 =A0 =A0 =A0: _LWS_CLOBBER
>
> this means, that lws_errno and lws_ret are located on the stack.

Correct. We could place them in registers if we wanted, they are
registers r28 (lws return) and r21 (lws error).

> With gdb I see this expanded to:
> 0x40705494 <start_thread+1204>: stw ret0,-1b8(sp)
> 0x40705498 <start_thread+1208>: sub r0,r21,r21
> 0x4070549c <start_thread+1212>: stw r21,-1b4(sp)
>
> So, lws_ret/lws_errno are at -1b8/-1b4(sp).

Correct.

> And this LWS code is called from
> ../nptl/sysdeps/pthread/createthread.c:
> static int create_thread (struct pthread *pd, const struct pthread_at=
tr *attr, STACK_VARIABLES_PARMS)
> ...
> =A0 =A0 =A0 =A0 =A0int res =3D do_clone (pd, attr, clone_flags, start=
_thread,
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0STACK_VARI=
ABLES_ARGS, 1);
> =A0 =A0 =A0 =A0 =A0if (res =3D=3D 0)
> =A0 =A0 =A0 =A0 =A0 =A0{
> ...(line 216):
> =A0 =A0 =A0 =A0 =A0 =A0 =A0/* Enqueue the descriptor. =A0*/
> =A0 =A0 =A0 =A0 =A0 =A0 =A0do
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0pd->nextevent =3D __nptl_last_event;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0while (atomic_compare_and_exchange_bool_ac=
q(&__nptl_last_event, pd, pd->nextevent) !=3D 0);
>
>
> And here is what could have happened:
> a) do_clone() creates the child process.
> b) the child process gets a new stack
> c) the child calls atomic_compare_and_exchange_bool_acq() and thus th=
e LWS code above.
> d) the LWS code writes to the stack location at -1b8(sp), which is ou=
t of bounds for the child process (the child stack got only ~ 0x40 byte=
s initial room)

This is wrong. Each thread should have 8MB of stack. If we only get ~
0x40 bytes then npt/nptl-init.c is setting __default_stacksize
incorrectly.

Even PTHREAD_STACK_MIN should be 16kb?

Could you verify that your assertion that only ~ 0x40 bytes of initial
room were allocated?

> e) Thus the child either crashes, overwrites memory of the parent or =
does other things wrong.

I agree with your analysis, but the error is that more stack should be
allocated.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2010-01-04 16:27               ` Helge Deller
  2010-01-04 17:16                 ` Carlos O'Donell
@ 2010-01-04 17:32                 ` John David Anglin
  2010-01-04 18:02                   ` Carlos O'Donell
  2010-01-04 21:24                 ` Helge Deller
  2 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2010-01-04 17:32 UTC (permalink / raw)
  To: Helge Deller; +Cc: linux-parisc, dave.anglin, carlos

> I think I have an idea what could have happened and why it most of the times (but not always) crashes in the child process...
> 
> In ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h we have:
> #define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
>   ({                                                                    \
>      volatile int lws_errno;                                            \
>      volatile int lws_ret;                                              \
>      asm volatile(                                                      \
> ...some assembly...
>         "stw    %%r28, %0                       \n\t"                   \
>         "sub    %%r0, %%r21, %%r21              \n\t"                   \
>         "stw    %%r21, %1                       \n\t"                   \
>         : "=m" (lws_ret), "=m" (lws_errno)                              \
>         : "r" (mem), "r" (oldval), "r" (newval)                         \
>         : _LWS_CLOBBER           
> 
> this means, that lws_errno and lws_ret are located on the stack.
> 
> With gdb I see this expanded to:
> 0x40705494 <start_thread+1204>: stw ret0,-1b8(sp)
> 0x40705498 <start_thread+1208>: sub r0,r21,r21
> 0x4070549c <start_thread+1212>: stw r21,-1b4(sp)
> 
> So, lws_ret/lws_errno are at -1b8/-1b4(sp).
> 
> And this LWS code is called from 
> ../nptl/sysdeps/pthread/createthread.c:
> static int create_thread (struct pthread *pd, const struct pthread_attr *attr, STACK_VARIABLES_PARMS)
> ...
>           int res = do_clone (pd, attr, clone_flags, start_thread,
>                               STACK_VARIABLES_ARGS, 1);
>           if (res == 0)
>             {
> ...(line 216):
>               /* Enqueue the descriptor.  */
>               do
>                 pd->nextevent = __nptl_last_event;
>               while (atomic_compare_and_exchange_bool_acq(&__nptl_last_event, pd, pd->nextevent) != 0);
> 
> 
> And here is what could have happened:
> a) do_clone() creates the child process.
> b) the child process gets a new stack
> c) the child calls atomic_compare_and_exchange_bool_acq() and thus the LWS code above.
> d) the LWS code writes to the stack location at -1b8(sp), which is out of bounds for the child process (the child stack got only ~ 0x40 bytes initial room)

I think the stack locations should be ok because start_thread allocates
an additional 0x1c0 bytes:

Dump of assembler code for function start_thread:
   0x40a40300 <+0>:     stw rp,-14(sp)
   0x40a40304 <+4>:     ldo 1c0(sp),sp

In all the fails I have looked at, the saved $rp value is clobbered.
The stack pointer value seems consistent with 0x40 + 0x1c0.  The data
placed at the beginning of the stack for the child thread is not clobbered.

> e) Thus the child either crashes, overwrites memory of the parent or does other things wrong.

I don't see how the forked child can affect the memory of the parent.
It can close files and affect the parent that way (child should use
_exit and not exit).

If the forked child actually overwrites memory of the parent, this is
a big bug in the linux fork code.

> Additionally:
> Due to the LWS assembly code and because we don't have many registers free while using LWS, gcc used %rp as a temporary register which may have fooled us in our thinking?

$rp is saved in the first instruction of start_thread.  So, its use
below should be ok.

> 0x40705458 <start_thread+1144>: ldi 0,rp
> 0x4070545c <start_thread+1148>: ldi fb,r3
> 0x40705460 <start_thread+1152>: ldw -70(sp),ret0
> 0x40705464 <start_thread+1156>: ldw 214(ret0),ret1
> 0x40705468 <start_thread+1160>: copy r5,r26
> 0x4070546c <start_thread+1164>: copy ret1,r25
> 0x40705470 <start_thread+1168>: copy rp,r24
> 0x40705474 <start_thread+1172>: be,l b0(sr2,r0),sr0,r31
> 0x40705478 <start_thread+1176>: ldi 0,r20
> 0x4070547c <start_thread+1180>: ldi -b,r24
> 0x40705480 <start_thread+1184>: cmpb,=,n r24,r21,0x40705468 <start_thread+1160>
> 0x40705484 <start_thread+1188>: nop
> 0x40705488 <start_thread+1192>: ldi -2d,r25
> 0x4070548c <start_thread+1196>: cmpb,=,n r25,r21,0x40705468 <start_thread+1160>
> 0x40705490 <start_thread+1200>: nop
> 0x40705494 <start_thread+1204>: stw ret0,-1b8(sp)
> 0x40705498 <start_thread+1208>: sub r0,r21,r21
> 0x4070549c <start_thread+1212>: stw r21,-1b4(sp)
> 0x407054a0 <start_thread+1216>: ldw -1b4(sp),ret0
> 
> 
> If my assumptions are correct, then we either could
> 
> a) use the gcc atomic builtins instead of own atomic code in libc6:
> E.g: add to ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h:
> ...
> #if __GNUC_PREREQ (4, 1)
> # define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
>   __sync_val_compare_and_swap (mem, oldval, newval)
> #  define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
>   (! __sync_bool_compare_and_swap (mem, oldval, newval))
> 
> #elif __ASSUME_LWS_CAS
> ....

There may be a bug in the gcc atomic builtins.  We shanged recently
to using the sync builtins in libstdc++.  Then, two fails appeared
recently that I haven't had time to look at:

WARNING: program timed out.
FAIL: 29_atomics/atomic_flag/clear/1.c execution test
FAIL: 29_atomics/atomic_flag/test_and_set/explicit.c execution test

That said, this is an interesting test.  Does it fix minifail?

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

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

* Re: futex wait failure
  2010-01-04 17:32                 ` John David Anglin
@ 2010-01-04 18:02                   ` Carlos O'Donell
  2010-01-04 18:22                     ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2010-01-04 18:02 UTC (permalink / raw)
  To: John David Anglin; +Cc: Helge Deller, linux-parisc, dave.anglin

On Mon, Jan 4, 2010 at 12:32 PM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
>> e) Thus the child either crashes, overwrites memory of the parent or does other things wrong.
>
> I don't see how the forked child can affect the memory of the parent.
> It can close files and affect the parent that way (child should use
> _exit and not exit).
>
> If the forked child actually overwrites memory of the parent, this is
> a big bug in the linux fork code.

We have two bugs that are getting mixed here.

Your original post has to do with a futex wait failure, this is
possibly related to the hppa low level lock implementation. I am
updating the hppa implementation to see if I can fix this for you.

Helge's comments relate only to the vfork crash, and the Qt thread
creation issue being seen by debian.

Cheers,
Carlos.

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

* Re: futex wait failure
  2010-01-04 17:16                 ` Carlos O'Donell
@ 2010-01-04 18:11                   ` John David Anglin
  2010-01-04 18:29                     ` John David Anglin
  2010-01-04 20:51                     ` Helge Deller
  0 siblings, 2 replies; 194+ messages in thread
From: John David Anglin @ 2010-01-04 18:11 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: Helge Deller, linux-parisc, dave.anglin

On Mon, 04 Jan 2010, Carlos O'Donell wrote:

> On Mon, Jan 4, 2010 at 11:27 AM, Helge Deller <deller@gmx.de> wrote:
> This is wrong. Each thread should have 8MB of stack. If we only get ~
> 0x40 bytes then npt/nptl-init.c is setting __default_stacksize
> incorrectly.

The 0x40 bytes is the initial frame allocated for clone running in
the child thread.   The code is not running out of stack space.

> Even PTHREAD_STACK_MIN should be 16kb?
> 
> Could you verify that your assertion that only ~ 0x40 bytes of initial
> room were allocated?
> 
> > e) Thus the child either crashes, overwrites memory of the parent or does other things wrong.
> 
> I agree with your analysis, but the error is that more stack should be
> allocated.

I don't follow that conclusion.  The stack grows upward and the stack
pointer isn't out of range.   The fork operation is somehow
corrupting the stack memory of the thread created by pthread_create.
I would say the parent is corrupting its own memory.  I doubt the
forked child is affecting the parent.  Fork would have to behave like
vfork to do this.  I have seen the pthread_create thread fail before
the clone syscall of the following fork.

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

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

* Re: futex wait failure
  2010-01-04 18:02                   ` Carlos O'Donell
@ 2010-01-04 18:22                     ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2010-01-04 18:22 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: Helge Deller, linux-parisc, dave.anglin

On Mon, 04 Jan 2010, Carlos O'Donell wrote:

> On Mon, Jan 4, 2010 at 12:32 PM, John David Anglin
> <dave@hiauly1.hia.nrc.ca> wrote:
> >> e) Thus the child either crashes, overwrites memory of the parent or does other things wrong.
> >
> > I don't see how the forked child can affect the memory of the parent.
> > It can close files and affect the parent that way (child should use
> > _exit and not exit).
> >
> > If the forked child actually overwrites memory of the parent, this is
> > a big bug in the linux fork code.
> 
> We have two bugs that are getting mixed here.
> 
> Your original post has to do with a futex wait failure, this is
> possibly related to the hppa low level lock implementation. I am
> updating the hppa implementation to see if I can fix this for you.
> 
> Helge's comments relate only to the vfork crash, and the Qt thread
> creation issue being seen by debian.

I was talking about the debian thread creation bug in the above.
I haven't been able to duplicate the vfork crash that you posted.
The expect/tcl futex bug is likely related to the debian bug (this
is what expect does in testsuite runs).  Reduced minifail testcase
is below.

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

#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

/*
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561203

  clone(child_stack=0x4088d040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x4108c4e8, tls=0x4108c900, child_tidptr=0x4108c4e8) = 14819
[pid 14819] set_robust_list(0x4108c4f0, 0xc) = 0
[pid 14818] clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x40002028) = 14820

 g++  minifail.cpp -o minifail -O0 -pthread -g

 i=0; while true; do i=$(($i+1)); echo Run $i; ./minifail; done;

 */
void* thread_run(void* arg) {
	write(1,"Thread OK.\n",11);
}

int pure_test() {
	pthread_t thread;
	pthread_create(&thread, NULL, thread_run, NULL);

	switch (fork()) {
		case -1:
			perror("fork() failed");
		case 0:
			write(1,"Child OK.\n",10);
			_exit(0);
		default:
			break;
		
	}
	
	pthread_join(thread, NULL);
	return 0;
}

int main(int argc, char** argv) {
	return pure_test();
}

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

* Re: futex wait failure
  2010-01-04 18:11                   ` John David Anglin
@ 2010-01-04 18:29                     ` John David Anglin
  2010-01-04 20:51                     ` Helge Deller
  1 sibling, 0 replies; 194+ messages in thread
From: John David Anglin @ 2010-01-04 18:29 UTC (permalink / raw)
  To: dave.anglin; +Cc: carlos, deller, linux-parisc

> On Mon, 04 Jan 2010, Carlos O'Donell wrote:
> 
> > On Mon, Jan 4, 2010 at 11:27 AM, Helge Deller <deller@gmx.de> wrote:
> > This is wrong. Each thread should have 8MB of stack. If we only get ~
> > 0x40 bytes then npt/nptl-init.c is setting __default_stacksize
> > incorrectly.
> 
> The 0x40 bytes is the initial frame allocated for clone running in
> the child thread.   The code is not running out of stack space.

If only 0x40 bytes of stack were allocated, start_thread would fault
almost immediately:

Dump of assembler code for function start_thread:
   0x40a40300 <+0>:     stw rp,-14(sp)
   0x40a40304 <+4>:     ldo 1c0(sp),sp
   0x40a40308 <+8>:     ldo 274(r26),r21
   0x40a4030c <+12>:    stw r9,-6c(sp)

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

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

* Re: futex wait failure
  2010-01-04 18:11                   ` John David Anglin
  2010-01-04 18:29                     ` John David Anglin
@ 2010-01-04 20:51                     ` Helge Deller
  2010-01-04 21:39                       ` John David Anglin
  2010-01-05 22:27                       ` John David Anglin
  1 sibling, 2 replies; 194+ messages in thread
From: Helge Deller @ 2010-01-04 20:51 UTC (permalink / raw)
  To: John David Anglin; +Cc: John David Anglin, Carlos O'Donell, linux-parisc

On 01/04/2010 07:11 PM, John David Anglin wrote:
> On Mon, 04 Jan 2010, Carlos O'Donell wrote:
>
>> On Mon, Jan 4, 2010 at 11:27 AM, Helge Deller<deller@gmx.de>  wrote:
>> This is wrong. Each thread should have 8MB of stack. If we only get ~
>> 0x40 bytes then npt/nptl-init.c is setting __default_stacksize
>> incorrectly.
>
> The 0x40 bytes is the initial frame allocated for clone running in
> the child thread.   The code is not running out of stack space.

Hmmm...

strace on minifail (as attached to Dave's mail) gives me:

getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
mmap(NULL, 8388608, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4076d000
brk(0)                                  = 0x12000
brk(0x33000)                            = 0x33000
mprotect(0x40f6b000, 4096, PROT_NONE)   = 0
clone(Process 1684 attached (waiting for parent)
Process 1684 resumed (parent 1683 ready)
child_stack=0x4076d040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x40f6c4e8, tls=0x40f6c900, child_tidptr=0x40f6c4e8) = 1684

The mmap() allocates and maps the new child stack -> at 0x4076d000
The clone() syscall is called with child_stack=0x4076d040

I might be wrong, but that's the 0x40 bytes I mentioned.
  
>> Even PTHREAD_STACK_MIN should be 16kb?

The example above allocates 8MB.
But my point is, that child_stack starts at 0x4076d040, and
that LWS (in the child process with the stack as given above) tries to
store something to an address lower than 0x4076d000.

>> Could you verify that your assertion that only ~ 0x40 bytes of initial
>> room were allocated?
>>
>>> e) Thus the child either crashes, overwrites memory of the parent or does other things wrong.
>>
>> I agree with your analysis, but the error is that more stack should be
>> allocated.

Not more stack.
Just increasing the 0x40 initial byte offset, but that's IMHO a hack...

> I don't follow that conclusion.  The stack grows upward and the stack
> pointer isn't out of range.   The fork operation is somehow
> corrupting the stack memory of the thread created by pthread_create.
> I would say the parent is corrupting its own memory.  I doubt the
> forked child is affecting the parent.  Fork would have to behave like
> vfork to do this.  I have seen the pthread_create thread fail before
> the clone syscall of the following fork.

Doesn't pthread_create() created processes share the memory with
their parents? In that case, the child can crash or even overwrite memory
of the parent process...?

Helge

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

* Re: futex wait failure
  2010-01-04 16:27               ` Helge Deller
  2010-01-04 17:16                 ` Carlos O'Donell
  2010-01-04 17:32                 ` John David Anglin
@ 2010-01-04 21:24                 ` Helge Deller
  2 siblings, 0 replies; 194+ messages in thread
From: Helge Deller @ 2010-01-04 21:24 UTC (permalink / raw)
  To: John David Anglin; +Cc: linux-parisc, dave.anglin, carlos

On 01/04/2010 05:27 PM, Helge Deller wrote:
> If my assumptions are correct, then we either could
>
> a) use the gcc atomic builtins instead of own atomic code in libc6:
> E.g: add to ports/sysdeps/unix/sysv/linux/hppa/bits/atomic.h:
> ...
> #if __GNUC_PREREQ (4, 1)
> # define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
>    __sync_val_compare_and_swap (mem, oldval, newval)
> #  define atomic_compare_and_exchange_bool_acq(mem, newval, oldval) \
>    (! __sync_bool_compare_and_swap (mem, oldval, newval))
>
> #elif __ASSUME_LWS_CAS
> ....


Even with this change, minifail sadly still segfaults :-(

Helge

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

* Re: futex wait failure
  2010-01-04 20:51                     ` Helge Deller
@ 2010-01-04 21:39                       ` John David Anglin
  2010-01-05 22:27                       ` John David Anglin
  1 sibling, 0 replies; 194+ messages in thread
From: John David Anglin @ 2010-01-04 21:39 UTC (permalink / raw)
  To: Helge Deller; +Cc: dave.anglin, carlos, linux-parisc

> On 01/04/2010 07:11 PM, John David Anglin wrote:
> > On Mon, 04 Jan 2010, Carlos O'Donell wrote:
> >
> >> On Mon, Jan 4, 2010 at 11:27 AM, Helge Deller<deller@gmx.de>  wrote:
> >> This is wrong. Each thread should have 8MB of stack. If we only get ~
> >> 0x40 bytes then npt/nptl-init.c is setting __default_stacksize
> >> incorrectly.
> >
> > The 0x40 bytes is the initial frame allocated for clone running in
> > the child thread.   The code is not running out of stack space.
> 
> Hmmm...
> 
> strace on minifail (as attached to Dave's mail) gives me:
> 
> getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0
> mmap(NULL, 8388608, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4076d000
> brk(0)                                  = 0x12000
> brk(0x33000)                            = 0x33000
> mprotect(0x40f6b000, 4096, PROT_NONE)   = 0
> clone(Process 1684 attached (waiting for parent)
> Process 1684 resumed (parent 1683 ready)
> child_stack=0x4076d040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x40f6c4e8, tls=0x40f6c900, child_tidptr=0x40f6c4e8) = 1684
> 
> The mmap() allocates and maps the new child stack -> at 0x4076d000
> The clone() syscall is called with child_stack=0x4076d040

So, in this case, start_thread will be called with $sp = 0x4076d040.
The second instruction of start_thread increments $sp by 0x1c0.

> 
> I might be wrong, but that's the 0x40 bytes I mentioned.
>   
> >> Even PTHREAD_STACK_MIN should be 16kb?
> 
> The example above allocates 8MB.
> But my point is, that child_stack starts at 0x4076d040, and
> that LWS (in the child process with the stack as given above) tries to
> store something to an address lower than 0x4076d000.

This would be bad.  However, the LWS calls are in "start_thread", so
it didn't appear that the stack offsets that you mentioned were out
of range.  GCC would be terribly broken if it got these offsets wrong
in general.

> >> Could you verify that your assertion that only ~ 0x40 bytes of initial
> >> room were allocated?
> >>
> >>> e) Thus the child either crashes, overwrites memory of the parent or does other things wrong.
> >>
> >> I agree with your analysis, but the error is that more stack should be
> >> allocated.
> 
> Not more stack.
> Just increasing the 0x40 initial byte offset, but that's IMHO a hack...
> 
> > I don't follow that conclusion.  The stack grows upward and the stack
> > pointer isn't out of range.   The fork operation is somehow
> > corrupting the stack memory of the thread created by pthread_create.
> > I would say the parent is corrupting its own memory.  I doubt the
> > forked child is affecting the parent.  Fork would have to behave like
> > vfork to do this.  I have seen the pthread_create thread fail before
> > the clone syscall of the following fork.
> 
> Doesn't pthread_create() created processes share the memory with
> their parents? In that case, the child can crash or even overwrite memory
> of the parent process...?

We have to be careful about semantics.  The child of the fork runs
in a different address space, so it is unlikely that it can corrupt
the parent directly.  It is true that the child inherits all the
pthread mutexs and the thread context of the thread which called fork.
The child could close the file descriptors of the parent.  It could
affect any context that is stored in the kernel.

The fork call is involved in this bug.  I have verified that the faults
don't occur if it is removed.  The faults don't occur if a sleep(1) call
is added between the pthread_create and fork calls.

I think the parent thread is corrupting the stack of the child thread
created by pthread_create, but I don't know how this happens.  I have
seen at least one case where this corruption occurs prior to the system
clone call for the fork.  I think we must have some kind of lock
failure which is timing dependent (i.e., the scheduling of the parent
and child threads).

I thought this likely indicated the lws code wasn't atomic.  We don't
allow schedule to run if we are on the gateway page.  I'm starting
to wonder if threads (not processes) are still being scheduled.

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

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

* Re: futex wait failure
  2010-01-04 20:51                     ` Helge Deller
  2010-01-04 21:39                       ` John David Anglin
@ 2010-01-05 22:27                       ` John David Anglin
  2010-01-06 23:33                         ` John David Anglin
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2010-01-05 22:27 UTC (permalink / raw)
  To: Helge Deller; +Cc: dave.anglin, carlos, linux-parisc

> clone(Process 1684 attached (waiting for parent)
> Process 1684 resumed (parent 1683 ready)
> child_stack=0x4076d040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x40f6c4e8, tls=0x40f6c900, child_tidptr=0x40f6c4e8) = 1684

I noticed the tidptr for the fork may not be correct:

clone(child_stack=0x40e87040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x416864e8, tls=0x41686900, child_tidptr=0x416864e8) = 31613
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x40002028) = 31614

I would have thought the value should have been the same as that in the
clone from the pthread_create call.

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

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

* Re: futex wait failure
  2010-01-05 22:27                       ` John David Anglin
@ 2010-01-06 23:33                         ` John David Anglin
  2010-01-07 16:13                           ` Helge Deller
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2010-01-06 23:33 UTC (permalink / raw)
  To: John David Anglin; +Cc: deller, dave.anglin, carlos, linux-parisc

> > clone(Process 1684 attached (waiting for parent)
> > Process 1684 resumed (parent 1683 ready)
> > child_stack=0x4076d040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x40f6c4e8, tls=0x40f6c900, child_tidptr=0x40f6c4e8) = 1684
> 
> I noticed the tidptr for the fork may not be correct:
> 
> clone(child_stack=0x40e87040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x416864e8, tls=0x41686900, child_tidptr=0x416864e8) = 31613
> clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x40002028) = 31614
> 
> I would have thought the value should have been the same as that in the
> clone from the pthread_create call.

It's possible that this is done intentionally...  The parent_tidptr
is the one that's wrong in the first clone.

I have noticed something else in the minifail kernel register dumps:

Jan  6 15:54:05 hiauly6 kernel: sr00-03  00000024 0000001b 00000000 00000024
Jan  6 15:54:05 hiauly6 kernel: sr04-07  00000024 00000024 00000024 00000024

sr1 seems to contain an odd value.  This seems to be the case in all
minifail register dumps.  I checked that the sr1 value doesn't belong
to the child of the fork call.  This might indicate a tlb/cache issue
as sr1 is used for these operations.

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

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

* Re: futex wait failure
  2010-01-06 23:33                         ` John David Anglin
@ 2010-01-07 16:13                           ` Helge Deller
  2010-01-08 16:37                             ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Helge Deller @ 2010-01-07 16:13 UTC (permalink / raw)
  To: John David Anglin; +Cc: dave.anglin, carlos, linux-parisc

On 01/07/2010 12:33 AM, John David Anglin wrote:
>>> clone(Process 1684 attached (waiting for parent)
>>> Process 1684 resumed (parent 1683 ready)
>>> child_stack=0x4076d040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x40f6c4e8, tls=0x40f6c900, child_tidptr=0x40f6c4e8) = 1684
>>
>> I noticed the tidptr for the fork may not be correct:
>>
>> clone(child_stack=0x40e87040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x416864e8, tls=0x41686900, child_tidptr=0x416864e8) = 31613
>> clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x40002028) = 31614
>>
>> I would have thought the value should have been the same as that in the
>> clone from the pthread_create call.
>
> It's possible that this is done intentionally...  The parent_tidptr
> is the one that's wrong in the first clone.
>
> I have noticed something else in the minifail kernel register dumps:
>
> Jan  6 15:54:05 hiauly6 kernel: sr00-03  00000024 0000001b 00000000 00000024
> Jan  6 15:54:05 hiauly6 kernel: sr04-07  00000024 00000024 00000024 00000024
>
> sr1 seems to contain an odd value.  This seems to be the case in all
> minifail register dumps.

IIRC, for me most crashes had sr1=0. Only a very few had sr1 != 0.

> I checked that the sr1 value doesn't belong
> to the child of the fork call.  This might indicate a tlb/cache issue
> as sr1 is used for these operations.

Helge

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

* Re: futex wait failure
  2010-01-07 16:13                           ` Helge Deller
@ 2010-01-08 16:37                             ` John David Anglin
  2010-01-08 21:17                               ` John David Anglin
  2010-01-08 21:18                               ` Helge Deller
  0 siblings, 2 replies; 194+ messages in thread
From: John David Anglin @ 2010-01-08 16:37 UTC (permalink / raw)
  To: Helge Deller; +Cc: dave.anglin, carlos, linux-parisc

> 
> On 01/07/2010 12:33 AM, John David Anglin wrote:
> >>> clone(Process 1684 attached (waiting for parent)
> >>> Process 1684 resumed (parent 1683 ready)
> >>> child_stack=0x4076d040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x40f6c4e8, tls=0x40f6c900, child_tidptr=0x40f6c4e8) = 1684
> >>
> >> I noticed the tidptr for the fork may not be correct:
> >>
> >> clone(child_stack=0x40e87040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x416864e8, tls=0x41686900, child_tidptr=0x416864e8) = 31613
> >> clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x40002028) = 31614
> >>
> >> I would have thought the value should have been the same as that in the
> >> clone from the pthread_create call.
> >
> > It's possible that this is done intentionally...  The parent_tidptr
> > is the one that's wrong in the first clone.

I now think this probably is a glibc bug.  The kernel uses this value
when the CLONE_PARENT_SETTID flag is passed.

> > I have noticed something else in the minifail kernel register dumps:
> >
> > Jan  6 15:54:05 hiauly6 kernel: sr00-03  00000024 0000001b 00000000 00000024
> > Jan  6 15:54:05 hiauly6 kernel: sr04-07  00000024 00000024 00000024 00000024
> >
> > sr1 seems to contain an odd value.  This seems to be the case in all
> > minifail register dumps.
> 
> IIRC, for me most crashes had sr1=0. Only a very few had sr1 != 0.
> 
> > I checked that the sr1 value doesn't belong
> > to the child of the fork call.  This might indicate a tlb/cache issue
> > as sr1 is used for these operations.

I added some loops in the parent and child threads.  I also added code
in the child thread to watch the return point location on the stack
for start_thread.  What I found is the stack gets overwritten after
the thread has started.  At the same time, the parent is looping
post fork.

So, the problem has to be with fork (i.e., its not with pthread_join
or pthread_exit).  Still think the problem involves sr1 (it's unusual
the sr1 contains a value that's not the user or kernel values).

I played with saving sr1 in some additional places (tlb and cache
flushing) but this didn't alter things.  Haven't played with pa_memcpy.

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

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

* Re: futex wait failure
  2010-01-08 16:37                             ` John David Anglin
@ 2010-01-08 21:17                               ` John David Anglin
  2010-02-02 21:16                                 ` Helge Deller
  2010-01-08 21:18                               ` Helge Deller
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2010-01-08 21:17 UTC (permalink / raw)
  To: John David Anglin; +Cc: deller, dave.anglin, carlos, linux-parisc

> I added some loops in the parent and child threads.  I also added code
> in the child thread to watch the return point location on the stack
> for start_thread.  What I found is the stack gets overwritten after
> the thread has started.  At the same time, the parent is looping
> post fork.

More debugging.  It seems bad news to have more than one clone
syscall active at a time.  The thread child may still be in the kernel
when the fork syscall is made by the parent.  The testcase doesn't
fail if the parent waits for the child thread to start.  See below.

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

#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

/*
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561203

  clone(child_stack=0x4088d040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x4108c4e8, tls=0x4108c900, child_tidptr=0x4108c4e8) = 14819
[pid 14819] set_robust_list(0x4108c4f0, 0xc) = 0
[pid 14818] clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x40002028) = 14820

 g++  minifail.cpp -o minifail -O0 -pthread -g

 i=0; while true; do i=$(($i+1)); echo Run $i; ./minifail; done;

 */

static volatile int run;

void* thread_run(void* arg) {
	static long status;
	int i;
        
	run = 1;
	pthread_yield();
	for (i = 10000000; i; i--)
	   continue;
	write(1,"Thread OK.\n",11);
	return (void *)&status;
}

int pure_test() {
	pthread_t thread;
	pthread_create(&thread, NULL, thread_run, NULL);

	while (!run)
	  continue;
	switch (fork()) {
		case -1:
			perror("fork() failed");
		case 0:
			write(1,"Child OK.\n",10);
			_exit(0);
		default:
			break;
		
	}
	pthread_join(thread, NULL);
	return 0;
}

int main(int argc, char** argv) {
	return pure_test();
}

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

* Re: futex wait failure
  2010-01-08 16:37                             ` John David Anglin
  2010-01-08 21:17                               ` John David Anglin
@ 2010-01-08 21:18                               ` Helge Deller
  2010-01-08 21:43                                 ` John David Anglin
  2010-01-08 21:44                                 ` Carlos O'Donell
  1 sibling, 2 replies; 194+ messages in thread
From: Helge Deller @ 2010-01-08 21:18 UTC (permalink / raw)
  To: John David Anglin; +Cc: dave.anglin, carlos, linux-parisc

On 01/08/2010 05:37 PM, John David Anglin wrote:
>>
>> On 01/07/2010 12:33 AM, John David Anglin wrote:
>>>>> clone(Process 1684 attached (waiting for parent)
>>>>> Process 1684 resumed (parent 1683 ready)
>>>>> child_stack=0x4076d040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x40f6c4e8, tls=0x40f6c900, child_tidptr=0x40f6c4e8) = 1684
>>>>
>>>> I noticed the tidptr for the fork may not be correct:
>>>>
>>>> clone(child_stack=0x40e87040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x416864e8, tls=0x41686900, child_tidptr=0x416864e8) = 31613
>>>> clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x40002028) = 31614
>>>>
>>>> I would have thought the value should have been the same as that in the
>>>> clone from the pthread_create call.
>>>
>>> It's possible that this is done intentionally...  The parent_tidptr
>>> is the one that's wrong in the first clone.
>
> I now think this probably is a glibc bug.  The kernel uses this value
> when the CLONE_PARENT_SETTID flag is passed.


Maybe we have a futex problem in glibc on hppa?
In glibc nptl/pthread_mutex_trylock.c we check the return value of a futex syscall against EWOULDBLOCK.
Since on parisc - in contrast to all other architectures - we have EWOULDBLOCK!=EAGAIN, we maybe missed a check?

Helge

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

* Re: futex wait failure
  2010-01-08 21:18                               ` Helge Deller
@ 2010-01-08 21:43                                 ` John David Anglin
  2010-01-08 21:44                                 ` Carlos O'Donell
  1 sibling, 0 replies; 194+ messages in thread
From: John David Anglin @ 2010-01-08 21:43 UTC (permalink / raw)
  To: Helge Deller; +Cc: dave.anglin, carlos, linux-parisc

> Maybe we have a futex problem in glibc on hppa?
> In glibc nptl/pthread_mutex_trylock.c we check the return value of a futex syscall against EWOULDBLOCK.
> Since on parisc - in contrast to all other architectures - we have EWOULDBLOCK!=EAGAIN, we maybe missed a check?

That's a very interesting observation!  The manpage doesn't say
EWOULDBLOCK is a valid error return for FUTEX(2).  I wonder is there
are more slips like this.  It looks like the same bug is present in
nptl/sysdeps/unix/sysv/linux/sem_wait.c and
nptl/sysdeps/unix/sysv/linux/sem_timedwait.c.

This might explain my previous mail.

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

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

* Re: futex wait failure
  2010-01-08 21:18                               ` Helge Deller
  2010-01-08 21:43                                 ` John David Anglin
@ 2010-01-08 21:44                                 ` Carlos O'Donell
  2010-01-08 21:44                                   ` Carlos O'Donell
  2010-01-16 23:17                                   ` Helge Deller
  1 sibling, 2 replies; 194+ messages in thread
From: Carlos O'Donell @ 2010-01-08 21:44 UTC (permalink / raw)
  To: Helge Deller; +Cc: John David Anglin, dave.anglin, linux-parisc

On Fri, Jan 8, 2010 at 4:18 PM, Helge Deller <deller@gmx.de> wrote:
>> I now think this probably is a glibc bug. =A0The kernel uses this va=
lue
>> when the CLONE_PARENT_SETTID flag is passed.
>
>
> Maybe we have a futex problem in glibc on hppa?
> In glibc nptl/pthread_mutex_trylock.c we check the return value of a =
futex
> syscall against EWOULDBLOCK.
> Since on parisc - in contrast to all other architectures - we have
> EWOULDBLOCK!=3DEAGAIN, we maybe missed a check?

That's a bug. There are several kernel paths that could return EAGAIN
*or* EWOULDBLOCK via the FUTEX_TRYLOCK_PI futex operation.

However, I think Dave is on to something with the

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2010-01-08 21:44                                 ` Carlos O'Donell
@ 2010-01-08 21:44                                   ` Carlos O'Donell
  2010-01-08 21:56                                     ` Kyle McMartin
  2010-01-08 22:31                                     ` John David Anglin
  2010-01-16 23:17                                   ` Helge Deller
  1 sibling, 2 replies; 194+ messages in thread
From: Carlos O'Donell @ 2010-01-08 21:44 UTC (permalink / raw)
  To: Helge Deller; +Cc: John David Anglin, dave.anglin, linux-parisc

On Fri, Jan 8, 2010 at 4:44 PM, Carlos O'Donell <carlos@systemhalted.or=
g> wrote:
> On Fri, Jan 8, 2010 at 4:18 PM, Helge Deller <deller@gmx.de> wrote:
>>> I now think this probably is a glibc bug. =A0The kernel uses this v=
alue
>>> when the CLONE_PARENT_SETTID flag is passed.
>>
>>
>> Maybe we have a futex problem in glibc on hppa?
>> In glibc nptl/pthread_mutex_trylock.c we check the return value of a=
 futex
>> syscall against EWOULDBLOCK.
>> Since on parisc - in contrast to all other architectures - we have
>> EWOULDBLOCK!=3DEAGAIN, we maybe missed a check?
>
> That's a bug. There are several kernel paths that could return EAGAIN
> *or* EWOULDBLOCK via the FUTEX_TRYLOCK_PI futex operation.
>
> However, I think Dave is on to something with the

=2E..kernel issue.

We might have *several* outstanding bugs :-)

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2010-01-08 21:44                                   ` Carlos O'Donell
@ 2010-01-08 21:56                                     ` Kyle McMartin
  2010-01-08 22:28                                       ` John David Anglin
  2010-01-08 22:31                                     ` John David Anglin
  1 sibling, 1 reply; 194+ messages in thread
From: Kyle McMartin @ 2010-01-08 21:56 UTC (permalink / raw)
  To: Carlos O'Donell
  Cc: Helge Deller, John David Anglin, dave.anglin, linux-parisc

On Fri, Jan 08, 2010 at 04:44:51PM -0500, Carlos O'Donell wrote:
> >
> > However, I think Dave is on to something with the
> 
> ...kernel issue.
> 
> We might have *several* outstanding bugs :-)
> 

Hrm. We discussed this on IRC a while ago, I can't remember what we
decided was the best approach... there's probably many many dragons
here.

I wonder what would break if we set any EAGAIN returns to EWOULDBLOCK in
the exit path.

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

* Re: futex wait failure
  2010-01-08 21:56                                     ` Kyle McMartin
@ 2010-01-08 22:28                                       ` John David Anglin
  2010-01-08 22:33                                         ` Kyle McMartin
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2010-01-08 22:28 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: carlos, deller, dave.anglin, linux-parisc

> On Fri, Jan 08, 2010 at 04:44:51PM -0500, Carlos O'Donell wrote:
> > >
> > > However, I think Dave is on to something with the
> > 
> > ...kernel issue.
> > 
> > We might have *several* outstanding bugs :-)
> > 
> 
> Hrm. We discussed this on IRC a while ago, I can't remember what we
> decided was the best approach... there's probably many many dragons
> here.
> 
> I wonder what would break if we set any EAGAIN returns to EWOULDBLOCK in
> the exit path.

That seems reversed.  x86_64 translates the system's EWOULDBLOCK error
into EAGAIN in sysdeps/unix/x86_64/sysdep.S.  However, don't know if this
impacts the futex and sem_wait checks.

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

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

* Re: futex wait failure
  2010-01-08 21:44                                   ` Carlos O'Donell
  2010-01-08 21:56                                     ` Kyle McMartin
@ 2010-01-08 22:31                                     ` John David Anglin
  1 sibling, 0 replies; 194+ messages in thread
From: John David Anglin @ 2010-01-08 22:31 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: deller, dave.anglin, linux-parisc

> On Fri, Jan 8, 2010 at 4:44 PM, Carlos O'Donell <carlos@systemhalted.org> w=
> rote:
> > On Fri, Jan 8, 2010 at 4:18 PM, Helge Deller <deller@gmx.de> wrote:
> >>> I now think this probably is a glibc bug. =A0The kernel uses this value
> >>> when the CLONE_PARENT_SETTID flag is passed.
> >>
> >>
> >> Maybe we have a futex problem in glibc on hppa?
> >> In glibc nptl/pthread_mutex_trylock.c we check the return value of a fut=
> ex
> >> syscall against EWOULDBLOCK.
> >> Since on parisc - in contrast to all other architectures - we have
> >> EWOULDBLOCK!=3DEAGAIN, we maybe missed a check?
> >
> > That's a bug. There are several kernel paths that could return EAGAIN
> > *or* EWOULDBLOCK via the FUTEX_TRYLOCK_PI futex operation.

Hacking glibc to check for both does not fix the testcase ;(

> > However, I think Dave is on to something with the
> 
> ...kernel issue.
> 
> We might have *several* outstanding bugs :-)

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

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

* Re: futex wait failure
  2010-01-08 22:28                                       ` John David Anglin
@ 2010-01-08 22:33                                         ` Kyle McMartin
  0 siblings, 0 replies; 194+ messages in thread
From: Kyle McMartin @ 2010-01-08 22:33 UTC (permalink / raw)
  To: John David Anglin
  Cc: Kyle McMartin, carlos, deller, dave.anglin, linux-parisc

On Fri, Jan 08, 2010 at 05:28:58PM -0500, John David Anglin wrote:
> > On Fri, Jan 08, 2010 at 04:44:51PM -0500, Carlos O'Donell wrote:
> > > >
> > > > However, I think Dave is on to something with the
> > > 
> > > ...kernel issue.
> > > 
> > > We might have *several* outstanding bugs :-)
> > > 
> > 
> > Hrm. We discussed this on IRC a while ago, I can't remember what we
> > decided was the best approach... there's probably many many dragons
> > here.
> > 
> > I wonder what would break if we set any EAGAIN returns to EWOULDBLOCK in
> > the exit path.
> 
> That seems reversed.  x86_64 translates the system's EWOULDBLOCK error
> into EAGAIN in sysdeps/unix/x86_64/sysdep.S.  However, don't know if this
> impacts the futex and sem_wait checks.

Yeah, you're right.

regards, Kyle

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

* Re: futex wait failure
  2010-01-08 21:44                                 ` Carlos O'Donell
  2010-01-08 21:44                                   ` Carlos O'Donell
@ 2010-01-16 23:17                                   ` Helge Deller
  2010-01-18 15:50                                     ` John David Anglin
                                                       ` (2 more replies)
  1 sibling, 3 replies; 194+ messages in thread
From: Helge Deller @ 2010-01-16 23:17 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: John David Anglin, dave.anglin, linux-parisc

On 01/08/2010 10:44 PM, Carlos O'Donell wrote:
> On Fri, Jan 8, 2010 at 4:18 PM, Helge Deller<deller@gmx.de>  wrote:
>>> I now think this probably is a glibc bug.  The kernel uses this value
>>> when the CLONE_PARENT_SETTID flag is passed.
>>
>>
>> Maybe we have a futex problem in glibc on hppa?
>> In glibc nptl/pthread_mutex_trylock.c we check the return value of a futex
>> syscall against EWOULDBLOCK.
>> Since on parisc - in contrast to all other architectures - we have
>> EWOULDBLOCK!=EAGAIN, we maybe missed a check?
>
> That's a bug. [...]

Carlos,  Dave,

I'm wondering if we have another bug in glibc...?

When running strace, I noticed that a thread which returns with "return 0",
exits the process on hppa with exit(0):
[pid  1875] write(1, "Thread OK.\n", 11) = 11
[pid  1875] exit(0)

On my x86_64 I see:
[pid  8154] write(1, "Thread OK.\n", 11) = 11
[pid  8154] _exit(0)                    =

In ports/sysdeps/unix/sysv/linux/hppa/clone.S (line 170) I do see:
         /* The call to _exit needs saved r19.  */
         bl      _exit, %rp
         copy    %ret0, %arg0

This coding seems to indicate that we call _exit(), but we aren't (as
you see above in the strace).
So I'm wondering if the "bl _exit,%rp" needs changing.
Something with HIDDEN_JUMPTARGET(_exit) or similar, so that
_exit() instead of exit() is called?

Actually I did tested this with the minifail test program, and changed
thread_run() to call _exit(0) at the end instead of "return 0":
void* thread_run(void* arg) {
	...
/*	return (void *)&status;  */
         _exit(0);
}
With strace I then suddenly got exit_group() which seems more correct:
[pid  1910] write(1, "Thread OK.\n", 11) = 11
[pid  1910] exit_group(0)               = ?

Helge

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

* Re: futex wait failure
  2010-01-16 23:17                                   ` Helge Deller
@ 2010-01-18 15:50                                     ` John David Anglin
  2010-01-18 20:44                                     ` John David Anglin
  2010-01-29 17:53                                     ` Carlos O'Donell
  2 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2010-01-18 15:50 UTC (permalink / raw)
  To: Helge Deller; +Cc: carlos, dave.anglin, linux-parisc

Hi Helge,

If you link the test with -static, you should be able to set
breaks in your test application and determine why _exit isn't
called.

I'm in the process of moving homes, so I don't have much time
to investigate myself.

Dave

> On 01/08/2010 10:44 PM, Carlos O'Donell wrote:
> > On Fri, Jan 8, 2010 at 4:18 PM, Helge Deller<deller@gmx.de>  wrote:
> >>> I now think this probably is a glibc bug.  The kernel uses this value
> >>> when the CLONE_PARENT_SETTID flag is passed.
> >>
> >>
> >> Maybe we have a futex problem in glibc on hppa?
> >> In glibc nptl/pthread_mutex_trylock.c we check the return value of a futex
> >> syscall against EWOULDBLOCK.
> >> Since on parisc - in contrast to all other architectures - we have
> >> EWOULDBLOCK!=EAGAIN, we maybe missed a check?
> >
> > That's a bug. [...]
> 
> Carlos,  Dave,
> 
> I'm wondering if we have another bug in glibc...?
> 
> When running strace, I noticed that a thread which returns with "return 0",
> exits the process on hppa with exit(0):
> [pid  1875] write(1, "Thread OK.\n", 11) = 11
> [pid  1875] exit(0)
> 
> On my x86_64 I see:
> [pid  8154] write(1, "Thread OK.\n", 11) = 11
> [pid  8154] _exit(0)                    =
> 
> In ports/sysdeps/unix/sysv/linux/hppa/clone.S (line 170) I do see:
>          /* The call to _exit needs saved r19.  */
>          bl      _exit, %rp
>          copy    %ret0, %arg0
> 
> This coding seems to indicate that we call _exit(), but we aren't (as
> you see above in the strace).
> So I'm wondering if the "bl _exit,%rp" needs changing.
> Something with HIDDEN_JUMPTARGET(_exit) or similar, so that
> _exit() instead of exit() is called?
> 
> Actually I did tested this with the minifail test program, and changed
> thread_run() to call _exit(0) at the end instead of "return 0":
> void* thread_run(void* arg) {
> 	...
> /*	return (void *)&status;  */
>          _exit(0);
> }
> With strace I then suddenly got exit_group() which seems more correct:
> [pid  1910] write(1, "Thread OK.\n", 11) = 11
> [pid  1910] exit_group(0)               = ?
> 
> Helge
> 


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

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

* Re: futex wait failure
  2010-01-16 23:17                                   ` Helge Deller
  2010-01-18 15:50                                     ` John David Anglin
@ 2010-01-18 20:44                                     ` John David Anglin
  2010-01-18 20:49                                       ` Carlos O'Donell
  2010-01-29 17:53                                     ` Carlos O'Donell
  2 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2010-01-18 20:44 UTC (permalink / raw)
  To: Helge Deller; +Cc: carlos, dave.anglin, linux-parisc

> Actually I did tested this with the minifail test program, and changed
> thread_run() to call _exit(0) at the end instead of "return 0":
> void* thread_run(void* arg) {
> 	...
> /*	return (void *)&status;  */
>          _exit(0);
> }
> With strace I then suddenly got exit_group() which seems more correct:
> [pid  1910] write(1, "Thread OK.\n", 11) = 11
> [pid  1910] exit_group(0)               = ?

The child of the fork should exit using _exit(0).  Otherwise, it messes
with the file descriptors of the parent.

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

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

* Re: futex wait failure
  2010-01-18 20:44                                     ` John David Anglin
@ 2010-01-18 20:49                                       ` Carlos O'Donell
  0 siblings, 0 replies; 194+ messages in thread
From: Carlos O'Donell @ 2010-01-18 20:49 UTC (permalink / raw)
  To: John David Anglin; +Cc: Helge Deller, dave.anglin, linux-parisc

On Mon, Jan 18, 2010 at 3:44 PM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
>> Actually I did tested this with the minifail test program, and chang=
ed
>> thread_run() to call _exit(0) at the end instead of "return 0":
>> void* thread_run(void* arg) {
>> =A0 =A0 =A0 ...
>> /* =A0 =A0return (void *)&status; =A0*/
>> =A0 =A0 =A0 =A0 =A0_exit(0);
>> }
>> With strace I then suddenly got exit_group() which seems more correc=
t:
>> [pid =A01910] write(1, "Thread OK.\n", 11) =3D 11
>> [pid =A01910] exit_group(0) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D ?
>
> The child of the fork should exit using _exit(0). =A0Otherwise, it me=
sses
> with the file descriptors of the parent.

Thanks for verifying this. I'm looking into this.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2010-01-16 23:17                                   ` Helge Deller
  2010-01-18 15:50                                     ` John David Anglin
  2010-01-18 20:44                                     ` John David Anglin
@ 2010-01-29 17:53                                     ` Carlos O'Donell
  2010-01-31 21:14                                       ` Helge Deller
  2 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2010-01-29 17:53 UTC (permalink / raw)
  To: Helge Deller; +Cc: John David Anglin, dave.anglin, linux-parisc

On Sat, Jan 16, 2010 at 6:17 PM, Helge Deller <deller@gmx.de> wrote:
> This coding seems to indicate that we call _exit(), but we aren't (as
> you see above in the strace).
> So I'm wondering if the "bl _exit,%rp" needs changing.
> Something with HIDDEN_JUMPTARGET(_exit) or similar, so that
> _exit() instead of exit() is called?
>
> Actually I did tested this with the minifail test program, and change=
d
> thread_run() to call _exit(0) at the end instead of "return 0":
> void* thread_run(void* arg) {
> =A0 =A0 =A0 =A0...
> /* =A0 =A0 =A0return (void *)&status; =A0*/
> =A0 =A0 =A0 =A0_exit(0);
> }
> With strace I then suddenly got exit_group() which seems more correct=
:
> [pid =A01910] write(1, "Thread OK.\n", 11) =3D 11
> [pid =A01910] exit_group(0) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D ?

I agree with this analysis. I'm testing a change which uses
HIDDEN_JUMPTARGET(). I will tell you how it goes.

Calling exit_group is important for threads.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2010-01-29 17:53                                     ` Carlos O'Donell
@ 2010-01-31 21:14                                       ` Helge Deller
  2010-01-01  0:26                                         ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Helge Deller @ 2010-01-31 21:14 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: John David Anglin, dave.anglin, linux-parisc

On 01/29/2010 06:53 PM, Carlos O'Donell wrote:
> On Sat, Jan 16, 2010 at 6:17 PM, Helge Deller<deller@gmx.de>  wrote:
>> This coding seems to indicate that we call _exit(), but we aren't (as
>> you see above in the strace).
>> So I'm wondering if the "bl _exit,%rp" needs changing.
>> Something with HIDDEN_JUMPTARGET(_exit) or similar, so that
>> _exit() instead of exit() is called?
>>
>> Actually I did tested this with the minifail test program, and changed
>> thread_run() to call _exit(0) at the end instead of "return 0":
>> void* thread_run(void* arg) {
>>         ...
>> /*      return (void *)&status;  */
>>         _exit(0);
>> }
>> With strace I then suddenly got exit_group() which seems more correct:
>> [pid  1910] write(1, "Thread OK.\n", 11) = 11
>> [pid  1910] exit_group(0)               = ?
>
> I agree with this analysis. I'm testing a change which uses
> HIDDEN_JUMPTARGET(). I will tell you how it goes.

I think I tested it once, and it doesn't help.
Threads are started by calling start_thread(), and I think we need changes there, e.g. (untested):

diff -up ./nptl/pthread_create.c.org ./nptl/pthread_create.c
--- ./nptl/pthread_create.c.org 2010-01-17 20:54:19.000000000 +0100
+++ ./nptl/pthread_create.c     2010-01-17 20:56:24.000000000 +0100
@@ -316,7 +316,7 @@ start_thread (void *arg)
       is no thread left.  */
    if (__builtin_expect (atomic_decrement_and_test (&__nptl_nthreads), 0))
      /* This was the last thread.  */
-    exit (0);
+    _exit (0);
                                                                                                                                            
    /* Report the death of the thread if this is wanted.  */
    if (__builtin_expect (pd->report_events, 0))
  

> Calling exit_group is important for threads.

Yep.

Helge

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

* Re: futex wait failure
  2010-01-01  0:26                                         ` John David Anglin
@ 2010-02-01 12:58                                           ` Carlos O'Donell
  2010-02-01 15:47                                             ` John David Anglin
  2010-02-01 19:02                                           ` Helge Deller
  1 sibling, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2010-02-01 12:58 UTC (permalink / raw)
  To: John David Anglin; +Cc: Helge Deller, dave.anglin, linux-parisc

On Thu, Jan 28, 2010 at 11:56 AM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
>> >> Actually I did tested this with the minifail test program, and ch=
anged
>> >> thread_run() to call _exit(0) at the end instead of "return 0":
>> >> void* thread_run(void* arg) {
>> >> =A0 =A0 =A0 =A0 ...
>> >> /* =A0 =A0 =A0return (void *)&status; =A0*/
>> >> =A0 =A0 =A0 =A0 _exit(0);
>> >> }
>> >> With strace I then suddenly got exit_group() which seems more cor=
rect:
>> >> [pid =A01910] write(1, "Thread OK.\n", 11) =3D 11
>> >> [pid =A01910] exit_group(0) =A0 =A0 =A0 =A0 =A0 =A0 =A0 =3D ?
>
> Did this fix minifail?

Do you have a copy of minifail I can run as a contained test case?

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2010-02-01 12:58                                           ` Carlos O'Donell
@ 2010-02-01 15:47                                             ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2010-02-01 15:47 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: Helge Deller, dave.anglin, linux-parisc

[-- Attachment #1: Type: text/plain, Size: 812 bytes --]

On Mon, 01 Feb 2010, Carlos O'Donell wrote:

> Do you have a copy of minifail I can run as a contained test case?

I've attached two versions -- the original and a simpler revised version.

The revised version shows that this is a clone/fork problem.  If the
parent waits for the child thread to set run before forking, the test
doesn't fail.  If the static definition of run is changed to 1, the
test fails.  I had added some loops at one time to show that this isn't
an exit issue. 

This is not to say that Helge isn't right about threads incorrectly using
exit.

The failure is always the stack of the child thread is overwritten with
zeros.

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

[-- Attachment #2: minifail.cpp --]
[-- Type: text/plain, Size: 1169 bytes --]

#include <QtCore/QCoreApplication>
#include <QtCore/QThread>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>

class MyThread : public QThread
{
	void run();
};

void MyThread::run() {
	printf("Thread OK.\n");
}

int qt_test(int argc, char** argv) {
	QCoreApplication app(argc, argv);

	MyThread thread;
	thread.start();

	int p[2];
	char buf;
	pipe(p);

	switch (fork()) {
		case -1:
			perror("fork() failed");
		case 0:
			printf("Child OK.\n");
			write(p[1], "\0", 1);
			exit(0);
		default:
			break;
		
	}
	close(p[1]);
	read(p[0], &buf, 1);
	thread.wait();
	return 0;
}

void* thread_run(void* arg) {
	printf("Thread OK.\n");
}

int pure_test() {
	pthread_t thread;
	pthread_create(&thread, NULL, thread_run, NULL);

	int p[2];
	char buf;
	pipe(p);

	switch (fork()) {
		case -1:
			perror("fork() failed");
		case 0:
			close(p[0]);
			printf("Child OK.\n");
			write(p[1], "\0", 1);
			exit(0);
		default:
			break;
		
	}
	
	close(p[1]);
	read(p[0], &buf, 1);
	pthread_join(thread, NULL);
	return 0;
}

int main(int argc, char** argv) {
	if (argc == 2) {
		if (!strcmp("qt", argv[1])) {
			return qt_test(argc, argv);
		}
	}
	return pure_test();
}

[-- Attachment #3: minifail6.cpp --]
[-- Type: text/plain, Size: 1246 bytes --]

#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

/*
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561203

  clone(child_stack=0x4088d040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x4108c4e8, tls=0x4108c900, child_tidptr=0x4108c4e8) = 14819
[pid 14819] set_robust_list(0x4108c4f0, 0xc) = 0
[pid 14818] clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x40002028) = 14820

 g++  minifail.cpp -o minifail -O0 -pthread -g

 i=0; while true; do i=$(($i+1)); echo Run $i; ./minifail; done;

 */

static volatile int run;

void* thread_run(void* arg) {
	static long status;
	int i;
        
	run = 1;
	pthread_yield();
	for (i = 10000000; i; i--)
	   continue;
	write(1,"Thread OK.\n",11);
	return (void *)&status;
}

int pure_test() {
	pthread_t thread;
	pthread_create(&thread, NULL, thread_run, NULL);

	while (!run)
	  continue;
	switch (fork()) {
		case -1:
			perror("fork() failed");
		case 0:
			write(1,"Child OK.\n",10);
			_exit(0);
		default:
			break;
		
	}
	pthread_join(thread, NULL);
	return 0;
}

int main(int argc, char** argv) {
	return pure_test();
}

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

* Re: futex wait failure
  2010-01-01  0:26                                         ` John David Anglin
  2010-02-01 12:58                                           ` Carlos O'Donell
@ 2010-02-01 19:02                                           ` Helge Deller
  2010-02-01 19:11                                             ` John David Anglin
  1 sibling, 1 reply; 194+ messages in thread
From: Helge Deller @ 2010-02-01 19:02 UTC (permalink / raw)
  To: John David Anglin; +Cc: carlos, dave.anglin, linux-parisc

On 02/01/2010 01:26 AM, John David Anglin wrote:
>>>> Actually I did tested this with the minifail test program, and changed
>>>> thread_run() to call _exit(0) at the end instead of "return 0":
>>>> void* thread_run(void* arg) {
>>>>          ...
>>>> /*      return (void *)&status;  */
>>>>          _exit(0);
>>>> }
>>>> With strace I then suddenly got exit_group() which seems more correct:
>>>> [pid  1910] write(1, "Thread OK.\n", 11) = 11
>>>> [pid  1910] exit_group(0)               = ?
>
> Did this fix minifail?

No, sadly it didn't fixed it.

Helge

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

* Re: futex wait failure
  2010-02-01 19:02                                           ` Helge Deller
@ 2010-02-01 19:11                                             ` John David Anglin
  2010-02-01 21:36                                               ` Carlos O'Donell
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2010-02-01 19:11 UTC (permalink / raw)
  To: Helge Deller; +Cc: carlos, dave.anglin, linux-parisc

> On 02/01/2010 01:26 AM, John David Anglin wrote:
> >>>> Actually I did tested this with the minifail test program, and changed
> >>>> thread_run() to call _exit(0) at the end instead of "return 0":
> >>>> void* thread_run(void* arg) {
> >>>>          ...
> >>>> /*      return (void *)&status;  */
> >>>>          _exit(0);
> >>>> }
> >>>> With strace I then suddenly got exit_group() which seems more correct:
> >>>> [pid  1910] write(1, "Thread OK.\n", 11) = 11
> >>>> [pid  1910] exit_group(0)               = ?
> >
> > Did this fix minifail?
> 
> No, sadly it didn't fixed it.

I tend to think clone/fork syscalls need to be guarded to ensure a stable
configuration while the syscall executes.  It may be the problem arises
because we use clone for fork.  Do any other targets do this?

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

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

* Re: futex wait failure
  2010-02-01 19:11                                             ` John David Anglin
@ 2010-02-01 21:36                                               ` Carlos O'Donell
  0 siblings, 0 replies; 194+ messages in thread
From: Carlos O'Donell @ 2010-02-01 21:36 UTC (permalink / raw)
  To: John David Anglin; +Cc: Helge Deller, dave.anglin, linux-parisc

On Mon, Feb 1, 2010 at 2:11 PM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
>>
>> No, sadly it didn't fixed it.
>
> I tend to think clone/fork syscalls need to be guarded to ensure a st=
able
> configuration while the syscall executes. =A0It may be the problem ar=
ises
> because we use clone for fork. =A0Do any other targets do this?

All targets call nptl/sysdeps/unix/sysv/linux/fork.c, which calls
ARCH_FORK, which is implemented using clone() for *all* targets.

In fact, owing to the POSIX atfork requirements, it's very difficult
to implement fork properly without using Linux clone.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2010-01-08 21:17                               ` John David Anglin
@ 2010-02-02 21:16                                 ` Helge Deller
  2010-02-03  3:44                                   ` John David Anglin
  2010-02-03 22:44                                   ` Carlos O'Donell
  0 siblings, 2 replies; 194+ messages in thread
From: Helge Deller @ 2010-02-02 21:16 UTC (permalink / raw)
  To: John David Anglin, Carlos O'Donell, Kyle McMartin
  Cc: John David Anglin, linux-parisc

[-- Attachment #1: Type: text/plain, Size: 1049 bytes --]

I wonder if we have some problems with the LWS code path in the kernel
regarding atomic locking with futexes?

In arch/parisc/kernel/syscall.S we use a lock table called lws_lock_start[]
to guard the LWS code against other competing userspace processes.
I wonder if this really enough, esp. since we do implement futex syscalls
(e.g. clone/exit calls uses futex functions to change userspace values
because of CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID).

Do we maybe need to protect the LWS code path with the same locking table as the
generic kernel? Atomicity of futexes writing to userspace are not in sync
with the locking of the LWS/lws_lock_start[] code.

I tried to come up with a patch for that which I attached here, but sadly
it hangs as soon as the init process is started on a 64bit/SMP kernel.
So either my thinking here is stupid, or I do have a stupid coding bug.

Furthermore, the coding for futex_atomic_op_inuser() in
arch/parisc/include/asm/futex.h seems to miss real functionality.
I didn't looked closer into this though.

Helge

[-- Attachment #2: z1 --]
[-- Type: text/plain, Size: 2970 bytes --]

diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c
index ec787b4..50353bd 100644
--- a/arch/parisc/kernel/asm-offsets.c
+++ b/arch/parisc/kernel/asm-offsets.c
@@ -290,5 +290,11 @@ int main(void)
 	BLANK();
 	DEFINE(ASM_PDC_RESULT_SIZE, NUM_PDC_RESULT * sizeof(unsigned long));
 	BLANK();
+
+#ifdef CONFIG_SMP
+	DEFINE(ASM_ATOMIC_HASH_SIZE_SHIFT, __builtin_ffs(ATOMIC_HASH_SIZE)-1);
+	DEFINE(ASM_ATOMIC_HASH_ENTRY_SHIFT, __builtin_ffs(sizeof(__atomic_hash[0]))-1);
+#endif
+
 	return 0;
 }
diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
index cb71f3d..878f42c 100644
--- a/arch/parisc/kernel/setup.c
+++ b/arch/parisc/kernel/setup.c
@@ -128,6 +131,14 @@ void __init setup_arch(char **cmdline_p)
 	printk(KERN_INFO "The 32-bit Kernel has started...\n");
 #endif
 
+	/* Consistency check on the size and alignments of our spinlocks */
+#ifdef CONFIG_SMP
+	BUILD_BUG_ON(sizeof(arch_spinlock_t) != __PA_LDCW_ALIGNMENT);
+	BUG_ON((unsigned long)&__atomic_hash[0] & (__PA_LDCW_ALIGNMENT-1));
+	BUG_ON((unsigned long)&__atomic_hash[1] & (__PA_LDCW_ALIGNMENT-1));
+#endif
+	BUILD_BUG_ON((1<<L1_CACHE_SHIFT) != L1_CACHE_BYTES);
+
 	pdc_console_init();
 
 #ifdef CONFIG_64BIT
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index f5f9602..7925a68 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -11,6 +11,7 @@
 #include <asm/unistd.h>
 #include <asm/errno.h>
 #include <asm/page.h>
+#include <asm/cache.h>
 #include <asm/psw.h>
 #include <asm/thread_info.h>
 #include <asm/assembly.h>
@@ -530,18 +527,17 @@ lws_compare_and_swap32:
 
 lws_compare_and_swap:
 #ifdef CONFIG_SMP
-	/* Load start of lock table */
-	ldil	L%lws_lock_start, %r20
-	ldo	R%lws_lock_start(%r20), %r28
+	/* Calculate lock table entry via ATOMIC_HASH(%r26) */
+	ldil	L%__atomic_hash, %r20
+	ldo	R%__atomic_hash(%r20), %r28
 
-	/* Extract four bits from r26 and hash lock (Bits 4-7) */
-	extru  %r26, 27, 4, %r20
+#ifdef CONFIG_64BIT
+	extrd,u %r26, 63-L1_CACHE_SHIFT, ASM_ATOMIC_HASH_SIZE_SHIFT, %r20
+#else
+	extru	%r26, 31-L1_CACHE_SHIFT, ASM_ATOMIC_HASH_SIZE_SHIFT, %r20
+#endif
+	shladd,l %r20, ASM_ATOMIC_HASH_ENTRY_SHIFT, %r28, %r20
 
-	/* Find lock to use, the hash is either one of 0 to
-	   15, multiplied by 16 (keep it 16-byte aligned)
-	   and add to the lock table offset. */
-	shlw	%r20, 4, %r20
-	add	%r20, %r28, %r20
 
 # if ENABLE_LWS_DEBUG
 	/*	
@@ -672,31 +668,6 @@ ENTRY(sys_call_table64)
 END(sys_call_table64)
 #endif
 
-#ifdef CONFIG_SMP
-	/*
-		All light-weight-syscall atomic operations 
-		will use this set of locks 
-
-		NOTE: The lws_lock_start symbol must be
-		at least 16-byte aligned for safe use
-		with ldcw.
-	*/
-	.section .data
-	.align	PAGE_SIZE
-ENTRY(lws_lock_start)
-	/* lws locks */
-	.rept 16
-	/* Keep locks aligned at 16-bytes */
-	.word 1
-	.word 0 
-	.word 0
-	.word 0
-	.endr
-END(lws_lock_start)
-	.previous
-#endif
-/* CONFIG_SMP for lws_lock_start */

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

* Re: futex wait failure
  2010-02-02 21:16                                 ` Helge Deller
@ 2010-02-03  3:44                                   ` John David Anglin
  2010-02-03 22:03                                     ` Helge Deller
  2010-02-03 22:44                                   ` Carlos O'Donell
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2010-02-03  3:44 UTC (permalink / raw)
  To: Helge Deller
  Cc: Carlos O'Donell, Kyle McMartin, John David Anglin,
	linux-parisc

On Tue, 02 Feb 2010, Helge Deller wrote:

> I wonder if we have some problems with the LWS code path in the kernel
> regarding atomic locking with futexes?
>
> In arch/parisc/kernel/syscall.S we use a lock table called lws_lock_start[]
> to guard the LWS code against other competing userspace processes.
> I wonder if this really enough, esp. since we do implement futex syscalls
> (e.g. clone/exit calls uses futex functions to change userspace values
> because of CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID).
>
> Do we maybe need to protect the LWS code path with the same locking table 
> as the
> generic kernel? Atomicity of futexes writing to userspace are not in sync
> with the locking of the LWS/lws_lock_start[] code.
>
> I tried to come up with a patch for that which I attached here, but sadly
> it hangs as soon as the init process is started on a 64bit/SMP kernel.
> So either my thinking here is stupid, or I do have a stupid coding bug.
>
> Furthermore, the coding for futex_atomic_op_inuser() in
> arch/parisc/include/asm/futex.h seems to miss real functionality.
> I didn't looked closer into this though.

While locking may be a problem, it is not the main reason the minifail
program fails.  The program fails on my c3750 with a 32-bit UP kernel.
There is no locking in this kernel.  The LWS code relies on the scheduler
for atomicity.

I tried disabling interrupts around the crucial three instructions but
it didn't help.

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

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

* Re: futex wait failure
  2010-02-03  3:44                                   ` John David Anglin
@ 2010-02-03 22:03                                     ` Helge Deller
  2010-03-07 17:12                                       ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Helge Deller @ 2010-02-03 22:03 UTC (permalink / raw)
  To: John David Anglin
  Cc: John David Anglin, Carlos O'Donell, Kyle McMartin,
	linux-parisc

[-- Attachment #1: Type: text/plain, Size: 2164 bytes --]

On 02/03/2010 04:44 AM, John David Anglin wrote:
> On Tue, 02 Feb 2010, Helge Deller wrote:
>
>> I wonder if we have some problems with the LWS code path in the kernel
>> regarding atomic locking with futexes?
>>
>> In arch/parisc/kernel/syscall.S we use a lock table called lws_lock_start[]
>> to guard the LWS code against other competing userspace processes.
>> I wonder if this really enough, esp. since we do implement futex syscalls
>> (e.g. clone/exit calls uses futex functions to change userspace values
>> because of CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID).
>>
>> Do we maybe need to protect the LWS code path with the same locking table
>> as the
>> generic kernel? Atomicity of futexes writing to userspace are not in sync
>> with the locking of the LWS/lws_lock_start[] code.
>>
>> I tried to come up with a patch for that which I attached here, but sadly
>> it hangs as soon as the init process is started on a 64bit/SMP kernel.
>> So either my thinking here is stupid, or I do have a stupid coding bug.
>>
>> Furthermore, the coding for futex_atomic_op_inuser() in
>> arch/parisc/include/asm/futex.h seems to miss real functionality.
>> I didn't looked closer into this though.
>
> While locking may be a problem, it is not the main reason the minifail
> program fails.  The program fails on my c3750 with a 32-bit UP kernel.

Hmm, I can't reproduce it at the moment with a 32bit UP kernel on my
c3000. The minifail3 test program I currently use (to avoid glibc issues)
is attached.

> There is no locking in this kernel.  The LWS code relies on the scheduler
> for atomicity.

yep. This should then work an a UP kernel.

> I tried disabling interrupts around the crucial three instructions but
> it didn't help.

Ugh.

Anyway, my current patch which compiles and runs fine is attached here as
well. Maybe you want to try it on your SMP builds? It includes the syscall.S
changes you sent last time too.
In this version of the patch I added on own LWS locking hash table for user-space accesses,
which is used in the LWS code and when some (probably not all) put_user()/
get_user() calls are made in the futex code.

Feedback still welcome.

Helge

[-- Attachment #2: minifail3.c --]
[-- Type: text/plain, Size: 652 bytes --]

#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

/*
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561203

 gcc  minifail3.c -o minifail3 -O0 -pthread -g

 Run as: i=0; while true; do i=$(($i+1)); echo Run $i; ./minifail3; done;

 */

static volatile int run;

void* thread_run(void* arg) {
	write(1,"Thread OK.\n",11);
	_exit(0);
}

int main(int argc, char** argv) {
	pthread_t thread;
	pthread_create(&thread, NULL, thread_run, NULL);

	switch (fork()) {
		case -1:
			perror("fork() failed");
		case 0:
			write(1,"Child OK.\n",10);
			exit(0);
		default:
			break;
		
	}
	pthread_join(thread, NULL);
	return 0;
}

[-- Attachment #3: parisc_lock_v2.patch --]
[-- Type: text/x-patch, Size: 9485 bytes --]

diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h
index 716634d..18d57c8 100644
--- a/arch/parisc/include/asm/atomic.h
+++ b/arch/parisc/include/asm/atomic.h
@@ -24,29 +24,46 @@
  * Hash function to index into a different SPINLOCK.
  * Since "a" is usually an address, use one spinlock per cacheline.
  */
-#  define ATOMIC_HASH_SIZE 4
-#  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
+#  define ATOMIC_HASH_SIZE (4096/L1_CACHE_BYTES)  /* 4 */
+#  define ATOMIC_HASH(a)      (&(__atomic_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
+#  define ATOMIC_USER_HASH(a) (&(__atomic_user_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
 
 extern arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
+extern arch_spinlock_t __atomic_user_hash[ATOMIC_HASH_SIZE] __lock_aligned;
 
 /* Can't use raw_spin_lock_irq because of #include problems, so
  * this is the substitute */
-#define _atomic_spin_lock_irqsave(l,f) do {	\
-	arch_spinlock_t *s = ATOMIC_HASH(l);		\
+#define _atomic_spin_lock_irqsave_template(l,f,hash_func) do {	\
+	arch_spinlock_t *s = hash_func;		\
 	local_irq_save(f);			\
 	arch_spin_lock(s);			\
 } while(0)
 
-#define _atomic_spin_unlock_irqrestore(l,f) do {	\
-	arch_spinlock_t *s = ATOMIC_HASH(l);			\
+#define _atomic_spin_unlock_irqrestore_template(l,f,hash_func) do {	\
+	arch_spinlock_t *s = hash_func;			\
 	arch_spin_unlock(s);				\
 	local_irq_restore(f);				\
 } while(0)
 
+/* kernel memory locks */
+#define _atomic_spin_lock_irqsave(l,f)	\
+	_atomic_spin_lock_irqsave_template(l,f,ATOMIC_HASH(l))
+
+#define _atomic_spin_unlock_irqrestore(l,f)	\
+	_atomic_spin_unlock_irqrestore_template(l,f,ATOMIC_HASH(l))
+
+/* userspace memory locks */
+#define _atomic_spin_lock_irqsave_user(l,f)	\
+	_atomic_spin_lock_irqsave_template(l,f,ATOMIC_USER_HASH(l))
+
+#define _atomic_spin_unlock_irqrestore_user(l,f)	\
+	_atomic_spin_unlock_irqrestore_template(l,f,ATOMIC_USER_HASH(l))
 
 #else
 #  define _atomic_spin_lock_irqsave(l,f) do { local_irq_save(f); } while (0)
 #  define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0)
+#  define _atomic_spin_lock_irqsave_user(l,f) _atomic_spin_lock_irqsave(l,f)
+#  define _atomic_spin_unlock_irqrestore_user(l,f) _atomic_spin_lock_irqsave_user(l,f)
 #endif
 
 /* This should get optimized out since it's never called.
diff --git a/arch/parisc/include/asm/futex.h b/arch/parisc/include/asm/futex.h
index 0c705c3..7bc963e 100644
--- a/arch/parisc/include/asm/futex.h
+++ b/arch/parisc/include/asm/futex.h
@@ -55,6 +55,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
 {
 	int err = 0;
 	int uval;
+	unsigned long flags;
 
 	/* futex.c wants to do a cmpxchg_inatomic on kernel NULL, which is
 	 * our gateway page, and causes no end of trouble...
@@ -65,10 +66,15 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
 	if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
 		return -EFAULT;
 
+	_atomic_spin_lock_irqsave_user(uaddr, flags);
+
 	err = get_user(uval, uaddr);
-	if (err) return -EFAULT;
-	if (uval == oldval)
-		err = put_user(newval, uaddr);
+	if (!err)
+		if (uval == oldval)
+			err = put_user(newval, uaddr);
+
+	_atomic_spin_unlock_irqrestore_user(uaddr, flags);
+
 	if (err) return -EFAULT;
 	return uval;
 }
diff --git a/arch/parisc/include/asm/system.h b/arch/parisc/include/asm/system.h
index d91357b..4653c77 100644
--- a/arch/parisc/include/asm/system.h
+++ b/arch/parisc/include/asm/system.h
@@ -160,7 +160,7 @@ static inline void set_eiem(unsigned long val)
    ldcd). */
 
 #define __PA_LDCW_ALIGNMENT	4
-#define __ldcw_align(a) ((volatile unsigned int *)a)
+#define __ldcw_align(a) (&(a)->slock)
 #define __LDCW	"ldcw,co"
 
 #endif /*!CONFIG_PA20*/
diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c
index ec787b4..50353bd 100644
--- a/arch/parisc/kernel/asm-offsets.c
+++ b/arch/parisc/kernel/asm-offsets.c
@@ -290,5 +290,11 @@ int main(void)
 	BLANK();
 	DEFINE(ASM_PDC_RESULT_SIZE, NUM_PDC_RESULT * sizeof(unsigned long));
 	BLANK();
+
+#ifdef CONFIG_SMP
+	DEFINE(ASM_ATOMIC_HASH_SIZE_SHIFT, __builtin_ffs(ATOMIC_HASH_SIZE)-1);
+	DEFINE(ASM_ATOMIC_HASH_ENTRY_SHIFT, __builtin_ffs(sizeof(__atomic_hash[0]))-1);
+#endif
+
 	return 0;
 }
diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
index cb71f3d..878f42c 100644
--- a/arch/parisc/kernel/setup.c
+++ b/arch/parisc/kernel/setup.c
@@ -128,6 +131,14 @@ void __init setup_arch(char **cmdline_p)
 	printk(KERN_INFO "The 32-bit Kernel has started...\n");
 #endif
 
+	/* Consistency check on the size and alignments of our spinlocks */
+#ifdef CONFIG_SMP
+	BUILD_BUG_ON(sizeof(arch_spinlock_t) != __PA_LDCW_ALIGNMENT);
+	BUG_ON((unsigned long)&__atomic_hash[0] & (__PA_LDCW_ALIGNMENT-1));
+	BUG_ON((unsigned long)&__atomic_hash[1] & (__PA_LDCW_ALIGNMENT-1));
+#endif
+	BUILD_BUG_ON((1<<L1_CACHE_SHIFT) != L1_CACHE_BYTES);
+
 	pdc_console_init();
 
 #ifdef CONFIG_64BIT
diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
index f5f9602..1f12418 100644
--- a/arch/parisc/kernel/syscall.S
+++ b/arch/parisc/kernel/syscall.S
@@ -11,6 +11,7 @@
 #include <asm/unistd.h>
 #include <asm/errno.h>
 #include <asm/page.h>
+#include <asm/cache.h>
 #include <asm/psw.h>
 #include <asm/thread_info.h>
 #include <asm/assembly.h>
@@ -47,18 +48,17 @@ ENTRY(linux_gateway_page)
 	KILL_INSN
 	.endr
 
-	/* ADDRESS 0xb0 to 0xb4, lws uses 1 insns for entry */
+	/* ADDRESS 0xb0 to 0xb8, lws uses two insns for entry */
 	/* Light-weight-syscall entry must always be located at 0xb0 */
 	/* WARNING: Keep this number updated with table size changes */
 #define __NR_lws_entries (2)
 
 lws_entry:
-	/* Unconditional branch to lws_start, located on the 
-	   same gateway page */
-	b,n	lws_start
+	gate	lws_start, %r0		/* increase privilege */
+	depi	3, 31, 2, %r31		/* Ensure we return into user mode. */
 
-	/* Fill from 0xb4 to 0xe0 */
-	.rept 11
+	/* Fill from 0xb8 to 0xe0 */
+	.rept 10
 	KILL_INSN
 	.endr
 
@@ -423,9 +423,6 @@ tracesys_sigexit:
 
 	*********************************************************/
 lws_start:
-	/* Gate and ensure we return to userspace */
-	gate	.+8, %r0
-	depi	3, 31, 2, %r31	/* Ensure we return to userspace */
 
 #ifdef CONFIG_64BIT
 	/* FIXME: If we are a 64-bit kernel just
@@ -473,7 +470,7 @@ lws_exit:
 	/* now reset the lowest bit of sp if it was set */
 	xor	%r30,%r1,%r30
 #endif
-	be,n	0(%sr3, %r31)
+	be,n	0(%sr7, %r31)
 
 
 	
@@ -530,18 +527,17 @@ lws_compare_and_swap32:
 
 lws_compare_and_swap:
 #ifdef CONFIG_SMP
-	/* Load start of lock table */
-	ldil	L%lws_lock_start, %r20
-	ldo	R%lws_lock_start(%r20), %r28
+	/* Calculate lock table entry via ATOMIC_HASH(%r26) */
+	ldil	L%__atomic_user_hash, %r20
+	ldo	R%__atomic_user_hash(%r20), %r28
 
-	/* Extract four bits from r26 and hash lock (Bits 4-7) */
-	extru  %r26, 27, 4, %r20
+#ifdef CONFIG_64BIT
+	extrd,u %r26, 63-L1_CACHE_SHIFT, ASM_ATOMIC_HASH_SIZE_SHIFT, %r20
+#else
+	extru	%r26, 31-L1_CACHE_SHIFT, ASM_ATOMIC_HASH_SIZE_SHIFT, %r20
+#endif
+	shladd,l %r20, ASM_ATOMIC_HASH_ENTRY_SHIFT, %r28, %r20
 
-	/* Find lock to use, the hash is either one of 0 to
-	   15, multiplied by 16 (keep it 16-byte aligned)
-	   and add to the lock table offset. */
-	shlw	%r20, 4, %r20
-	add	%r20, %r28, %r20
 
 # if ENABLE_LWS_DEBUG
 	/*	
@@ -672,31 +668,6 @@ ENTRY(sys_call_table64)
 END(sys_call_table64)
 #endif
 
-#ifdef CONFIG_SMP
-	/*
-		All light-weight-syscall atomic operations 
-		will use this set of locks 
-
-		NOTE: The lws_lock_start symbol must be
-		at least 16-byte aligned for safe use
-		with ldcw.
-	*/
-	.section .data
-	.align	PAGE_SIZE
-ENTRY(lws_lock_start)
-	/* lws locks */
-	.rept 16
-	/* Keep locks aligned at 16-bytes */
-	.word 1
-	.word 0 
-	.word 0
-	.word 0
-	.endr
-END(lws_lock_start)
-	.previous
-#endif
-/* CONFIG_SMP for lws_lock_start */
-
 .end
 
 
diff --git a/arch/parisc/lib/bitops.c b/arch/parisc/lib/bitops.c
index 353963d..bae6a86 100644
--- a/arch/parisc/lib/bitops.c
+++ b/arch/parisc/lib/bitops.c
@@ -15,6 +15,9 @@
 arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = {
 	[0 ... (ATOMIC_HASH_SIZE-1)]  = __ARCH_SPIN_LOCK_UNLOCKED
 };
+arch_spinlock_t __atomic_user_hash[ATOMIC_HASH_SIZE] __lock_aligned = {
+	[0 ... (ATOMIC_HASH_SIZE-1)]  = __ARCH_SPIN_LOCK_UNLOCKED
+};
 #endif
 
 #ifdef CONFIG_64BIT
diff --git a/kernel/fork.c b/kernel/fork.c
index f88bd98..108b1ed 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -608,7 +608,10 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm)
 			 * We don't check the error code - if userspace has
 			 * not set up a proper pointer then tough luck.
 			 */
+			unsigned long flags;
+			_atomic_spin_lock_irqsave_user(tsk->clear_child_tid, flags);
 			put_user(0, tsk->clear_child_tid);
+			_atomic_spin_unlock_irqrestore_user(tsk->clear_child_tid, flags);
 			sys_futex(tsk->clear_child_tid, FUTEX_WAKE,
 					1, NULL, NULL, 0);
 		}
@@ -1432,8 +1435,12 @@ long do_fork(unsigned long clone_flags,
 
 		nr = task_pid_vnr(p);
 
-		if (clone_flags & CLONE_PARENT_SETTID)
+		if (clone_flags & CLONE_PARENT_SETTID) {
+			unsigned long flags;
+			_atomic_spin_lock_irqsave_user(parent_tidptr, flags);
 			put_user(nr, parent_tidptr);
+			_atomic_spin_unlock_irqrestore_user(parent_tidptr, flags);
+		}
 
 		if (clone_flags & CLONE_VFORK) {
 			p->vfork_done = &vfork;

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

* Re: futex wait failure
  2010-02-02 21:16                                 ` Helge Deller
  2010-02-03  3:44                                   ` John David Anglin
@ 2010-02-03 22:44                                   ` Carlos O'Donell
  1 sibling, 0 replies; 194+ messages in thread
From: Carlos O'Donell @ 2010-02-03 22:44 UTC (permalink / raw)
  To: Helge Deller
  Cc: John David Anglin, Kyle McMartin, John David Anglin, linux-parisc

On Tue, Feb 2, 2010 at 4:16 PM, Helge Deller <deller@gmx.de> wrote:
> Furthermore, the coding for futex_atomic_op_inuser() in
> arch/parisc/include/asm/futex.h seems to miss real functionality.
> I didn't looked closer into this though.

I have a fix for futex_atomic_op_inuser(), but it needs more testing.

Cheers,
Carlos.

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

* Re: futex wait failure
  2010-02-03 22:03                                     ` Helge Deller
@ 2010-03-07 17:12                                       ` John David Anglin
  2010-03-07 20:32                                         ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2010-03-07 17:12 UTC (permalink / raw)
  To: Helge Deller
  Cc: John David Anglin, Carlos O'Donell, Kyle McMartin,
	linux-parisc

On Wed, 03 Feb 2010, Helge Deller wrote:

> On 02/03/2010 04:44 AM, John David Anglin wrote:
>> On Tue, 02 Feb 2010, Helge Deller wrote:
>>
>>> I wonder if we have some problems with the LWS code path in the kernel
>>> regarding atomic locking with futexes?
>>>
>>> In arch/parisc/kernel/syscall.S we use a lock table called 
>>> lws_lock_start[]
>>> to guard the LWS code against other competing userspace processes.
>>> I wonder if this really enough, esp. since we do implement futex syscalls
>>> (e.g. clone/exit calls uses futex functions to change userspace values
>>> because of CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID).
>>>
>>> Do we maybe need to protect the LWS code path with the same locking table
>>> as the
>>> generic kernel? Atomicity of futexes writing to userspace are not in sync
>>> with the locking of the LWS/lws_lock_start[] code.
>>>
>>> I tried to come up with a patch for that which I attached here, but sadly
>>> it hangs as soon as the init process is started on a 64bit/SMP kernel.
>>> So either my thinking here is stupid, or I do have a stupid coding bug.
>>>
>>> Furthermore, the coding for futex_atomic_op_inuser() in
>>> arch/parisc/include/asm/futex.h seems to miss real functionality.
>>> I didn't looked closer into this though.
>>
>> While locking may be a problem, it is not the main reason the minifail
>> program fails.  The program fails on my c3750 with a 32-bit UP kernel.
>
> Hmm, I can't reproduce it at the moment with a 32bit UP kernel on my
> c3000. The minifail3 test program I currently use (to avoid glibc issues)
> is attached.
>
>> There is no locking in this kernel.  The LWS code relies on the scheduler
>> for atomicity.
>
> yep. This should then work an a UP kernel.
>
>> I tried disabling interrupts around the crucial three instructions but
>> it didn't help.
>
> Ugh.
>
> Anyway, my current patch which compiles and runs fine is attached here as
> well. Maybe you want to try it on your SMP builds? It includes the 
> syscall.S
> changes you sent last time too.
> In this version of the patch I added on own LWS locking hash table for 
> user-space accesses,
> which is used in the LWS code and when some (probably not all) put_user()/
> get_user() calls are made in the futex code.
>
> Feedback still welcome.

I tried the patch below with 2.6.33 on three systems:

rp3440: 64-bit UP and SMP
A500-7X: 64-bit SMP
c3750: 32-bit UP

libc6 is 2.10.2-6.

As usual, I tested by trying to build and check GCC.

The most common problem on the rp3440 SMP build is a segmentation fault
in /bin/sh.  Twice it dropped core running configure near the start of
the build.  Restarting the build, the system managed to complete a full
GCC build, but the gcc and acats testsuites aborted.  Here's the backtrace
for the acats one:

Core was generated by `/bin/bash /home/dave/gnu/gcc/gcc/gcc/testsuite/ada/acats/run_all.sh'.
Program terminated with signal 11, Segmentation fault.
#0  0x00000008 in ?? ()
(gdb) bt
#0  0x00000008 in ?? ()
#1  0x0004ffd0 in stop_pipeline ()
#2  0x0003daf8 in execute_command_internal ()
#3  0x0003e3a8 in execute_command_internal ()
#4  0x0003e74c in execute_command ()
#5  0x0003e364 in execute_command_internal ()
#6  0x0003e74c in execute_command ()
#7  0x0003e364 in execute_command_internal ()
#8  0x0003e74c in execute_command ()
#9  0x0003e0a0 in execute_command_internal ()
#10 0x0003e3a8 in execute_command_internal ()
#11 0x0003e74c in execute_command ()
#12 0x0003e0a0 in execute_command_internal ()
#13 0x0003e74c in execute_command ()
#14 0x00029ac0 in reader_loop ()
#15 0x00029100 in main ()

I ran the UP build for several days without any major problems.  The most
common problem is tests randomly timeout.  I'm not sure whether the tests
actually timeout or not, but everyone that I've looked at shouldn't timeout
based on execution time.

I had pretty much the same experience on the A500-7X although I haven't
seen /bin/sh dump core running configure.

The c3750 completed a full GCC build but there were again problems running
the testsuite.  For example,

Core was generated by `expect -- /usr/share/dejagnu/runtest.exp --tool gcc'.
Program terminated with signal 11, Segmentation fault.
#0  0x409fa258 in ?? () from /usr/lib/libtcl8.5.so.0
(gdb) bt
#0  0x409fa258 in ?? () from /usr/lib/libtcl8.5.so.0
#1  0x402600a0 in start_thread (arg=0x416a4480) at pthread_create.c:302
#2  0x40e25874 in clone ()
    at ../ports/sysdeps/unix/sysv/linux/hppa/nptl/../clone.S:166
#3  0x00000000 in ?? ()

This looks like the minifail clone bug.  On the otherhand, minifail doesn't
seem to be failing.

This is the assembly code:

(gdb) disass 0x409fa248 0x409fa268
Dump of assembler code from 0x409fa248 to 0x409fa268:
0x409fa248:     copy r18,ret0
0x409fa24c:     stw r0,0(ret0)
0x409fa250:     ldo 4(ret0),ret0
0x409fa254:     cmpb,<>,n r7,ret0,0x409fa250
0x409fa258:     stw r0,0(ret0)
0x409fa25c:     copy r7,ret0
0x409fa260:     stw r0,0(ret0)
0x409fa264:     ldo 4(ret0),ret0

This may be the register.  There are several dumps in the log at the same spot.

Mar  7 11:48:18 hiauly6 kernel: do_page_fault() pid=3506 command='expect' type=1
5 address=0x416a3000
Mar  7 11:48:18 hiauly6 kernel: vm_start = 0x416a3000, vm_end = 0x416a4000
Mar  7 11:48:18 hiauly6 kernel: 
Mar  7 11:48:18 hiauly6 kernel:      YZrvWESTHLNXBCVMcbcbcbcbOGFRQPDI
Mar  7 11:48:18 hiauly6 kernel: PSW: 00000000000011101111111100001111 Not tainte
d
Mar  7 11:48:18 hiauly6 kernel: r00-03  000eff0f 40276138 409fa4ff 00000000
Mar  7 11:48:18 hiauly6 kernel: r04-07  40a252f4 40ea5208 0001ccb8 00000000
Mar  7 11:48:18 hiauly6 kernel: r08-11  40a252f4 40ea539c 00000003 40a2990c
Mar  7 11:48:18 hiauly6 kernel: r12-15  40ea521c 40a29904 40ea5214 00000001
Mar  7 11:48:18 hiauly6 kernel: r16-19  00000008 40a232d8 40ea521c 40a252f4
Mar  7 11:48:18 hiauly6 kernel: r20-23  00000001 00000000 402636cc 00000000
Mar  7 11:48:18 hiauly6 kernel: r24-27  fffffff5 ffffffd3 0001c538 000121ac
Mar  7 11:48:18 hiauly6 kernel: r28-31  416a3000 00000000 40ea5440 40263733
Mar  7 11:48:18 hiauly6 kernel: sr00-03  00000026 00000000 00000000 00000026
Mar  7 11:48:18 hiauly6 kernel: sr04-07  00000026 00000026 00000026 00000026
Mar  7 11:48:18 hiauly6 kernel: 
Mar  7 11:48:18 hiauly6 kernel:       VZOUICununcqcqcqcqcqcrmunTDVZOUI
Mar  7 11:48:18 hiauly6 kernel: FPSR: 00001100001110000000000000000000
Mar  7 11:48:18 hiauly6 kernel: FPER1: 00000000
Mar  7 11:48:18 hiauly6 kernel: fr00-03  0c38000000000000 0000000000000000 00000
00000000000 0000000000000000
Mar  7 11:48:18 hiauly6 kernel: fr04-07  0000000000000001 0370000000000000 0000000100000000 bff0000000000000
Mar  7 11:48:18 hiauly6 kernel: fr08-11  000000024f813bc4 0000000000000000 4f813bc04f813bc8 0000800100000003
Mar  7 11:48:18 hiauly6 kernel: fr12-15  000000004facfd40 000000001019db40 4f81169cf0000174 f000017cf0000884
Mar  7 11:48:18 hiauly6 kernel: fr16-19  1044111810590240 1044111800000081 f000000000000000 0000000000000000
Mar  7 11:48:18 hiauly6 kernel: fr20-23  00000002ffffff9c fffff0004f1a4000 0000000000000088 400026c000000000
Mar  7 11:48:18 hiauly6 kernel: fr24-27  01f2603af000017c f000017400000001 105a928c00000000 4fb50230ffffffff
Mar  7 11:48:18 hiauly6 kernel: fr28-31  ffffffff00002b67 105a92881019487c 0000000100000000 4f82820000000800
Mar  7 11:48:18 hiauly6 kernel: 
Mar  7 11:48:18 hiauly6 kernel: IASQ: 00000026 00000026 IAOQ: 409fa25b 409fa253
Mar  7 11:48:18 hiauly6 kernel:  IIR: 0f801280    ISR: 00000026  IOR: 416a3000
Mar  7 11:48:18 hiauly6 kernel:  CPU:        0   CR30: 3c014000 CR31: ffffffff
Mar  7 11:48:18 hiauly6 kernel:  ORIG_R28: 00000080
Mar  7 11:48:18 hiauly6 kernel:  IAOQ[0]: 409fa25b
Mar  7 11:48:18 hiauly6 kernel:  IAOQ[1]: 409fa253
Mar  7 11:48:18 hiauly6 kernel:  RP(r2): 409fa4ff

The address appears valid.  This is a TLB miss exception (15).

> diff --git a/arch/parisc/include/asm/atomic.h b/arch/parisc/include/asm/atomic.h
> index 716634d..18d57c8 100644
> --- a/arch/parisc/include/asm/atomic.h
> +++ b/arch/parisc/include/asm/atomic.h
> @@ -24,29 +24,46 @@
>   * Hash function to index into a different SPINLOCK.
>   * Since "a" is usually an address, use one spinlock per cacheline.
>   */
> -#  define ATOMIC_HASH_SIZE 4
> -#  define ATOMIC_HASH(a) (&(__atomic_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
> +#  define ATOMIC_HASH_SIZE (4096/L1_CACHE_BYTES)  /* 4 */
> +#  define ATOMIC_HASH(a)      (&(__atomic_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
> +#  define ATOMIC_USER_HASH(a) (&(__atomic_user_hash[ (((unsigned long) (a))/L1_CACHE_BYTES) & (ATOMIC_HASH_SIZE-1) ]))
>  
>  extern arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
> +extern arch_spinlock_t __atomic_user_hash[ATOMIC_HASH_SIZE] __lock_aligned;
>  
>  /* Can't use raw_spin_lock_irq because of #include problems, so
>   * this is the substitute */
> -#define _atomic_spin_lock_irqsave(l,f) do {	\
> -	arch_spinlock_t *s = ATOMIC_HASH(l);		\
> +#define _atomic_spin_lock_irqsave_template(l,f,hash_func) do {	\
> +	arch_spinlock_t *s = hash_func;		\
>  	local_irq_save(f);			\
>  	arch_spin_lock(s);			\
>  } while(0)
>  
> -#define _atomic_spin_unlock_irqrestore(l,f) do {	\
> -	arch_spinlock_t *s = ATOMIC_HASH(l);			\
> +#define _atomic_spin_unlock_irqrestore_template(l,f,hash_func) do {	\
> +	arch_spinlock_t *s = hash_func;			\
>  	arch_spin_unlock(s);				\
>  	local_irq_restore(f);				\
>  } while(0)
>  
> +/* kernel memory locks */
> +#define _atomic_spin_lock_irqsave(l,f)	\
> +	_atomic_spin_lock_irqsave_template(l,f,ATOMIC_HASH(l))
> +
> +#define _atomic_spin_unlock_irqrestore(l,f)	\
> +	_atomic_spin_unlock_irqrestore_template(l,f,ATOMIC_HASH(l))
> +
> +/* userspace memory locks */
> +#define _atomic_spin_lock_irqsave_user(l,f)	\
> +	_atomic_spin_lock_irqsave_template(l,f,ATOMIC_USER_HASH(l))
> +
> +#define _atomic_spin_unlock_irqrestore_user(l,f)	\
> +	_atomic_spin_unlock_irqrestore_template(l,f,ATOMIC_USER_HASH(l))
>  
>  #else
>  #  define _atomic_spin_lock_irqsave(l,f) do { local_irq_save(f); } while (0)
>  #  define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0)
> +#  define _atomic_spin_lock_irqsave_user(l,f) _atomic_spin_lock_irqsave(l,f)
> +#  define _atomic_spin_unlock_irqrestore_user(l,f) _atomic_spin_lock_irqsave_user(l,f)
>  #endif
>  
>  /* This should get optimized out since it's never called.
> diff --git a/arch/parisc/include/asm/futex.h b/arch/parisc/include/asm/futex.h
> index 0c705c3..7bc963e 100644
> --- a/arch/parisc/include/asm/futex.h
> +++ b/arch/parisc/include/asm/futex.h
> @@ -55,6 +55,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
>  {
>  	int err = 0;
>  	int uval;
> +	unsigned long flags;
>  
>  	/* futex.c wants to do a cmpxchg_inatomic on kernel NULL, which is
>  	 * our gateway page, and causes no end of trouble...
> @@ -65,10 +66,15 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
>  	if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int)))
>  		return -EFAULT;
>  
> +	_atomic_spin_lock_irqsave_user(uaddr, flags);
> +
>  	err = get_user(uval, uaddr);
> -	if (err) return -EFAULT;
> -	if (uval == oldval)
> -		err = put_user(newval, uaddr);
> +	if (!err)
> +		if (uval == oldval)
> +			err = put_user(newval, uaddr);
> +
> +	_atomic_spin_unlock_irqrestore_user(uaddr, flags);
> +
>  	if (err) return -EFAULT;
>  	return uval;
>  }
> diff --git a/arch/parisc/include/asm/system.h b/arch/parisc/include/asm/system.h
> index d91357b..4653c77 100644
> --- a/arch/parisc/include/asm/system.h
> +++ b/arch/parisc/include/asm/system.h
> @@ -160,7 +160,7 @@ static inline void set_eiem(unsigned long val)
>     ldcd). */
>  
>  #define __PA_LDCW_ALIGNMENT	4
> -#define __ldcw_align(a) ((volatile unsigned int *)a)
> +#define __ldcw_align(a) (&(a)->slock)
>  #define __LDCW	"ldcw,co"
>  
>  #endif /*!CONFIG_PA20*/
> diff --git a/arch/parisc/kernel/asm-offsets.c b/arch/parisc/kernel/asm-offsets.c
> index ec787b4..50353bd 100644
> --- a/arch/parisc/kernel/asm-offsets.c
> +++ b/arch/parisc/kernel/asm-offsets.c
> @@ -290,5 +290,11 @@ int main(void)
>  	BLANK();
>  	DEFINE(ASM_PDC_RESULT_SIZE, NUM_PDC_RESULT * sizeof(unsigned long));
>  	BLANK();
> +
> +#ifdef CONFIG_SMP
> +	DEFINE(ASM_ATOMIC_HASH_SIZE_SHIFT, __builtin_ffs(ATOMIC_HASH_SIZE)-1);
> +	DEFINE(ASM_ATOMIC_HASH_ENTRY_SHIFT, __builtin_ffs(sizeof(__atomic_hash[0]))-1);
> +#endif
> +
>  	return 0;
>  }
> diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
> index cb71f3d..878f42c 100644
> --- a/arch/parisc/kernel/setup.c
> +++ b/arch/parisc/kernel/setup.c
> @@ -128,6 +131,14 @@ void __init setup_arch(char **cmdline_p)
>  	printk(KERN_INFO "The 32-bit Kernel has started...\n");
>  #endif
>  
> +	/* Consistency check on the size and alignments of our spinlocks */
> +#ifdef CONFIG_SMP
> +	BUILD_BUG_ON(sizeof(arch_spinlock_t) != __PA_LDCW_ALIGNMENT);
> +	BUG_ON((unsigned long)&__atomic_hash[0] & (__PA_LDCW_ALIGNMENT-1));
> +	BUG_ON((unsigned long)&__atomic_hash[1] & (__PA_LDCW_ALIGNMENT-1));
> +#endif
> +	BUILD_BUG_ON((1<<L1_CACHE_SHIFT) != L1_CACHE_BYTES);
> +
>  	pdc_console_init();
>  
>  #ifdef CONFIG_64BIT
> diff --git a/arch/parisc/kernel/syscall.S b/arch/parisc/kernel/syscall.S
> index f5f9602..1f12418 100644
> --- a/arch/parisc/kernel/syscall.S
> +++ b/arch/parisc/kernel/syscall.S
> @@ -11,6 +11,7 @@
>  #include <asm/unistd.h>
>  #include <asm/errno.h>
>  #include <asm/page.h>
> +#include <asm/cache.h>
>  #include <asm/psw.h>
>  #include <asm/thread_info.h>
>  #include <asm/assembly.h>
> @@ -47,18 +48,17 @@ ENTRY(linux_gateway_page)
>  	KILL_INSN
>  	.endr
>  
> -	/* ADDRESS 0xb0 to 0xb4, lws uses 1 insns for entry */
> +	/* ADDRESS 0xb0 to 0xb8, lws uses two insns for entry */
>  	/* Light-weight-syscall entry must always be located at 0xb0 */
>  	/* WARNING: Keep this number updated with table size changes */
>  #define __NR_lws_entries (2)
>  
>  lws_entry:
> -	/* Unconditional branch to lws_start, located on the 
> -	   same gateway page */
> -	b,n	lws_start
> +	gate	lws_start, %r0		/* increase privilege */
> +	depi	3, 31, 2, %r31		/* Ensure we return into user mode. */
>  
> -	/* Fill from 0xb4 to 0xe0 */
> -	.rept 11
> +	/* Fill from 0xb8 to 0xe0 */
> +	.rept 10
>  	KILL_INSN
>  	.endr
>  
> @@ -423,9 +423,6 @@ tracesys_sigexit:
>  
>  	*********************************************************/
>  lws_start:
> -	/* Gate and ensure we return to userspace */
> -	gate	.+8, %r0
> -	depi	3, 31, 2, %r31	/* Ensure we return to userspace */
>  
>  #ifdef CONFIG_64BIT
>  	/* FIXME: If we are a 64-bit kernel just
> @@ -473,7 +470,7 @@ lws_exit:
>  	/* now reset the lowest bit of sp if it was set */
>  	xor	%r30,%r1,%r30
>  #endif
> -	be,n	0(%sr3, %r31)
> +	be,n	0(%sr7, %r31)
>  
>  
>  	
> @@ -530,18 +527,17 @@ lws_compare_and_swap32:
>  
>  lws_compare_and_swap:
>  #ifdef CONFIG_SMP
> -	/* Load start of lock table */
> -	ldil	L%lws_lock_start, %r20
> -	ldo	R%lws_lock_start(%r20), %r28
> +	/* Calculate lock table entry via ATOMIC_HASH(%r26) */
> +	ldil	L%__atomic_user_hash, %r20
> +	ldo	R%__atomic_user_hash(%r20), %r28
>  
> -	/* Extract four bits from r26 and hash lock (Bits 4-7) */
> -	extru  %r26, 27, 4, %r20
> +#ifdef CONFIG_64BIT
> +	extrd,u %r26, 63-L1_CACHE_SHIFT, ASM_ATOMIC_HASH_SIZE_SHIFT, %r20
> +#else
> +	extru	%r26, 31-L1_CACHE_SHIFT, ASM_ATOMIC_HASH_SIZE_SHIFT, %r20
> +#endif
> +	shladd,l %r20, ASM_ATOMIC_HASH_ENTRY_SHIFT, %r28, %r20
>  
> -	/* Find lock to use, the hash is either one of 0 to
> -	   15, multiplied by 16 (keep it 16-byte aligned)
> -	   and add to the lock table offset. */
> -	shlw	%r20, 4, %r20
> -	add	%r20, %r28, %r20
>  
>  # if ENABLE_LWS_DEBUG
>  	/*	
> @@ -672,31 +668,6 @@ ENTRY(sys_call_table64)
>  END(sys_call_table64)
>  #endif
>  
> -#ifdef CONFIG_SMP
> -	/*
> -		All light-weight-syscall atomic operations 
> -		will use this set of locks 
> -
> -		NOTE: The lws_lock_start symbol must be
> -		at least 16-byte aligned for safe use
> -		with ldcw.
> -	*/
> -	.section .data
> -	.align	PAGE_SIZE
> -ENTRY(lws_lock_start)
> -	/* lws locks */
> -	.rept 16
> -	/* Keep locks aligned at 16-bytes */
> -	.word 1
> -	.word 0 
> -	.word 0
> -	.word 0
> -	.endr
> -END(lws_lock_start)
> -	.previous
> -#endif
> -/* CONFIG_SMP for lws_lock_start */
> -
>  .end
>  
>  
> diff --git a/arch/parisc/lib/bitops.c b/arch/parisc/lib/bitops.c
> index 353963d..bae6a86 100644
> --- a/arch/parisc/lib/bitops.c
> +++ b/arch/parisc/lib/bitops.c
> @@ -15,6 +15,9 @@
>  arch_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned = {
>  	[0 ... (ATOMIC_HASH_SIZE-1)]  = __ARCH_SPIN_LOCK_UNLOCKED
>  };
> +arch_spinlock_t __atomic_user_hash[ATOMIC_HASH_SIZE] __lock_aligned = {
> +	[0 ... (ATOMIC_HASH_SIZE-1)]  = __ARCH_SPIN_LOCK_UNLOCKED
> +};
>  #endif
>  
>  #ifdef CONFIG_64BIT
> diff --git a/kernel/fork.c b/kernel/fork.c
> index f88bd98..108b1ed 100644
> --- a/kernel/fork.c
> +++ b/kernel/fork.c
> @@ -608,7 +608,10 @@ void mm_release(struct task_struct *tsk, struct mm_struct *mm)
>  			 * We don't check the error code - if userspace has
>  			 * not set up a proper pointer then tough luck.
>  			 */
> +			unsigned long flags;
> +			_atomic_spin_lock_irqsave_user(tsk->clear_child_tid, flags);
>  			put_user(0, tsk->clear_child_tid);
> +			_atomic_spin_unlock_irqrestore_user(tsk->clear_child_tid, flags);
>  			sys_futex(tsk->clear_child_tid, FUTEX_WAKE,
>  					1, NULL, NULL, 0);
>  		}
> @@ -1432,8 +1435,12 @@ long do_fork(unsigned long clone_flags,
>  
>  		nr = task_pid_vnr(p);
>  
> -		if (clone_flags & CLONE_PARENT_SETTID)
> +		if (clone_flags & CLONE_PARENT_SETTID) {
> +			unsigned long flags;
> +			_atomic_spin_lock_irqsave_user(parent_tidptr, flags);
>  			put_user(nr, parent_tidptr);
> +			_atomic_spin_unlock_irqrestore_user(parent_tidptr, flags);
> +		}
>  
>  		if (clone_flags & CLONE_VFORK) {
>  			p->vfork_done = &vfork;


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

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

* Re: futex wait failure
  2010-03-07 17:12                                       ` John David Anglin
@ 2010-03-07 20:32                                         ` John David Anglin
  2010-03-11  3:20                                           ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2010-03-07 20:32 UTC (permalink / raw)
  To: dave.anglin; +Cc: deller, carlos, kyle, linux-parisc

> The c3750 completed a full GCC build but there were again problems running
> the testsuite.  For example,
> 
> Core was generated by `expect -- /usr/share/dejagnu/runtest.exp --tool gcc'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x409fa258 in ?? () from /usr/lib/libtcl8.5.so.0
> (gdb) bt
> #0  0x409fa258 in ?? () from /usr/lib/libtcl8.5.so.0
> #1  0x402600a0 in start_thread (arg=0x416a4480) at pthread_create.c:302
> #2  0x40e25874 in clone ()
>     at ../ports/sysdeps/unix/sysv/linux/hppa/nptl/../clone.S:166
> #3  0x00000000 in ?? ()
> 
> This looks like the minifail clone bug.  On the otherhand, minifail doesn't
> seem to be failing.

I reverted Helge's patch and still get the same fault, so it didn't
introduce the problem.

Prior to 2.6.33, I was running 2.6.31.12 with essentially the same config.
The libc6 update to 2.10.2-6 changed things on the c3750.  Prior to the
update, expect would hang several times running the acats testsuite.  After
the update, this was fixed.  However, the above problem was introduced,
or became more frequent.

I have the feeling that Helge's patch helps (possible resolves) the
minifail bug.

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

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

* Re: futex wait failure
  2010-03-07 20:32                                         ` John David Anglin
@ 2010-03-11  3:20                                           ` John David Anglin
  2010-03-11 13:54                                             ` Kyle McMartin
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2010-03-11  3:20 UTC (permalink / raw)
  To: dave.anglin; +Cc: deller, carlos, kyle, linux-parisc

On Sun, 07 Mar 2010, John David Anglin wrote:

> I have the feeling that Helge's patch helps (possible resolves) the
> minifail bug.

With further testing, I find that the patch doesn't resolve the minifail
fails on my c3750.

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

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

* Re: futex wait failure
  2010-03-11  3:20                                           ` John David Anglin
@ 2010-03-11 13:54                                             ` Kyle McMartin
  2010-03-11 22:40                                               ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Kyle McMartin @ 2010-03-11 13:54 UTC (permalink / raw)
  To: John David Anglin; +Cc: deller, carlos, kyle, linux-parisc

On Wed, Mar 10, 2010 at 10:20:49PM -0500, John David Anglin wrote:
> > I have the feeling that Helge's patch helps (possible resolves) the
> > minifail bug.
> 
> With further testing, I find that the patch doesn't resolve the minifail
> fails on my c3750.
> 

Bummer. :(

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

* Re: futex wait failure
  2010-03-11 13:54                                             ` Kyle McMartin
@ 2010-03-11 22:40                                               ` John David Anglin
  2010-03-11 23:32                                                 ` John David Anglin
  2010-03-13  2:06                                                 ` John David Anglin
  0 siblings, 2 replies; 194+ messages in thread
From: John David Anglin @ 2010-03-11 22:40 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: John David Anglin, deller, carlos, linux-parisc

On Thu, 11 Mar 2010, Kyle McMartin wrote:

> On Wed, Mar 10, 2010 at 10:20:49PM -0500, John David Anglin wrote:
> > > I have the feeling that Helge's patch helps (possible resolves) the
> > > minifail bug.
> > 
> > With further testing, I find that the patch doesn't resolve the minifail
> > fails on my c3750.
> > 
> 
> Bummer. :(

Yes.

I am 95% certain that the bug has to do with the clone implementation
and scheduling.  I have attached another version of the minifail test.
The loops after the fork and pthread_create calls are to isolate these
syscalls.  Typically, I see something like:

Core was generated by `./minifail9s'.
Program terminated with signal 11, Segmentation fault.
#0  0x00000000 in ?? ()
(gdb) info thread
  2 Thread 11537  pure_test () at minifail9.cpp:51
* 1 Thread 11538  0x00000000 in ?? ()

Thread 2 is in the pure_test loop after the fork call.

The cause of the failure is not at all obvious to me but I am a
bit concerned about the sys_clone implementation.  Is it possible
that the struct pt_regs gets clobbered?

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

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

* Re: futex wait failure
  2010-03-11 22:40                                               ` John David Anglin
@ 2010-03-11 23:32                                                 ` John David Anglin
  2010-03-13  2:06                                                 ` John David Anglin
  1 sibling, 0 replies; 194+ messages in thread
From: John David Anglin @ 2010-03-11 23:32 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: John David Anglin, deller, carlos, linux-parisc

[-- Attachment #1: Type: text/plain, Size: 488 bytes --]

On Thu, 11 Mar 2010, John David Anglin wrote:

> I am 95% certain that the bug has to do with the clone implementation
> and scheduling.  I have attached another version of the minifail test.
> The loops after the fork and pthread_create calls are to isolate these
> syscalls.  Typically, I see something like:

Attached.

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

[-- Attachment #2: minifail9.cpp --]
[-- Type: text/plain, Size: 1352 bytes --]

#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

/*
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561203

  clone(child_stack=0x4088d040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x4108c4e8, tls=0x4108c900, child_tidptr=0x4108c4e8) = 14819
[pid 14819] set_robust_list(0x4108c4f0, 0xc) = 0
[pid 14818] clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x40002028) = 14820

 g++  minifail.cpp -o minifail -O0 -pthread -g

 i=0; while true; do i=$(($i+1)); echo Run $i; ./minifail; done;

 */

static volatile int run = 1;

void* thread_run(void* arg) {
	static long status;
	int i;
        
	run = 1;
	pthread_yield();
	for (i = 10000000; i; i--)
	   continue;
	write(1,"Thread OK.\n",11);
	return (void *)&status;
}

int pure_test() {
	int i;
	pthread_t thread;
	pthread_create(&thread, NULL, thread_run, NULL);

	while (!run)
	  pthread_yield();
	switch (fork()) {
		case -1:
			perror("fork() failed");
		case 0:
			write(1,"Child OK.\n",10);
			_exit(0);
		default:
			break;
		
	}
	pthread_yield();
	for (i = 20000000; i; i--)
	  continue;
	write(1,"Fork done\n",10);
	pthread_join(thread, NULL);
	return 0;
}

int main(int argc, char** argv) {
	return pure_test();
}

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

* Re: futex wait failure
  2010-03-11 22:40                                               ` John David Anglin
  2010-03-11 23:32                                                 ` John David Anglin
@ 2010-03-13  2:06                                                 ` John David Anglin
  2010-03-15  1:10                                                   ` John David Anglin
  1 sibling, 1 reply; 194+ messages in thread
From: John David Anglin @ 2010-03-13  2:06 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: John David Anglin, deller, carlos, linux-parisc

On Thu, 11 Mar 2010, John David Anglin wrote:

> I am 95% certain that the bug has to do with the clone implementation
> and scheduling.  I have attached another version of the minifail test.
> The loops after the fork and pthread_create calls are to isolate these
> syscalls.  Typically, I see something like:

Here's another idea.  In entry.S, there are some tricky tests to determine
whether to do signals and reschedule.  Based on testing, I'm not sure
that cr30 is always valid (e.g., external interrupt at boot) when we get to
intr_check_resched and intr_check_sig.

The other issue is r16.  I'm thinking we may need to reload r16 as the
context may change if we schedule, etc.  If this checking is broken, it
would break the LWS assumptions.

Thoughts?

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

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

* Re: futex wait failure
  2010-03-13  2:06                                                 ` John David Anglin
@ 2010-03-15  1:10                                                   ` John David Anglin
  2010-03-16 11:49                                                     ` Carlos O'Donell
  0 siblings, 1 reply; 194+ messages in thread
From: John David Anglin @ 2010-03-15  1:10 UTC (permalink / raw)
  To: Kyle McMartin; +Cc: John David Anglin, deller, carlos, linux-parisc

On Fri, 12 Mar 2010, John David Anglin wrote:

> The other issue is r16.  I'm thinking we may need to reload r16 as the
> context may change if we schedule, etc.  If this checking is broken, it
> would break the LWS assumptions.

This theory is shotdown.  The patch below possibly helps a bit but it
doesn't resolve the minifail bug.  The intention of the last couple of
hunks is to return to the right place if cr30 changes as a result of
scheduling.

With more debugging, it seems that this is a clone mmap copy issue.
Normally, the forked child doesn't see any non-zero data in the
stack region allocated by pthread_create.  However, if it does, 
the thread invariably dies and the stack region is corrupt after
the fork.

I guess I said this before ;(

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

diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
index 3a44f7f..820d6ca 100644
--- a/arch/parisc/kernel/entry.S
+++ b/arch/parisc/kernel/entry.S
@@ -758,6 +758,10 @@ ENTRY(__kernel_thread)
 
 	STREG	%r22, PT_GR22(%r1)	/* save r22 (arg5) */
 	copy	%r0, %r22		/* user_tid */
+	copy	%r0, %r21		/* child_tid */
+#else
+	stw	%r0, -52(%r30)	     	/* user_tid */
+	stw	%r0, -56(%r30)	     	/* child_tid */
 #endif
 	STREG	%r26, PT_GR26(%r1)  /* Store function & argument for child */
 	STREG	%r25, PT_GR25(%r1)
@@ -765,7 +769,7 @@ ENTRY(__kernel_thread)
 	ldo	CLONE_VM(%r26), %r26   /* Force CLONE_VM since only init_mm */
 	or	%r26, %r24, %r26      /* will have kernel mappings.	 */
 	ldi	1, %r25			/* stack_start, signals kernel thread */
-	stw	%r0, -52(%r30)	     	/* user_tid */
+	ldi	0, %r23			/* child_stack_size */
 #ifdef CONFIG_64BIT
 	ldo	-16(%r30),%r29		/* Reference param save area */
 #endif
@@ -972,7 +976,10 @@ intr_check_sig:
 	BL	do_notify_resume,%r2
 	copy	%r16, %r26			/* struct pt_regs *regs */
 
-	b,n	intr_check_sig
+	mfctl   %cr30,%r16		/* Reload */
+	LDREG	TI_TASK(%r16), %r16	/* thread_info -> task_struct */
+	b	intr_check_sig
+	ldo	TASK_REGS(%r16),%r16
 
 intr_restore:
 	copy            %r16,%r29
@@ -1026,14 +1033,12 @@ intr_do_resched:
 	ldo	-16(%r30),%r29		/* Reference param save area */
 #endif
 
-	ldil	L%intr_check_sig, %r2
-#ifndef CONFIG_64BIT
-	b	schedule
-#else
-	load32	schedule, %r20
-	bv	%r0(%r20)
-#endif
-	ldo	R%intr_check_sig(%r2), %r2
+	BL	schedule,%r2
+	nop
+	mfctl   %cr30,%r16		/* Reload */
+	LDREG	TI_TASK(%r16), %r16	/* thread_info -> task_struct */
+	b	intr_check_sig
+	ldo	TASK_REGS(%r16),%r16
 
 	/* preempt the current task on returning to kernel
 	 * mode from an interrupt, iff need_resched is set,

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

* Re: futex wait failure
  2010-03-15  1:10                                                   ` John David Anglin
@ 2010-03-16 11:49                                                     ` Carlos O'Donell
  2010-03-21 18:19                                                       ` John David Anglin
  0 siblings, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2010-03-16 11:49 UTC (permalink / raw)
  To: John David Anglin; +Cc: Kyle McMartin, deller, linux-parisc

On Sun, Mar 14, 2010 at 9:10 PM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
> On Fri, 12 Mar 2010, John David Anglin wrote:
>
>> The other issue is r16. =A0I'm thinking we may need to reload r16 as=
 the
>> context may change if we schedule, etc. =A0If this checking is broke=
n, it
>> would break the LWS assumptions.
>
> This theory is shotdown. =A0The patch below possibly helps a bit but =
it
> doesn't resolve the minifail bug. =A0The intention of the last couple=
 of
> hunks is to return to the right place if cr30 changes as a result of
> scheduling.

Thanks for testing this out.

> With more debugging, it seems that this is a clone mmap copy issue.
> Normally, the forked child doesn't see any non-zero data in the
> stack region allocated by pthread_create. =A0However, if it does,
> the thread invariably dies and the stack region is corrupt after
> the fork.
>
> I guess I said this before ;(

After some of my own testing I think this is all MMU related, but I
can't prove it yet. I'm pouring through as much kernel code as I can
right now to determine what is going wrong at the time of the clone,
and I see at least one bug that I'm investigating regarding return
addresses.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2010-03-16 11:49                                                     ` Carlos O'Donell
@ 2010-03-21 18:19                                                       ` John David Anglin
  2010-03-22 14:26                                                         ` Carlos O'Donell
  2010-03-23 21:32                                                         ` Carlos O'Donell
  0 siblings, 2 replies; 194+ messages in thread
From: John David Anglin @ 2010-03-21 18:19 UTC (permalink / raw)
  To: Carlos O'Donell
  Cc: John David Anglin, Kyle McMartin, deller, linux-parisc

[-- Attachment #1: Type: text/plain, Size: 2064 bytes --]

On Tue, 16 Mar 2010, Carlos O'Donell wrote:

> After some of my own testing I think this is all MMU related, but I
> can't prove it yet. I'm pouring through as much kernel code as I can
> right now to determine what is going wrong at the time of the clone,
> and I see at least one bug that I'm investigating regarding return
> addresses.

I've attached another version of the minifail test program.  In
this one, the parent and thread both monitor the location 0x4000001c
in the stack region allocated to the thread.  If a problem is
detected, they drop core with an illegal instruction.  If the
child of the fork sees a nonzero value in the above location
when the fork call returns, it sleeps for ten seconds.

When corruption occurs and core is dropped on my c3750 (UP 32-bit
kernel), both the parent and thread have undergone many iterations
of their respective monitor loops.  The forked child always reports
seeing a nonzero value at the stack location.  The before value
in the core dump was zero (i.e., thread_run had not started).

I added an illegal instruction abort to the child.  In this case,
the thread_run loop counter was 48085 when the page was copied and
the before value was zero.

One thought that has crossed my mind is that the memory pages allocated
for the stack region used by the thread are somehow getting interchanged
between parent and child by the fork operation.  This happens fairly
late as both the parent and thread are executing post fork at the time
this happens.  Possibly, this is part of the bug.

I have looked at entry.S and pacache.S quite a bit and it's not obvious
how this could happen, although I must admit to not fully understanding
the tmp alias code.  I tend to think the bug is in the core mm code.

I see a few cleanups to entry.S.  We didn't kill the misnamed macros
(DEP, DEPI and EXTR) for example.  But I don't think these are the problem.

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

[-- Attachment #2: minifail12.cpp --]
[-- Type: text/plain, Size: 1817 bytes --]

#include <pthread.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>

/*
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561203

  clone(child_stack=0x4088d040, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x4108c4e8, tls=0x4108c900, child_tidptr=0x4108c4e8) = 14819
[pid 14819] set_robust_list(0x4108c4f0, 0xc) = 0
[pid 14818] clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x40002028) = 14820

 g++  minifail.cpp -o minifail -O0 -pthread -g

 i=0; while true; do i=$(($i+1)); echo Run $i; ./minifail; done;

 */

int before = -1;

void* thread_run(void* arg) {
	static long status;
	int i;
        
	for (i = 1000000; i; i--)
	  if (*(volatile int *)0x4000001c != 0x407ff340)
	    asm ("iitlbp %r0,(%sr0,%r0)");
	return (void *)&status;
}

int pure_test() {
	int i, stat, x;
	int seen = 0;
	pthread_t thread;
	pthread_create(&thread, NULL, thread_run, NULL);

	before = *(volatile int *)0x4000001c;
	switch (fork()) {
		case -1:
			perror("fork() failed");
		case 0:
			/* x is non-zero iff start thread has saved
			     `args' onto stack in r26 slot.  */
			x = *(volatile int *)0x4000001c;
			if (x == 0x407ff340)
			  {
				sleep (10);
			  }
			printf ("c 0x%x\n", x);
			fflush (stdout);
			return 0;
		default:
			break;
		
	}
	for (i = 1000000; i; i--)
	  {
	    if (!seen && *(volatile int *)0x4000001c == 0x407ff340)
	      seen = i;
	    if (seen && *(volatile int *)0x4000001c != 0x407ff340)
	      asm ("iitlbp %r0,(%sr0,%r0)");
	  }
	printf ("p 0x%x\n", *(int *)0x4000001c);
	if (pthread_join(thread, NULL))
	  perror ("join");
	return 0;
}

int main(int argc, char** argv) {
	return pure_test();
}

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

* Re: futex wait failure
  2010-03-21 18:19                                                       ` John David Anglin
@ 2010-03-22 14:26                                                         ` Carlos O'Donell
  2010-03-23 21:32                                                         ` Carlos O'Donell
  1 sibling, 0 replies; 194+ messages in thread
From: Carlos O'Donell @ 2010-03-22 14:26 UTC (permalink / raw)
  To: John David Anglin; +Cc: Kyle McMartin, deller, linux-parisc

On Sun, Mar 21, 2010 at 2:19 PM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
> I added an illegal instruction abort to the child. =A0In this case,
> the thread_run loop counter was 48085 when the page was copied and
> the before value was zero.
>
> One thought that has crossed my mind is that the memory pages allocat=
ed
> for the stack region used by the thread are somehow getting interchan=
ged
> between parent and child by the fork operation. =A0This happens fairl=
y
> late as both the parent and thread are executing post fork at the tim=
e
> this happens. =A0Possibly, this is part of the bug.
>
> I have looked at entry.S and pacache.S quite a bit and it's not obvio=
us
> how this could happen, although I must admit to not fully understandi=
ng
> the tmp alias code. =A0I tend to think the bug is in the core mm code=
=2E
>
> I see a few cleanups to entry.S. =A0We didn't kill the misnamed macro=
s
> (DEP, DEPI and EXTR) for example. =A0But I don't think these are the =
problem.

Dave,

Thank you for another test case. I agree, I also think the bug is in
the core mm code, which I am also trying to review and understand. I
haven't been able to make much progress in this area though. I'll keep
you updated when I spot something I think is wrong.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2010-03-21 18:19                                                       ` John David Anglin
  2010-03-22 14:26                                                         ` Carlos O'Donell
@ 2010-03-23 21:32                                                         ` Carlos O'Donell
  2010-03-23 22:23                                                           ` John David Anglin
  1 sibling, 1 reply; 194+ messages in thread
From: Carlos O'Donell @ 2010-03-23 21:32 UTC (permalink / raw)
  To: John David Anglin; +Cc: Kyle McMartin, deller, linux-parisc

On Sun, Mar 21, 2010 at 2:19 PM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
> One thought that has crossed my mind is that the memory pages allocat=
ed
> for the stack region used by the thread are somehow getting interchan=
ged
> between parent and child by the fork operation. =A0This happens fairl=
y
> late as both the parent and thread are executing post fork at the tim=
e
> this happens. =A0Possibly, this is part of the bug.
>
> I have looked at entry.S and pacache.S quite a bit and it's not obvio=
us
> how this could happen, although I must admit to not fully understandi=
ng
> the tmp alias code. =A0I tend to think the bug is in the core mm code=
=2E
>
> I see a few cleanups to entry.S. =A0We didn't kill the misnamed macro=
s
> (DEP, DEPI and EXTR) for example. =A0But I don't think these are the =
problem.

I can't get minifail2 to fail, how are you choosing which stack
address to watch for corruption?

Are you looking at the child's new stack created by mmap?

Are you looking at the parent's stack?

I found one bug in the hppa vfork() function call, which in the case
of error, would fail to propagate the error correctly. Fixing that and
will check it in. It doesn't account for the vfork/execve problems
though, since in this case vfork completes but execve crashes.

I also have some patches for asm-offsets.c, and entry.S to comment
some of the code better. I'll send those to Kyle after cleanup.

Cheers,
Carlos.
--
To unsubscribe from this list: send the line "unsubscribe linux-parisc"=
 in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: futex wait failure
  2010-03-23 21:32                                                         ` Carlos O'Donell
@ 2010-03-23 22:23                                                           ` John David Anglin
  0 siblings, 0 replies; 194+ messages in thread
From: John David Anglin @ 2010-03-23 22:23 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: dave.anglin, kyle, deller, linux-parisc

> I can't get minifail2 to fail, how are you choosing which stack
> address to watch for corruption?

The stack allocated by pthread_create is always placed at 0x40000000
in my runs.  The location that the last version which I sent monitors
is 0x4000001c.  This is the location where thread_run saves %r26
shortly after entry.

I'm compiling without optimization as indicated in the comment.  Usually,
I also link with -static since gdb is somewhat broken when debugging
shared libraries.  If the compile is optimized, then thread_run may
not save much on the stack and it may be harder to get it to fail.

The problem is timing dependent.  I'm a bit surprised that you can't
duplicate the problem as Helge could.  When I run the test loop, it
fails about one in thirty on my c3750.  I have a 250 Hz tick rate in
my config.  The fail rate is somewhat dependent on system load.

I added the monitor loops to try and pin down when the corruption occurs
but the test should fail if the thread's stack region gets corrupted
while thread_run executes.

Have you made any changes to libc which would affect the synchonization
of parent and child?  I think the problem might be fixed if the parent
and thread were prevented from executing until the fork is complete.
I still think the kernel is interchanging the pages used by the parent
and child for the mmap'd stack region.

> Are you looking at the child's new stack created by mmap?

We are looking at the area allocated by mmap in the call to pthread_create.
This is always where the corruption occurs in the subsequent fork call.

This area is used as the stack for the thread created by pthread_create.
When the problem occurs, it's the thread that generates the fault, never
the original parent.

> Are you looking at the parent's stack?

No.  However, the parent can see changes to the stack area used by the
thread created by the pthread_create call.  As I understand the situtation,
the child of the fork call should see a snapshot of this area as it was
at the time of the fork call.  fork is nominally supposed to be "atomic"
(see Open Group man page).

In both the parent and forked child, the first three words starting at
0x40000000 are always nonzero and correct.  That's why I think the pages
are getting interchanged (I also played with adding extra cache flushes
in pacache.S but that didn't change things).

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

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

end of thread, other threads:[~2010-03-23 22:23 UTC | newest]

Thread overview: 194+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <no.id>
1999-06-10 18:32 ` [parisc-linux] booting problems Stan Sieler
1999-06-21 17:03 ` Hack to head.S John David Anglin
1999-06-21 19:38 ` John David Anglin
2000-10-11 20:11 ` [parisc-linux] __hp9000s700 predefined John David Anglin
2000-11-09 17:39 ` testcase for hppa64 gcc bug John David Anglin
2000-12-06  4:12   ` Jeffrey A Law
2000-12-06  4:14     ` John David Anglin
2000-12-06  5:28       ` Alan Modra
2001-02-01  1:19         ` [parisc-linux] " Jeffrey A Law
2000-11-09 23:57 ` abort in eliminate_regs compiling glob.c from glibc John David Anglin
2000-11-10  0:36   ` Alan Modra
2000-11-10  2:50     ` John David Anglin
2000-11-14 21:40   ` John David Anglin
2001-01-27 20:12     ` Richard Henderson
2000-12-14  0:48 ` pa reload problem John David Anglin
2000-12-14  3:43   ` Jeffrey A Law
2000-12-14 16:40     ` John David Anglin
2000-12-27 20:08       ` Jeffrey A Law
2000-12-28  5:18         ` John David Anglin
2000-12-16 20:38     ` [parisc-linux] PATCH: Adjust label usage count for new insns [was Re: pa reload problem] John David Anglin
2001-01-02  9:51       ` Jeffrey A Law
2002-01-07 18:39 ` [parisc-linux] PIC assembly John David Anglin
2002-01-09  1:05   ` Grant Grundler
2002-01-11 20:45     ` Grant Grundler
2002-07-15 17:21 ` [parisc-linux] compiling kernels with gcc-3.1 John David Anglin
2002-07-15 17:32   ` Randolph Chung
2002-07-15 17:43     ` Matthew Wilcox
2002-07-15 18:18       ` John David Anglin
2002-07-16  9:02   ` joel.soete
2002-07-16 17:01 ` [parisc-linux] gcc-3.[02] alignment problem John David Anglin
2002-07-16 17:01 ` John David Anglin
2002-07-16 17:22   ` Randolph Chung
2002-07-16 17:22   ` Randolph Chung
2002-07-16 17:24     ` Matthew Wilcox
2002-07-17  3:19       ` Randolph Chung
2002-07-17  3:19       ` Randolph Chung
2002-07-16 17:24     ` Matthew Wilcox
2002-07-16 20:21     ` Richard Henderson
2002-07-16 20:21     ` Richard Henderson
2002-07-16 17:27 ` [parisc-linux] gcc-3.2 bootstrap? John David Anglin
2003-01-31 21:27 ` [parisc-linux] PATCH hppa ordered load absolute ops John David Anglin
2003-01-31 21:27 ` John David Anglin
2003-08-31 19:10 ` [parisc-linux] Re: [glibc] tststatic failues, reduced to simp le testcase John David Anglin
2003-08-31 20:22   ` Carlos O'Donell
2003-08-31 20:47     ` John David Anglin
2003-09-01  6:05       ` Carlos O'Donell
2003-12-15 22:05 ` [parisc-linux] dlopen failed on 'libthread_db.so.1' - /lib/libthread_db.so.1: undefined symbol: ps_pglobal_lookup John David Anglin
2003-12-17 15:32   ` [parisc-linux] " Carlos O'Donell
2003-12-17 15:53     ` Carlos O'Donell
2003-12-17 16:43       ` [parisc-linux] Re: dlopen failed on 'libthread_db.so.1' - John David Anglin
2003-12-17 18:35         ` Carlos O'Donell
2003-12-18  0:21           ` John David Anglin
2003-12-18  0:32 ` John David Anglin
2003-12-18  0:42   ` [parisc-linux] Re: dlopen failed on 'libthread_db.so.1' -g John David Anglin
2004-01-07 21:14 ` [parisc-linux] [Testers wanted] New glibc with profiling fixed John David Anglin
2004-01-07 21:14 ` John David Anglin
2004-08-31  4:23 ` [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please test John David Anglin
2004-08-31 20:43   ` [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please te John David Anglin
2004-09-01 20:08     ` John David Anglin
2004-09-11  7:24       ` [parisc-linux] Another SIGSEGV, this time in /bin/sh John David Anglin
2004-09-13 15:01         ` [parisc-linux] " Carlos O'Donell
2004-09-02  6:29     ` [parisc-linux] Re: linux signal race fixes, patches against hppa tree, please te Carlos O'Donell
2005-03-05 21:53 ` [parisc-linux] Re: Comments? John David Anglin
2005-03-06  0:22   ` John David Anglin
2005-03-08 17:32     ` Carlos O'Donell
2005-03-08 17:44       ` John David Anglin
2005-03-08 17:54         ` Carlos O'Donell
2005-03-08 19:02           ` John David Anglin
2005-03-08 21:08             ` [parisc-linux] OPD's on hppa-linux, and what to do about __cffc's fragility Carlos O'Donell
2005-03-08 21:48               ` [parisc-linux] " John David Anglin
2005-03-08 21:52                 ` John David Anglin
2005-03-08 22:25               ` Alan Modra
2005-03-10 15:31                 ` Carlos O'Donell
2005-03-10 22:27                   ` Alan Modra
2005-03-11 18:05                     ` [parisc-linux] Solution to OPD's in hppa-linux, including a transition plan? Carlos O'Donell
2005-03-12  0:49                       ` [parisc-linux] " John David Anglin
     [not found]                         ` <20050315220842.GC22872@baldric.uwo.ca>
     [not found]                           ` <20050315224142.GC21148@bubble.modra.org>
2005-03-16 20:36                             ` Carlos O'Donell
2005-03-16 23:54                               ` Alan Modra
     [not found]                           ` <200503160410.j2G4ALcu021219@hiauly1.hia.nrc.ca>
2005-03-16 21:37                             ` Carlos O'Donell
2005-03-17  3:51                               ` John David Anglin
2005-07-16  2:55 ` [parisc-linux] Re: Non-inline math, and inline math broken, GCC to blame? (1 hppa tls toolchain regression) John David Anglin
2005-07-16 16:16   ` Carlos O'Donell
2005-07-16 17:37     ` John David Anglin
2005-07-16 17:54       ` John David Anglin
2005-07-16 19:41         ` Carlos O'Donell
2005-07-16 19:56           ` John David Anglin
2005-07-16 19:15       ` Carlos O'Donell
2005-08-16  3:32 ` [parisc-linux] Re: gsyprf11 and 2.6.13-rc3-pa1 John David Anglin
2005-12-26 19:58 ` [parisc-linux] strtold John David Anglin
2006-01-07 21:07   ` [parisc-linux] strtold Carlos O'Donell
2006-01-07 22:41     ` John David Anglin
2006-01-07 23:42       ` Carlos O'Donell
2006-01-07 23:49         ` John David Anglin
2006-01-07 23:56         ` John David Anglin
2006-01-08  4:28         ` Grant Grundler
2005-12-26 21:54 ` [parisc-linux] Re: nscd: error while loading shared libraries: unexpected reloc type 0x42 John David Anglin
2006-01-07 23:53   ` Carlos O'Donell
2006-01-08  0:16     ` [parisc-linux] Re: nscd: error while loading shared libraries: John David Anglin
2006-02-04 23:41 ` [parisc-linux] long double on hppa64-*-linux* John David Anglin
2006-02-05  0:45   ` Grant Grundler
2006-02-05  3:42     ` John David Anglin
2006-03-12 20:15 ` [parisc-linux] Re: gcj can't make shared libs on hppa John David Anglin
2006-03-13 14:24   ` Carlos O'Donell
2006-03-13 20:50     ` John David Anglin
2006-06-09  0:56 ` [parisc-linux] User space locks -- what's wrong John David Anglin
2007-01-03  1:41 ` [parisc-linux] Re: PA8800 Status (Happy New Year) John David Anglin
2007-01-03  4:24 ` John David Anglin
2007-02-17 20:32 ` [parisc-linux] Re: call_init in libc6 2.3.6.ds1-11 John David Anglin
2007-09-04  1:19 ` [parisc-linux] 2.6.23-rc5 warnings John David Anglin
2008-08-23 16:48 ` X won't start with VisEG and 2.6.22.19 John David Anglin
2008-08-24 10:35   ` Helge Deller
2008-08-24 14:09     ` John David Anglin
2008-08-24 14:38       ` Helge Deller
2009-05-03  0:48 ` Kernel Panic during init with 2.6.29-gb609308 (fresh clone of git John David Anglin
2009-08-23 21:21 ` Reproducible random python crash John David Anglin
2009-12-23 22:18 ` futex wait failure John David Anglin
2009-12-24  2:22   ` Carlos O'Donell
2009-12-28 18:59     ` John David Anglin
2009-12-29 13:47       ` Helge Deller
2009-12-29 15:00         ` John David Anglin
2009-12-30 10:49           ` Randolph Chung
2009-12-31 18:14         ` Carlos O'Donell
2009-12-31 19:11           ` Helge Deller
2010-01-01  3:49             ` John David Anglin
2010-01-01  5:02               ` John David Anglin
2010-01-04 16:27               ` Helge Deller
2010-01-04 17:16                 ` Carlos O'Donell
2010-01-04 18:11                   ` John David Anglin
2010-01-04 18:29                     ` John David Anglin
2010-01-04 20:51                     ` Helge Deller
2010-01-04 21:39                       ` John David Anglin
2010-01-05 22:27                       ` John David Anglin
2010-01-06 23:33                         ` John David Anglin
2010-01-07 16:13                           ` Helge Deller
2010-01-08 16:37                             ` John David Anglin
2010-01-08 21:17                               ` John David Anglin
2010-02-02 21:16                                 ` Helge Deller
2010-02-03  3:44                                   ` John David Anglin
2010-02-03 22:03                                     ` Helge Deller
2010-03-07 17:12                                       ` John David Anglin
2010-03-07 20:32                                         ` John David Anglin
2010-03-11  3:20                                           ` John David Anglin
2010-03-11 13:54                                             ` Kyle McMartin
2010-03-11 22:40                                               ` John David Anglin
2010-03-11 23:32                                                 ` John David Anglin
2010-03-13  2:06                                                 ` John David Anglin
2010-03-15  1:10                                                   ` John David Anglin
2010-03-16 11:49                                                     ` Carlos O'Donell
2010-03-21 18:19                                                       ` John David Anglin
2010-03-22 14:26                                                         ` Carlos O'Donell
2010-03-23 21:32                                                         ` Carlos O'Donell
2010-03-23 22:23                                                           ` John David Anglin
2010-02-03 22:44                                   ` Carlos O'Donell
2010-01-08 21:18                               ` Helge Deller
2010-01-08 21:43                                 ` John David Anglin
2010-01-08 21:44                                 ` Carlos O'Donell
2010-01-08 21:44                                   ` Carlos O'Donell
2010-01-08 21:56                                     ` Kyle McMartin
2010-01-08 22:28                                       ` John David Anglin
2010-01-08 22:33                                         ` Kyle McMartin
2010-01-08 22:31                                     ` John David Anglin
2010-01-16 23:17                                   ` Helge Deller
2010-01-18 15:50                                     ` John David Anglin
2010-01-18 20:44                                     ` John David Anglin
2010-01-18 20:49                                       ` Carlos O'Donell
2010-01-29 17:53                                     ` Carlos O'Donell
2010-01-31 21:14                                       ` Helge Deller
2010-01-01  0:26                                         ` John David Anglin
2010-02-01 12:58                                           ` Carlos O'Donell
2010-02-01 15:47                                             ` John David Anglin
2010-02-01 19:02                                           ` Helge Deller
2010-02-01 19:11                                             ` John David Anglin
2010-02-01 21:36                                               ` Carlos O'Donell
2010-01-04 17:32                 ` John David Anglin
2010-01-04 18:02                   ` Carlos O'Donell
2010-01-04 18:22                     ` John David Anglin
2010-01-04 21:24                 ` Helge Deller
2009-12-31 22:38           ` John David Anglin
2010-01-01  0:36             ` John David Anglin
2009-12-22 15:03 John David Anglin
2009-12-22 15:52 ` Carlos O'Donell
     [not found] <20091222164810.DBF3B516F@hiauly1.hia.nrc.ca>
2009-12-22 20:30 ` Carlos O'Donell
2009-12-22 22:05   ` John David Anglin
2009-12-23 15:01     ` Carlos O'Donell
2009-12-23 16:15       ` John David Anglin
2009-12-23 16:48         ` John David Anglin
2009-12-23 20:39           ` John David Anglin
2009-12-23 20:45             ` Carlos O'Donell
2009-12-23 20:46               ` Carlos O'Donell
2009-12-23 21:08               ` John David Anglin
2009-12-23 21:48                 ` Carlos O'Donell
2009-12-23 20:36         ` Carlos O'Donell
2009-12-23 20:57           ` John David Anglin
     [not found]   ` <20091222212950.8E5F74EA9@hiauly1.hia.nrc.ca>
2009-12-23 14:56     ` Carlos O'Donell

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