public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109633] New: segfault using cout after set with simple prog from cppreference.com
@ 2023-04-26 14:03 bremende55 at gmail dot com
  2023-04-26 14:12 ` [Bug c++/109633] " rguenth at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bremende55 at gmail dot com @ 2023-04-26 14:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109633
           Summary: segfault using cout after set with simple prog from
                    cppreference.com
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bremende55 at gmail dot com
  Target Milestone: ---

Created attachment 54924
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54924&action=edit
*ii file from compilation

Segfault with
//  from https://en.cppreference.com/w/cpp/container/set/size
#include <set>
#include <iostream>

int main()
{ 
    std::set<int> nums {1, 3, 5, 7}; 
    std::cout << "nums contains "  << nums.size() << " elements.\n";
}

compiled with
g++ -Wall -Wextra gcc13test.cpp
no compiler errors/warnings

starting a.out gives a segfault. gdb shows:

Reading symbols from a.out...
(No debugging symbols found in a.out)
(gdb) run
Starting program: /work/tmp/gcctest/a.out 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7d3bf5a in std::ostream::sentry::sentry(std::ostream&) () from
/lib/x86_64-linux-gnu/libstdc++.so.6
(gdb) 


g++ -v :
Es werden eingebaute Spezifikationen verwendet.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/13.1.0/lto-wrapper
Ziel: x86_64-pc-linux-gnu
Konfiguriert mit: ../gcc-13.1.0/configure --enable-languages=c,c++
--disable-multilib
Thread-Modell: posix
Unterstützte LTO-Kompressionsalgorithmen: zlib
gcc-Version 13.1.0 (GCC)


cat /etc/os-release:
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian

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

* [Bug c++/109633] segfault using cout after set with simple prog from cppreference.com
  2023-04-26 14:03 [Bug c++/109633] New: segfault using cout after set with simple prog from cppreference.com bremende55 at gmail dot com
@ 2023-04-26 14:12 ` rguenth at gcc dot gnu.org
  2023-04-26 14:26 ` bremende55 at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-04-26 14:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
You have to use the GCC 13 runtime libraries - you likely run into a system
with older libstdc++?

Probably a duplicate of PR108969.

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

* [Bug c++/109633] segfault using cout after set with simple prog from cppreference.com
  2023-04-26 14:03 [Bug c++/109633] New: segfault using cout after set with simple prog from cppreference.com bremende55 at gmail dot com
  2023-04-26 14:12 ` [Bug c++/109633] " rguenth at gcc dot gnu.org
@ 2023-04-26 14:26 ` bremende55 at gmail dot com
  2023-04-26 14:36 ` ppalka at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bremende55 at gmail dot com @ 2023-04-26 14:26 UTC (permalink / raw)
  To: gcc-bugs

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

Jo <bremende55 at gmail dot com> changed:

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

--- Comment #2 from Jo <bremende55 at gmail dot com> ---
Sorry for the inconvenience
lib was not found
-Wl,-rpath,/usr/local/lib64
solved the problem

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

* [Bug c++/109633] segfault using cout after set with simple prog from cppreference.com
  2023-04-26 14:03 [Bug c++/109633] New: segfault using cout after set with simple prog from cppreference.com bremende55 at gmail dot com
  2023-04-26 14:12 ` [Bug c++/109633] " rguenth at gcc dot gnu.org
  2023-04-26 14:26 ` bremende55 at gmail dot com
@ 2023-04-26 14:36 ` ppalka at gcc dot gnu.org
  2023-04-26 16:56 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-04-26 14:36 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=108969
         Resolution|FIXED                       |INVALID
                 CC|                            |ppalka at gcc dot gnu.org

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

* [Bug c++/109633] segfault using cout after set with simple prog from cppreference.com
  2023-04-26 14:03 [Bug c++/109633] New: segfault using cout after set with simple prog from cppreference.com bremende55 at gmail dot com
                   ` (2 preceding siblings ...)
  2023-04-26 14:36 ` ppalka at gcc dot gnu.org
@ 2023-04-26 16:56 ` pinskia at gcc dot gnu.org
  2023-04-26 17:21 ` bremende55 at gmail dot com
  2023-04-26 18:15 ` xry111 at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-26 16:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Since I see this as going to be a FAQ soon, I submitted a patch to add a note
to the begining of changes page for GCC 13:
https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616806.html

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

* [Bug c++/109633] segfault using cout after set with simple prog from cppreference.com
  2023-04-26 14:03 [Bug c++/109633] New: segfault using cout after set with simple prog from cppreference.com bremende55 at gmail dot com
                   ` (3 preceding siblings ...)
  2023-04-26 16:56 ` pinskia at gcc dot gnu.org
@ 2023-04-26 17:21 ` bremende55 at gmail dot com
  2023-04-26 18:15 ` xry111 at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: bremende55 at gmail dot com @ 2023-04-26 17:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jo <bremende55 at gmail dot com> ---
good idea, thank you

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

* [Bug c++/109633] segfault using cout after set with simple prog from cppreference.com
  2023-04-26 14:03 [Bug c++/109633] New: segfault using cout after set with simple prog from cppreference.com bremende55 at gmail dot com
                   ` (4 preceding siblings ...)
  2023-04-26 17:21 ` bremende55 at gmail dot com
@ 2023-04-26 18:15 ` xry111 at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: xry111 at gcc dot gnu.org @ 2023-04-26 18:15 UTC (permalink / raw)
  To: gcc-bugs

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

Xi Ruoyao <xry111 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |DUPLICATE
                 CC|                            |xry111 at gcc dot gnu.org

--- Comment #5 from Xi Ruoyao <xry111 at gcc dot gnu.org> ---


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

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

end of thread, other threads:[~2023-04-26 18:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-26 14:03 [Bug c++/109633] New: segfault using cout after set with simple prog from cppreference.com bremende55 at gmail dot com
2023-04-26 14:12 ` [Bug c++/109633] " rguenth at gcc dot gnu.org
2023-04-26 14:26 ` bremende55 at gmail dot com
2023-04-26 14:36 ` ppalka at gcc dot gnu.org
2023-04-26 16:56 ` pinskia at gcc dot gnu.org
2023-04-26 17:21 ` bremende55 at gmail dot com
2023-04-26 18:15 ` xry111 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).