[Bug ada/41929] 64-bit null_pointer_deref1 gnat.dg test consumes all available memory

2012-01-09 Thread ebotcazou at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41929

--- Comment #12 from Eric Botcazou ebotcazou at gcc dot gnu.org 2012-01-09 
09:50:26 UTC ---
Author: ebotcazou
Date: Mon Jan  9 09:50:19 2012
New Revision: 183005

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=183005
Log:
PR ada/41929
* config/sparc/sol2-unwind.h (sparc64_is_sighandler): Remove SAVPC and
add CFA.  Revert back to old code for Solaris 8+ multi-threaded.
(sparc_is_sighandler): Likewise.
(MD_FALLBACK_FRAME_STATE_FOR): Adjust call to IS_SIGHANDLER.

Modified:
trunk/libgcc/ChangeLog
trunk/libgcc/config/sparc/sol2-unwind.h


[Bug ada/41929] 64-bit null_pointer_deref1 gnat.dg test consumes all available memory

2012-01-09 Thread ebotcazou at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41929

--- Comment #13 from Eric Botcazou ebotcazou at gcc dot gnu.org 2012-01-09 
09:50:47 UTC ---
Author: ebotcazou
Date: Mon Jan  9 09:50:42 2012
New Revision: 183006

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=183006
Log:
PR ada/41929
* config/sparc/sol2-unwind.h (sparc64_is_sighandler): Remove SAVPC and
add CFA.  Revert back to old code for Solaris 8+ multi-threaded.
(sparc_is_sighandler): Likewise.
(MD_FALLBACK_FRAME_STATE_FOR): Adjust call to IS_SIGHANDLER.

Modified:
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/config/sparc/sol2-unwind.h


[Bug ada/41929] 64-bit null_pointer_deref1 gnat.dg test consumes all available memory

2011-02-14 Thread ro at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41929

--- Comment #10 from Rainer Orth ro at gcc dot gnu.org 2011-02-14 12:32:15 
UTC ---
Author: ro
Date: Mon Feb 14 12:32:11 2011
New Revision: 170126

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=170126
Log:
gcc:
PR ada/41929
* config/sparc/sol2-unwind.h: Include sys/frame.h, sys/stack.h
(IS_SIGHANDLER): Define.
(sparc64_is_sighandler): New function, split off from
sparc64_fallback_frame_state.
(sparc_is_sighandler): New function, split off from
sparc_fallback_frame_state.
(sparc64_fallback_frame_state): Merge with ...
(sparc_fallback_frame_state): ... this into ...
(MD_FALLBACK_FRAME_STATE_FOR): ... this.
Change new_cfa to long.
Remove regs_off, fpu_save_off, fpu_save.
Define nframes, mctx.
Use IS_SIGHANDLER, handler_args, mctx, walk stack instead of
hardcoded offsets.

gcc/testsuite:
PR ada/41929
* gnat.dg/null_pointer_deref1.exp: Don't skip on
sparc*-sun-solaris2.11.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/sparc/sol2-unwind.h
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gnat.dg/null_pointer_deref1.adb


[Bug ada/41929] 64-bit null_pointer_deref1 gnat.dg test consumes all available memory

2011-02-14 Thread ro at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41929

Rainer Orth ro at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED
 AssignedTo|unassigned at gcc dot   |ro at gcc dot gnu.org
   |gnu.org |
   Target Milestone|--- |4.6.0

--- Comment #11 from Rainer Orth ro at gcc dot gnu.org 2011-02-14 12:37:43 
UTC ---
Mine, fixed for 4.6.0, may backport to 4.5 branch.


[Bug ada/41929] 64-bit null_pointer_deref1 gnat.dg test consumes all available memory

2010-01-12 Thread ro at CeBiTec dot Uni-Bielefeld dot DE


--- Comment #9 from ro at CeBiTec dot Uni-Bielefeld dot DE  2010-01-12 
12:08 ---
Subject: Re:  64-bit null_pointer_deref1 gnat.dg test consumes all available
memory

 --- Comment #1 from ebotcazou at gcc dot gnu dot org  2009-11-03 18:49 
 ---
 Somewhat expected, see the comment in the test.  A patch to disable it on this
 platform (sparc*-*-solaris2.11) is pre-approved.

I've just installed that since the bug hit me again and I've not yet
succeeded in the investigation.

 The failure very likely means that the 64-bit pattern matching code of the
 fallback routine in config/sparc/sol2-unwind.h misbehaves for Solaris 11. 
 Unfortunately, I don't have access to any Solaris 11 machine so I cannot fix.

I've checked __sighndlr in the Solaris 11 64-bit libc.so.1 against
sol2-unwind.h (sighndlr_pattern), and they are identical.

 To debug this, you need to recompile libgcc at -O0 -g and put a breakpoint on
 sparc64_fallback_frame_state from within the debugger; it will be hit once you
 resume execution after the SIGSEGV.  What happens from that on?

Unfortunately, it doesn't hit:

(gdb) b sparc64_fallback_frame_state
Breakpoint 1 at 0x100017c88: file
/vol/gcc/src/hg/trunk/solaris/libgcc/../gcc/config/sparc/sol2-unwind.h, line
38.
(gdb) run
Starting program:
/vol/gcc/obj/gcc-4.5.0-20100107/11-gcc/gcc/testsuite/gnat/null_pointer_deref1.exe
 
[Thread debugging using libthread_db enabled]
[New Thread 1 (LWP 1)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1 (LWP 1)]
0x0001000141b0 in _ada_null_pointer_deref1 ()
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x7fff7f8c81d0 in kill () from /lib/64/libc.so.1
(gdb) cont
Continuing.
procfs: couldn't find pid -1 in procinfo list.

So I'm sort of stuck.  dbx doesn't allow me to set a breakpoint in
sparc64_fallback_frame_state at all.

Rainer


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41929



[Bug ada/41929] 64-bit null_pointer_deref1 gnat.dg test consumes all available memory

2010-01-08 Thread ro at gcc dot gnu dot org


--- Comment #8 from ro at gcc dot gnu dot org  2010-01-08 19:03 ---
Subject: Bug 41929

Author: ro
Date: Fri Jan  8 19:02:51 2010
New Revision: 155743

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=155743
Log:
PR ada/41929
* gnat.dg/null_pointer_deref1.adb: Don't run on
sparc*-sun-solaris2.11.

Modified:
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gnat.dg/null_pointer_deref1.adb


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41929



[Bug ada/41929] 64-bit null_pointer_deref1 gnat.dg test consumes all available memory

2009-11-04 Thread rguenth at gcc dot gnu dot org


--- Comment #2 from rguenth at gcc dot gnu dot org  2009-11-04 10:29 ---
I see the same on x86_64-linux


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41929



[Bug ada/41929] 64-bit null_pointer_deref1 gnat.dg test consumes all available memory

2009-11-04 Thread ebotcazou at gcc dot gnu dot org


--- Comment #3 from ebotcazou at gcc dot gnu dot org  2009-11-04 11:19 
---
 I see the same on x86_64-linux

That would be surprising, nothing has changed since they were installed.  Are
you sure it's not gnat.dg/stack_check1.adb instead?  It passes on my machine,
both 32-bit and 64-bit mode, but I can imagine that this may be different on
yours.


-- 

ebotcazou at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu dot
   ||org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41929



[Bug ada/41929] 64-bit null_pointer_deref1 gnat.dg test consumes all available memory

2009-11-04 Thread rguenther at suse dot de


--- Comment #4 from rguenther at suse dot de  2009-11-04 11:49 ---
Subject: Re:  64-bit null_pointer_deref1 gnat.dg test consumes
 all available memory

On Wed, 4 Nov 2009, ebotcazou at gcc dot gnu dot org wrote:

 --- Comment #3 from ebotcazou at gcc dot gnu dot org  2009-11-04 11:19 
 ---
  I see the same on x86_64-linux
 
 That would be surprising, nothing has changed since they were installed.  Are
 you sure it's not gnat.dg/stack_check1.adb instead?  It passes on my machine,
 both 32-bit and 64-bit mode, but I can imagine that this may be different on
 yours.

Running target unix//-m32
FAIL: gnat.dg/null_pointer_deref1.adb execution test

the 64bit variant passes.

the log just states

raised STORAGE_ERROR : stack overflow (or erroneous memory access)

Richard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41929



[Bug ada/41929] 64-bit null_pointer_deref1 gnat.dg test consumes all available memory

2009-11-04 Thread ebotcazou at gcc dot gnu dot org


--- Comment #5 from ebotcazou at gcc dot gnu dot org  2009-11-04 11:57 
---
 Running target unix//-m32
 FAIL: gnat.dg/null_pointer_deref1.adb execution test
 
 the 64bit variant passes.
 
 the log just states
 
 raised STORAGE_ERROR : stack overflow (or erroneous memory access)

OK, thanks for the clarification.  Which kernel do you run?  Does the following
patch help?

Index: config/i386/linux-unwind.h
===
--- config/i386/linux-unwind.h  (revision 153778)
+++ config/i386/linux-unwind.h  (working copy)
@@ -172,6 +172,25 @@ x86_fallback_frame_state (struct _Unwind
   fs-signal_frame = 1;
   return _URC_NO_REASON;
 }
+
+#define MD_FROB_UPDATE_CONTEXT x86_frob_update_context
+
+/* Fix up for kernels that have vDSO, but don't have S flag in it.  */
+
+static void
+x86_frob_update_context (struct _Unwind_Context *context,
+_Unwind_FrameState *fs ATTRIBUTE_UNUSED)
+{
+  unsigned char *pc = context-ra;
+
+  /* movl $__NR_rt_sigreturn,%eax ; {int $0x80 | syscall}  */
+  if (*(unsigned char *)(pc+0) == 0xb8
+   *(unsigned int *)(pc+1) == 173
+   (*(unsigned short *)(pc+5) == 0x80cd
+ || *(unsigned short *)(pc+5) == 0x050f))
+_Unwind_SetSignalFrame (context, 1);
+}
+
 #endif /* not glibc 2.0 */
 #endif /* ifdef __x86_64__  */
 #endif /* ifdef inhibit_libc  */


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41929



[Bug ada/41929] 64-bit null_pointer_deref1 gnat.dg test consumes all available memory

2009-11-04 Thread rguenther at suse dot de


--- Comment #6 from rguenther at suse dot de  2009-11-04 13:12 ---
Subject: Re:  64-bit null_pointer_deref1 gnat.dg test consumes
 all available memory

On Wed, 4 Nov 2009, ebotcazou at gcc dot gnu dot org wrote:

 --- Comment #5 from ebotcazou at gcc dot gnu dot org  2009-11-04 11:57 
 ---
  Running target unix//-m32
  FAIL: gnat.dg/null_pointer_deref1.adb execution test
  
  the 64bit variant passes.
  
  the log just states
  
  raised STORAGE_ERROR : stack overflow (or erroneous memory access)
 
 OK, thanks for the clarification.  Which kernel do you run?  Does the 
 following
 patch help?

I run 2.6.16.42-0.6-smp, that is some old SLES10 kernel.

I'll test if the patch helps.

Richard.

 Index: config/i386/linux-unwind.h
 ===
 --- config/i386/linux-unwind.h  (revision 153778)
 +++ config/i386/linux-unwind.h  (working copy)
 @@ -172,6 +172,25 @@ x86_fallback_frame_state (struct _Unwind
fs-signal_frame = 1;
return _URC_NO_REASON;
  }
 +
 +#define MD_FROB_UPDATE_CONTEXT x86_frob_update_context
 +
 +/* Fix up for kernels that have vDSO, but don't have S flag in it.  */
 +
 +static void
 +x86_frob_update_context (struct _Unwind_Context *context,
 +_Unwind_FrameState *fs ATTRIBUTE_UNUSED)
 +{
 +  unsigned char *pc = context-ra;
 +
 +  /* movl $__NR_rt_sigreturn,%eax ; {int $0x80 | syscall}  */
 +  if (*(unsigned char *)(pc+0) == 0xb8
 +   *(unsigned int *)(pc+1) == 173
 +   (*(unsigned short *)(pc+5) == 0x80cd
 + || *(unsigned short *)(pc+5) == 0x050f))
 +_Unwind_SetSignalFrame (context, 1);
 +}
 +
  #endif /* not glibc 2.0 */
  #endif /* ifdef __x86_64__  */
  #endif /* ifdef inhibit_libc  */
 
 
 


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41929



[Bug ada/41929] 64-bit null_pointer_deref1 gnat.dg test consumes all available memory

2009-11-04 Thread rguenther at suse dot de


--- Comment #7 from rguenther at suse dot de  2009-11-04 21:51 ---
Subject: Re:  64-bit null_pointer_deref1 gnat.dg test consumes
 all available memory

On Wed, 4 Nov 2009, rguenther at suse dot de wrote:

 --- Comment #6 from rguenther at suse dot de  2009-11-04 13:12 ---
 Subject: Re:  64-bit null_pointer_deref1 gnat.dg test consumes
  all available memory
 
 On Wed, 4 Nov 2009, ebotcazou at gcc dot gnu dot org wrote:
 
  --- Comment #5 from ebotcazou at gcc dot gnu dot org  2009-11-04 11:57 
  ---
   Running target unix//-m32
   FAIL: gnat.dg/null_pointer_deref1.adb execution test
   
   the 64bit variant passes.
   
   the log just states
   
   raised STORAGE_ERROR : stack overflow (or erroneous memory access)
  
  OK, thanks for the clarification.  Which kernel do you run?  Does the 
  following
  patch help?
 
 I run 2.6.16.42-0.6-smp, that is some old SLES10 kernel.
 
 I'll test if the patch helps.

It fixed the failure for me.

Richard.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41929



[Bug ada/41929] 64-bit null_pointer_deref1 gnat.dg test consumes all available memory

2009-11-03 Thread ebotcazou at gcc dot gnu dot org


--- Comment #1 from ebotcazou at gcc dot gnu dot org  2009-11-03 18:49 
---
Somewhat expected, see the comment in the test.  A patch to disable it on this
platform (sparc*-*-solaris2.11) is pre-approved.

The failure very likely means that the 64-bit pattern matching code of the
fallback routine in config/sparc/sol2-unwind.h misbehaves for Solaris 11. 
Unfortunately, I don't have access to any Solaris 11 machine so I cannot fix.

To debug this, you need to recompile libgcc at -O0 -g and put a breakpoint on
sparc64_fallback_frame_state from within the debugger; it will be hit once you
resume execution after the SIGSEGV.  What happens from that on?


-- 

ebotcazou at gcc dot gnu dot org changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever Confirmed|0   |1
   Last reconfirmed|-00-00 00:00:00 |2009-11-03 18:49:44
   date||


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41929