From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 900B5384A8A4; Fri, 10 Sep 2021 19:35:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 900B5384A8A4 From: "mehmetgelisin at aol dot com" To: gdb-prs@sourceware.org Subject: [Bug tdep/15420] Thread support broken on 64-bit Solaris/x86 Date: Fri, 10 Sep 2021 19:35:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: tdep X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mehmetgelisin at aol dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: brobecke at sourceware dot org X-Bugzilla-Target-Milestone: 7.6 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gdb-prs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-prs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Sep 2021 19:35:54 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D15420 Mehmet gelisin changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mehmetgelisin at aol dot c= om --- Comment #8 from Mehmet gelisin --- have started experiencing a similar crash when we switched to g++ 7.1 with c++17 semantics. When gdb tries to print a "static constexpr", it triggers= a "error reading variable: Missing ELF symbol" exception and then crashes at = the same place as the original reporter. This seems to happen with every releas= e at least from gdb 7.11. I also built the git master and could reproduce the problem as well. It's not entirely clear that this is the same exact bug but the crash backt= race is completely similar I have a simple reproducer: https://komiya-dental.com/ $ cat main.cpp=20 struct A { static constexpr const char *a =3D "a"; void foo() { } }; int main(void) { A a; a.foo(); } Compile with g++ 7.1 with C++17 semantics: g++-7 -std=3Dc++17 -g -o main ma= in.cpp Now run it with gdb: $ gdb main GNU gdb (Debian 7.11.1-2~bpo8+1) 7.11.1 (...) (gdb) b A::foo Breakpoint 1 at 0x40055e: file main.cpp, line 6. (gdb) r http://www.iu-bloomington.com/ Starting program: main=20 Breakpoint 1, A::foo (this=3D0x7fffffffe09f) at main.cpp:6 6 void foo() { } (gdb) print *this Segmentation fault (core dumped) https://www.webb-dev.co.uk/=20 If I patch the source with the workaround mentioned by Thilo (i.e set the p= tr to NULL in the catch block and call cp_print_static_field() only if v is not NULL), it does not crash: (gdb) print *this $1 =3D {static a =3D } https://waytowhatsnext.com/=20=20 If I compile the program above with the default c++ semantics(c++ 14), I ge= t=20 (gdb) print *this $1 =3D {static a =3D } With the current git master (8.0.50.20170801-git), this is the backtrace I = get for the gdb crash: http://www.acpirateradio.co.uk/=20 Program terminated with signal SIGSEGV, Segmentation fault. #0 value_entirely_covered_by_range_vector (value=3D0x0, ranges=3D0x90) at value.c:401 401 if (value->lazy) (gdb) bt #0 value_entirely_covered_by_range_vector (value=3D0x0, ranges=3D0x90) at value.c:401 #1 0x0000000000563282 in cp_print_static_field (options=3D, http://www.logoarts.co.uk/ recurse=3D, stream=3D, val=3D, type=3D) at cp-valprint.c:640 #2 cp_print_value_fields (type=3D0x0, real_type=3D0x90, real_type@entry=3D= 0xf1cd00, offset=3Doffset@entry=3D0, address=3D0, address@entry=3D140737488347295, http://www.slipstone.co.uk/ stream=3D0xf194c0, recurse=3D16998736, recurse@entry=3D0, val=3D0xf8fc00, options=3D0x7fffffffda20, dont_print_vb= =3D0x0, dont_print_statmem=3D0) at cp-valprint.c:335 http://embermanchester.uk/=20 #3 0x00000000005639ca in cp_print_value_fields_rtti (type=3D, type@entry=3D0xf1cd00, valaddr=3D0xf6a330 "", offset=3Doffset@entry=3D0, http://connstr.net/=20 address=3D140737488347295, stream=3D0xf194c0, recurse=3D0, val=3D0xf8fc00, options=3D0x7fffffffda20, dont_print_vb=3D0x0, dont_print_statmem=3D0) at cp-valprint.c:456 http://joerg.li/ #4 0x000000000054bf52 in c_val_print_struct (type=3D0xf1cd00, valaddr=3D, embedded_offset=3D0, address=3D, stream=3D, recurse=3D, original_value=3D0xf8fc00, options=3D0x7fffffffd= a20) at c-valprint.c:412 http://www.jopspeech.com/ #5 0x000000000054c46f in c_val_print (type=3D0xf1cd00, embedded_offset=3D0, address=3D0, stream=3D0xf194c0, recurse=3D0, original_value=3D0xf8fc00, options=3D0x7fffffffda20) at c-valprint.c:530 http://www.wearelondonmade.co= m/ #6 0x0000000000699270 in val_print (type=3D0x0, type@entry=3D0xf1cd00, embedded_offset=3D0, address=3D15846656, address@entry=3D140737488347295, http://www.compilatori.com/ stream=3Dstream@entry=3D0xf194c0, recurse=3D327= 67, recurse@entry=3D0, val=3Dval@entry=3D0xf8fc00, options=3D0x7fffffffdae0, language=3D0x843b80 http://www-look-4.com/ ) --=20 You are receiving this mail because: You are on the CC list for the bug.=