public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/62200] New: libstdc++ initialization priority
@ 2014-08-20 10:02 vhaisman at gmail dot com
  2014-08-20 10:05 ` [Bug libstdc++/62200] " vhaisman at gmail dot com
  2023-02-03 19:49 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: vhaisman at gmail dot com @ 2014-08-20 10:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62200

            Bug ID: 62200
           Summary: libstdc++ initialization priority
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vhaisman at gmail dot com

I am trying to initialize my library early using the `init_priority` attribute.
Some paths of my library's initialization might try to print warnings and/or
errors. I have hit a SIGSEGV with the following test case, which uses
std::cerr. According to some, the library should initialize with priority 101.
If this were the case I would expect the test case to work flawlessly.

~~~~
#include <iostream>

struct S1
{
    S1() { std::cerr << __FUNCTION__ << "\n"; }
} static s1 __attribute__ ((__init_priority__ (65535/2)));


int
main ()
{
  return 0;
}
~~~~

The stack trace is

~~~~
#0  0x00007ffff7b6a559 in std::ostream::sentry::sentry(std::ostream&) ()
from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007ffff7b6ac19 in std::basic_ostream<char, std::char_traits<char> >&
std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*, long)
    () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2  0x00007ffff7b6b077 in std::basic_ostream<char, std::char_traits<char> >&
std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*) ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x000000000040081d in S1::S1 (this=0x601172 <s1>) at test.cxx:5
#4  0x00000000004007d6 in __static_initialization_and_destruction_0
(__initialize_p=1, __priority=32767) at test.cxx:6
#5  0x00000000004007eb in _GLOBAL__sub_I.32767_main(void) () at test.cxx:13
#6  0x000000000040087d in __libc_csu_init ()
#7  0x00007ffff7731e55 in __libc_start_main (main=0x40077d <main()>, argc=1,
argv=0x7fffffffe2c8, init=0x400830 <__libc_csu_init>, fini=<optimized out>,
rtld_fini=<optimized out>,
    stack_end=0x7fffffffe2b8) at libc-start.c:246
#8  0x00000000004006b9 in _start ()
~~~~


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

* [Bug libstdc++/62200] libstdc++ initialization priority
  2014-08-20 10:02 [Bug libstdc++/62200] New: libstdc++ initialization priority vhaisman at gmail dot com
@ 2014-08-20 10:05 ` vhaisman at gmail dot com
  2023-02-03 19:49 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: vhaisman at gmail dot com @ 2014-08-20 10:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62200

--- Comment #1 from Václav Zeman <vhaisman at gmail dot com> ---
And it dumps core on Cygwin as well.
>From gcc-bugs-return-458852-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Aug 20 10:24:12 2014
Return-Path: <gcc-bugs-return-458852-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21453 invoked by alias); 20 Aug 2014 10:24:12 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 21392 invoked by uid 48); 20 Aug 2014 10:24:09 -0000
From: "iains at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/62132] [5 Regression] FAIL: c-c++-common/asan/misalign-[12].c after r213807 on x86_64-apple-darwin13 with -m32
Date: Wed, 20 Aug 2014 10:24:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: sanitizer
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: iains at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-62132-4-Pham49JqlZ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-62132-4@http.gcc.gnu.org/bugzilla/>
References: <bug-62132-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-08/txt/msg01349.txt.bz2
Content-length: 569

https://gcc.gnu.org/bugzilla/show_bug.cgi?idb132

--- Comment #5 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to Yury Gribov from comment #4)
> Note that same problem may pop up in other tests as well so IMHO better fix
> this in general.

Well, we could switch frame pointers in the [darwin.h] asan spec, but I'm a bit
inclined to leave this under User control and just accept that we need to keep
an eye on test-cases.

Will think some more about doing it automatically, but suggest that we
immediately fix these cases for now with Dominique's patch.


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

* [Bug libstdc++/62200] libstdc++ initialization priority
  2014-08-20 10:02 [Bug libstdc++/62200] New: libstdc++ initialization priority vhaisman at gmail dot com
  2014-08-20 10:05 ` [Bug libstdc++/62200] " vhaisman at gmail dot com
@ 2023-02-03 19:49 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-02-03 19:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62200

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 39796.

*** This bug has been marked as a duplicate of bug 39796 ***

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

end of thread, other threads:[~2023-02-03 19:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-20 10:02 [Bug libstdc++/62200] New: libstdc++ initialization priority vhaisman at gmail dot com
2014-08-20 10:05 ` [Bug libstdc++/62200] " vhaisman at gmail dot com
2023-02-03 19:49 ` pinskia at gcc dot gnu.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).