public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/29132]  New: [4.2 Regression] Mips exception handling broken.
@ 2006-09-18 20:46 daney at gcc dot gnu dot org
  2006-09-18 21:28 ` [Bug c/29132] " roger at eyesopen dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: daney at gcc dot gnu dot org @ 2006-09-18 20:46 UTC (permalink / raw)
  To: gcc-bugs

The combination of GCC (r116604 or later) and binutils-2.17 creates bad
.eh_frame data causing SIGSEGV at runtime anytime an exception is thrown.

To reproduce just run the g++ testsuite.  All exception tests FAIL.

This problem is discussed further in:
http://gcc.gnu.org/ml/gcc-patches/2006-09/msg00732.html


-- 
           Summary: [4.2 Regression] Mips exception handling broken.
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: daney at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: mipsel-linux-gnu


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


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

* [Bug c/29132] [4.2 Regression] Mips exception handling broken.
  2006-09-18 20:46 [Bug c/29132] New: [4.2 Regression] Mips exception handling broken daney at gcc dot gnu dot org
@ 2006-09-18 21:28 ` roger at eyesopen dot com
  2006-09-18 21:32 ` [Bug debug/29132] [4.1/4.2 " pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: roger at eyesopen dot com @ 2006-09-18 21:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from roger at eyesopen dot com  2006-09-18 21:27 -------
Hi David,

I was wondering if you have a MIPS tree handy, whether you could easily
test the following single line patch:

Index: dwarf2out.c
===================================================================
*** dwarf2out.c (revision 117035)
--- dwarf2out.c (working copy)
*************** dwarf2out_begin_prologue (unsigned int l
*** 2572,2578 ****
    fde = &fde_table[fde_table_in_use++];
    fde->decl = current_function_decl;
    fde->dw_fde_begin = dup_label;
!   fde->dw_fde_current_label = NULL;
    fde->dw_fde_hot_section_label = NULL;
    fde->dw_fde_hot_section_end_label = NULL;
    fde->dw_fde_unlikely_section_label = NULL;
--- 2572,2578 ----
    fde = &fde_table[fde_table_in_use++];
    fde->decl = current_function_decl;
    fde->dw_fde_begin = dup_label;
!   fde->dw_fde_current_label = dup_label;
    fde->dw_fde_hot_section_label = NULL;
    fde->dw_fde_hot_section_end_label = NULL;
    fde->dw_fde_unlikely_section_label = NULL;

Due to all the abstraction with debugging formats, its difficult to tell the
order in which things get executed, and whether this initial value for
dw_fde_current_label survives long enough to avoid use of a set_loc.

Many thanks in advance,


-- 


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


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

* [Bug debug/29132] [4.1/4.2 Regression] Mips exception handling broken.
  2006-09-18 20:46 [Bug c/29132] New: [4.2 Regression] Mips exception handling broken daney at gcc dot gnu dot org
  2006-09-18 21:28 ` [Bug c/29132] " roger at eyesopen dot com
@ 2006-09-18 21:32 ` pinskia at gcc dot gnu dot org
  2006-09-18 21:33 ` ddaney at avtrex dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-18 21:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-09-18 21:32 -------
The patch also went into the 4.1 branch.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.1.2 4.2.0
      Known to work|                            |4.1.1
            Summary|[4.2 Regression] Mips       |[4.1/4.2 Regression] Mips
                   |exception handling broken.  |exception handling broken.
   Target Milestone|---                         |4.1.2


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


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

* [Bug debug/29132] [4.1/4.2 Regression] Mips exception handling broken.
  2006-09-18 20:46 [Bug c/29132] New: [4.2 Regression] Mips exception handling broken daney at gcc dot gnu dot org
  2006-09-18 21:28 ` [Bug c/29132] " roger at eyesopen dot com
  2006-09-18 21:32 ` [Bug debug/29132] [4.1/4.2 " pinskia at gcc dot gnu dot org
@ 2006-09-18 21:33 ` ddaney at avtrex dot com
  2006-09-18 21:59 ` ddaney at avtrex dot com
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ddaney at avtrex dot com @ 2006-09-18 21:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ddaney at avtrex dot com  2006-09-18 21:32 -------
Subject: Re:  [4.2 Regression] Mips exception handling broken.

roger at eyesopen dot com wrote:
> ------- Comment #1 from roger at eyesopen dot com  2006-09-18 21:27 -------
> Hi David,
> 
> I was wondering if you have a MIPS tree handy, whether you could easily
> test the following single line patch:
> 
> Index: dwarf2out.c
> ===================================================================
> *** dwarf2out.c (revision 117035)
> --- dwarf2out.c (working copy)
> *************** dwarf2out_begin_prologue (unsigned int l
> *** 2572,2578 ****
>     fde = &fde_table[fde_table_in_use++];
>     fde->decl = current_function_decl;
>     fde->dw_fde_begin = dup_label;
> !   fde->dw_fde_current_label = NULL;
>     fde->dw_fde_hot_section_label = NULL;
>     fde->dw_fde_hot_section_end_label = NULL;
>     fde->dw_fde_unlikely_section_label = NULL;
> --- 2572,2578 ----
>     fde = &fde_table[fde_table_in_use++];
>     fde->decl = current_function_decl;
>     fde->dw_fde_begin = dup_label;
> !   fde->dw_fde_current_label = dup_label;
>     fde->dw_fde_hot_section_label = NULL;
>     fde->dw_fde_hot_section_end_label = NULL;
>     fde->dw_fde_unlikely_section_label = NULL;
> 
> Due to all the abstraction with debugging formats, its difficult to tell the
> order in which things get executed, and whether this initial value for
> dw_fde_current_label survives long enough to avoid use of a set_loc.
> 

I will try the patch now.  A full build with libgcj will take me several 
hours to build and test.

David Daney.


-- 


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


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

* [Bug debug/29132] [4.1/4.2 Regression] Mips exception handling broken.
  2006-09-18 20:46 [Bug c/29132] New: [4.2 Regression] Mips exception handling broken daney at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-09-18 21:33 ` ddaney at avtrex dot com
@ 2006-09-18 21:59 ` ddaney at avtrex dot com
  2006-09-19  5:58 ` daney at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ddaney at avtrex dot com @ 2006-09-18 21:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from ddaney at avtrex dot com  2006-09-18 21:59 -------
Subject: Re:  [4.2 Regression] Mips exception handling broken.

roger at eyesopen dot com wrote:
> ------- Comment #1 from roger at eyesopen dot com  2006-09-18 21:27 -------
> Hi David,
> 
> I was wondering if you have a MIPS tree handy, whether you could easily
> test the following single line patch:
> 
> Index: dwarf2out.c
> ===================================================================
> *** dwarf2out.c (revision 117035)
> --- dwarf2out.c (working copy)
> *************** dwarf2out_begin_prologue (unsigned int l
> *** 2572,2578 ****
>     fde = &fde_table[fde_table_in_use++];
>     fde->decl = current_function_decl;
>     fde->dw_fde_begin = dup_label;
> !   fde->dw_fde_current_label = NULL;
>     fde->dw_fde_hot_section_label = NULL;
>     fde->dw_fde_hot_section_end_label = NULL;
>     fde->dw_fde_unlikely_section_label = NULL;
> --- 2572,2578 ----
>     fde = &fde_table[fde_table_in_use++];
>     fde->decl = current_function_decl;
>     fde->dw_fde_begin = dup_label;
> !   fde->dw_fde_current_label = dup_label;
>     fde->dw_fde_hot_section_label = NULL;
>     fde->dw_fde_hot_section_end_label = NULL;
>     fde->dw_fde_unlikely_section_label = NULL;
> 
> Due to all the abstraction with debugging formats, its difficult to tell the
> order in which things get executed, and whether this initial value for
> dw_fde_current_label survives long enough to avoid use of a set_loc.
> 
> Many thanks in advance,
> 

Preliminary results using: readelf --debug-dump=frames libstdc++.so show 
that this patch is working.

I now get:

00000064 00000024 00000068 FDE cie=00000000 pc=0003ed40..0003eed4
   Augmentation data:     00 00 00 00

   DW_CFA_advance_loc: 16 to 0003ed50
   DW_CFA_def_cfa_offset: 48
   DW_CFA_advance_loc: 24 to 0003ed68
   DW_CFA_offset: r16 at cfa-24
   DW_CFA_offset: r17 at cfa-20
   DW_CFA_offset: r18 at cfa-16
   DW_CFA_offset: r19 at cfa-12
   DW_CFA_offset: r20 at cfa-8


Both addresses shown for DW_CFA_advance_loc are within the range of PC 
for the FDE.  It will take (a lot) more time to see if the code actually 
works on my test platform, but it looks good to me so far.

David Daney.


-- 


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


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

* [Bug debug/29132] [4.1/4.2 Regression] Mips exception handling broken.
  2006-09-18 20:46 [Bug c/29132] New: [4.2 Regression] Mips exception handling broken daney at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-09-18 21:59 ` ddaney at avtrex dot com
@ 2006-09-19  5:58 ` daney at gcc dot gnu dot org
  2006-09-21  2:34 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: daney at gcc dot gnu dot org @ 2006-09-19  5:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from daney at gcc dot gnu dot org  2006-09-19 05:58 -------
OK, I finished running make -k check with a i686-linux -> mipsel-linux cross
compiler on my mips board for c, c++, java and there are only the 'normal'
failures (mostly attributable to running the testsuite on a remote board). 
Exception handling seems to be fixed with the Roger's patch applied.

I would say test it on a couple of other targets of your choice and then commit
it.

Thanks Roger for fixing this.


-- 


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


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

* [Bug debug/29132] [4.1/4.2 Regression] Mips exception handling broken.
  2006-09-18 20:46 [Bug c/29132] New: [4.2 Regression] Mips exception handling broken daney at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-09-19  5:58 ` daney at gcc dot gnu dot org
@ 2006-09-21  2:34 ` mmitchel at gcc dot gnu dot org
  2006-09-21 17:13 ` sayle at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-09-21  2:34 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug debug/29132] [4.1/4.2 Regression] Mips exception handling broken.
  2006-09-18 20:46 [Bug c/29132] New: [4.2 Regression] Mips exception handling broken daney at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-09-21  2:34 ` mmitchel at gcc dot gnu dot org
@ 2006-09-21 17:13 ` sayle at gcc dot gnu dot org
  2006-09-22 16:51 ` [Bug debug/29132] [4.1 " roger at eyesopen dot com
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: sayle at gcc dot gnu dot org @ 2006-09-21 17:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from sayle at gcc dot gnu dot org  2006-09-21 17:13 -------
Subject: Bug 29132

Author: sayle
Date: Thu Sep 21 17:13:33 2006
New Revision: 117114

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117114
Log:
2006-09-21  Roger Sayle  <roger@eyesopen.com>

        PR debug/29132
        * dwarf2out.c (dwarf2out_begin_prologue): Initialise the current label,
        dw_fde_current_label, to be the start of the function, i.e. the same
        value as dw_fde_begin.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c


-- 


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


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

* [Bug debug/29132] [4.1 Regression] Mips exception handling broken.
  2006-09-18 20:46 [Bug c/29132] New: [4.2 Regression] Mips exception handling broken daney at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2006-09-21 17:13 ` sayle at gcc dot gnu dot org
@ 2006-09-22 16:51 ` roger at eyesopen dot com
  2006-09-24 15:56 ` sayle at gcc dot gnu dot org
  2006-09-25  3:23 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: roger at eyesopen dot com @ 2006-09-22 16:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from roger at eyesopen dot com  2006-09-22 16:51 -------
Fixed on mainline (confirmed on mips-sgi-irix6.5).  It'll take another day or
two to backport to the 4.1 branch, as bootstrap and regtest on MIPS takes a
while.


-- 

roger at eyesopen dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |roger at eyesopen dot com
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
      Known to fail|4.1.2 4.2.0                 |4.1.2
      Known to work|4.1.1                       |4.1.1 4.2.0
   Last reconfirmed|0000-00-00 00:00:00         |2006-09-22 16:51:25
               date|                            |
            Summary|[4.1/4.2 Regression] Mips   |[4.1 Regression] Mips
                   |exception handling broken.  |exception handling broken.


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


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

* [Bug debug/29132] [4.1 Regression] Mips exception handling broken.
  2006-09-18 20:46 [Bug c/29132] New: [4.2 Regression] Mips exception handling broken daney at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2006-09-22 16:51 ` [Bug debug/29132] [4.1 " roger at eyesopen dot com
@ 2006-09-24 15:56 ` sayle at gcc dot gnu dot org
  2006-09-25  3:23 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: sayle at gcc dot gnu dot org @ 2006-09-24 15:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from sayle at gcc dot gnu dot org  2006-09-24 15:56 -------
Subject: Bug 29132

Author: sayle
Date: Sun Sep 24 15:55:51 2006
New Revision: 117180

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117180
Log:

        PR debug/29132
        Backport from mainline
        * dwarf2out.c (dwarf2out_begin_prologue): Initialise the current label,
        dw_fde_current_label, to be the start of the function, i.e. the same
        value as dw_fde_begin.


Modified:
    branches/gcc-4_1-branch/gcc/ChangeLog
    branches/gcc-4_1-branch/gcc/dwarf2out.c


-- 


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


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

* [Bug debug/29132] [4.1 Regression] Mips exception handling broken.
  2006-09-18 20:46 [Bug c/29132] New: [4.2 Regression] Mips exception handling broken daney at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2006-09-24 15:56 ` sayle at gcc dot gnu dot org
@ 2006-09-25  3:23 ` pinskia at gcc dot gnu dot org
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-09-25  3:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from pinskia at gcc dot gnu dot org  2006-09-25 03:23 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2006-09-25  3:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-18 20:46 [Bug c/29132] New: [4.2 Regression] Mips exception handling broken daney at gcc dot gnu dot org
2006-09-18 21:28 ` [Bug c/29132] " roger at eyesopen dot com
2006-09-18 21:32 ` [Bug debug/29132] [4.1/4.2 " pinskia at gcc dot gnu dot org
2006-09-18 21:33 ` ddaney at avtrex dot com
2006-09-18 21:59 ` ddaney at avtrex dot com
2006-09-19  5:58 ` daney at gcc dot gnu dot org
2006-09-21  2:34 ` mmitchel at gcc dot gnu dot org
2006-09-21 17:13 ` sayle at gcc dot gnu dot org
2006-09-22 16:51 ` [Bug debug/29132] [4.1 " roger at eyesopen dot com
2006-09-24 15:56 ` sayle at gcc dot gnu dot org
2006-09-25  3:23 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).