public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bremende55 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/109633] New: segfault using cout after set with simple prog from cppreference.com
Date: Wed, 26 Apr 2023 14:03:22 +0000	[thread overview]
Message-ID: <bug-109633-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             reply	other threads:[~2023-04-26 14:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26 14:03 bremende55 at gmail dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-109633-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).