[Bug c++/109633] segfault using cout after set with simple prog from cppreference.com

2023-04-26 Thread bremende55 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109633

--- Comment #4 from Jo  ---
good idea, thank you

[Bug c++/109633] segfault using cout after set with simple prog from cppreference.com

2023-04-26 Thread bremende55 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109633

Jo  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Jo  ---
Sorry for the inconvenience
lib was not found
-Wl,-rpath,/usr/local/lib64
solved the problem

[Bug c++/109633] New: segfault using cout after set with simple prog from cppreference.com

2023-04-26 Thread bremende55 at gmail dot com via 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=edit
*ii file from compilation

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

int main()
{ 
std::set 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.
0x77d3bf5a 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