public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/18743] New: crtbegin/crtend lacking unwind-info
@ 2004-11-30 19:37 davidm at hpl dot hp dot com
  2004-11-30 19:48 ` [Bug target/18743] " pinskia at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: davidm at hpl dot hp dot com @ 2004-11-30 19:37 UTC (permalink / raw)
  To: gcc-bugs

The Gtest-init test from libunwind is currently failing on x86-64 because there
is  incomplete/no unwind info for _init.  For example, calling backtrace() from
a C++ constructor yields this truncated stack-trace:

[0] ip=0x400afb
[1] ip=0x400e26

with libunwind, it gets a bit further, but crashes eventually:

  [400b25] <_Z1bv+0x55>
  [400e26] <__do_global_ctors_aux+0x26>
  [4008f3] <_init+0x13>
  [48f0246c8948f824] <>

For reference, the complete backtrace, obtained via gdb, ought to be like this:

  0x0000000000400b25 in b ()
  0x0000000000400e26 in __do_global_ctors_aux ()
  0x00000000004008f3 in _init ()
  0x0000000000400d20 in Test_Class::Test_Class ()
  0x0000000000400d91 in __libc_csu_init () at elf-init.c:60
  0x0000002a95bffa45 in __libc_start_main () from /lib64/tls/libc.so.6
  0x0000000000400a1a in _start () at ../sysdeps/x86_64/elf/start.S:96

I suspect the platform should be switched to using .init_array/.fini_array
as is done on ia64 already (probably the same applies for all platforms that
support .init_array/.fini_array).

-- 
           Summary: crtbegin/crtend lacking unwind-info
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: davidm at hpl dot hp dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: x86_64-suse-linux
  GCC host triplet: x86_64-suse-linux
GCC target triplet: x86_64-suse-linux


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


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

* [Bug target/18743] crtbegin/crtend lacking unwind-info
  2004-11-30 19:37 [Bug target/18743] New: crtbegin/crtend lacking unwind-info davidm at hpl dot hp dot com
@ 2004-11-30 19:48 ` pinskia at gcc dot gnu dot org
  2004-11-30 19:51 ` pinskia at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-30 19:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-30 19:48 -------
when gcc builds crtbegin/crtend, we do pass -fno-exceptions but in the backend, we set 
flag_asynchronous_unwind_tables to 1 if we have not set it yet but we don't touch 
flag_asynchronous_unwind_tables otherwise.

-- 


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


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

* [Bug target/18743] crtbegin/crtend lacking unwind-info
  2004-11-30 19:37 [Bug target/18743] New: crtbegin/crtend lacking unwind-info davidm at hpl dot hp dot com
  2004-11-30 19:48 ` [Bug target/18743] " pinskia at gcc dot gnu dot org
@ 2004-11-30 19:51 ` pinskia at gcc dot gnu dot org
  2004-11-30 20:01 ` davidm at hpl dot hp dot com
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-30 19:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-30 19:50 -------
What gcc are you using also since the version you filed in as unkown?

-- 


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


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

* [Bug target/18743] crtbegin/crtend lacking unwind-info
  2004-11-30 19:37 [Bug target/18743] New: crtbegin/crtend lacking unwind-info davidm at hpl dot hp dot com
  2004-11-30 19:48 ` [Bug target/18743] " pinskia at gcc dot gnu dot org
  2004-11-30 19:51 ` pinskia at gcc dot gnu dot org
@ 2004-11-30 20:01 ` davidm at hpl dot hp dot com
  2004-11-30 20:03 ` davidm at hpl dot hp dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: davidm at hpl dot hp dot com @ 2004-11-30 20:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From davidm at hpl dot hp dot com  2004-11-30 20:01 -------
(In reply to comment #2)
> What gcc are you using also since the version you filed in as unkown?

$ gcc -v
Reading specs from /usr/lib64/gcc-lib/x86_64-suse-linux/3.3.3/specs
Configured with: ../configure --enable-threads=posix --prefix=/usr
--with-local-prefix=/usr/local --infodir=/usr/share/info --mandir=/usr/share/man
--enable-languages=c,c++,f77,objc,java,ada --disable-checking
--libdir=/usr/lib64 --enable-libgcj --with-gxx-include-dir=/usr/include/g++
--with-slibdir=/lib64 --with-system-zlib --enable-shared --enable-__cxa_atexit
x86_64-suse-linux
Thread model: posix
gcc version 3.3.3 (SuSE Linux)


-- 


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


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

* [Bug target/18743] crtbegin/crtend lacking unwind-info
  2004-11-30 19:37 [Bug target/18743] New: crtbegin/crtend lacking unwind-info davidm at hpl dot hp dot com
                   ` (2 preceding siblings ...)
  2004-11-30 20:01 ` davidm at hpl dot hp dot com
@ 2004-11-30 20:03 ` davidm at hpl dot hp dot com
  2004-11-30 20:09 ` [Bug target/18743] _init/_ " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: davidm at hpl dot hp dot com @ 2004-11-30 20:03 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From davidm at hpl dot hp dot com  2004-11-30 20:03 -------
(In reply to comment #1)
> when gcc builds crtbegin/crtend, we do pass -fno-exceptions but in the
backend, we set 
> flag_asynchronous_unwind_tables to 1 if we have not set it yet but we don't touch 
> flag_asynchronous_unwind_tables otherwise.

Note that _init and _fini are special because they're constructed by the linker.
 That is, the length of these functions are unknown to the assembler and hence
it's not possible to generate correct unwind-info.  It's probably better to
switch to .init_array/.fini_array.


-- 


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


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

* [Bug target/18743] _init/_ lacking unwind-info
  2004-11-30 19:37 [Bug target/18743] New: crtbegin/crtend lacking unwind-info davidm at hpl dot hp dot com
                   ` (3 preceding siblings ...)
  2004-11-30 20:03 ` davidm at hpl dot hp dot com
@ 2004-11-30 20:09 ` pinskia at gcc dot gnu dot org
  2004-11-30 20:24 ` davidm at hpl dot hp dot com
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-30 20:09 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-30 20:09 -------
Well if _init/_fini is created by the linker then isn't this a linker bug which should generated the unwind 
info?

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|crtbegin/crtend lacking     |_init/_ lacking unwind-info
                   |unwind-info                 |


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


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

* [Bug target/18743] _init/_ lacking unwind-info
  2004-11-30 19:37 [Bug target/18743] New: crtbegin/crtend lacking unwind-info davidm at hpl dot hp dot com
                   ` (4 preceding siblings ...)
  2004-11-30 20:09 ` [Bug target/18743] _init/_ " pinskia at gcc dot gnu dot org
@ 2004-11-30 20:24 ` davidm at hpl dot hp dot com
  2004-11-30 21:15 ` [Bug target/18743] _init/_fini " schwab at suse dot de
  2005-07-02  1:45 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: davidm at hpl dot hp dot com @ 2004-11-30 20:24 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From davidm at hpl dot hp dot com  2004-11-30 20:23 -------
(In reply to comment #5)
> Well if _init/_fini is created by the linker then isn't this a linker bug
which should generated the unwind 
> info?

I don't really care which way it goes.
When the same issue came up for ia64, we decided to deprecated .init/.fini
in favor of .init_array/.fini_array (which are much cleaner anyhow) and, from
my perspective, that choice has worked out very well.

If you search the net for "unwind info for init init_array" you'll find some old
discussions on this topic.


-- 


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


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

* [Bug target/18743] _init/_fini lacking unwind-info
  2004-11-30 19:37 [Bug target/18743] New: crtbegin/crtend lacking unwind-info davidm at hpl dot hp dot com
                   ` (5 preceding siblings ...)
  2004-11-30 20:24 ` davidm at hpl dot hp dot com
@ 2004-11-30 21:15 ` schwab at suse dot de
  2005-07-02  1:45 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: schwab at suse dot de @ 2004-11-30 21:15 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|_init/_ lacking unwind-info |_init/_fini lacking unwind-
                   |                            |info
            Version|unknown                     |3.3.3


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


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

* [Bug target/18743] _init/_fini lacking unwind-info
  2004-11-30 19:37 [Bug target/18743] New: crtbegin/crtend lacking unwind-info davidm at hpl dot hp dot com
                   ` (6 preceding siblings ...)
  2004-11-30 21:15 ` [Bug target/18743] _init/_fini " schwab at suse dot de
@ 2005-07-02  1:45 ` pinskia at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-07-02  1:45 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-07-02 01:45 -------
_init/_finit is not generated by GCC so this is not a GCC bug.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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

end of thread, other threads:[~2005-07-02  1:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-30 19:37 [Bug target/18743] New: crtbegin/crtend lacking unwind-info davidm at hpl dot hp dot com
2004-11-30 19:48 ` [Bug target/18743] " pinskia at gcc dot gnu dot org
2004-11-30 19:51 ` pinskia at gcc dot gnu dot org
2004-11-30 20:01 ` davidm at hpl dot hp dot com
2004-11-30 20:03 ` davidm at hpl dot hp dot com
2004-11-30 20:09 ` [Bug target/18743] _init/_ " pinskia at gcc dot gnu dot org
2004-11-30 20:24 ` davidm at hpl dot hp dot com
2004-11-30 21:15 ` [Bug target/18743] _init/_fini " schwab at suse dot de
2005-07-02  1:45 ` 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).