From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CD52C385AC3C; Fri, 10 Sep 2021 19:37:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD52C385AC3C From: "mehmetgelisin at aol dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/27435] Attach on solaris segfaults GDB Date: Fri, 10 Sep 2021 19:37:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 10.1 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: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: 10.2 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:37:33 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D27435 Mehmet gelisin changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mehmetgelisin at aol dot c= om --- Comment #13 from Mehmet gelisin --- type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./foo_gcc-9... http://www-look-4.com/ (gdb) break foo.c:13 Breakpoint 1 at 0x878: file foo.c, line 13. (gdb) run http://www.compilatori.com/ Starting program: /home/dclarke/foo_gcc-9=20 a =3D 1 &a =3D 0x7fefffff5bc http://www.wearelondonmade.com/ Breakpoint 1, main (argc=3D0, argv=3D0x0) at foo.c:13 13 return EXIT_SUCCESS; http://www.jopspeech.com/ (gdb) print a $1 =3D 0 (gdb) print &a http://joerg.li/ $2 =3D (int *) 0x7feffa5d49c (gdb) cont Continuing. http://connstr.net/=20 [Inferior 1 (process 53214) exited normally] (gdb) quit mimas$=20 http://embermanchester.uk/=20 I will attach two binaries :=20 1) foo_sparc64_gcc-10.xz made with gcc 10.2.1 http://www.slipstone.co.uk/=20 2) foo_sparc64_gcc-9.xz made with gcc 9.3.0 I may go get sources to a previous gdb release and see if I can build http://www.logoarts.co.uk/=20 and test. When stepping over thread-lock related codes (in uClibc), the inferior proc= ess gets stuck and never manages to enter the critical section: ------8<------- http://www.acpirateradio.co.uk/=20 1 size_t fwrite(const void * __restrict ptr, size_t size, 2 size_t nmemb, register FILE * __restrict stream) 3 { 4 size_t retval; 5 __STDIO_AUTO_THREADLOCK_VAR; 6 7 > __STDIO_AUTO_THREADLOCK(stream); https://waytowhatsnext.com/=20 8 9 retval =3D fwrite_unlocked(ptr, size, nmemb, stream); 10 11 __STDIO_AUTO_THREADUNLOCK(stream); 12 13 return retval; https://www.webb-dev.co.uk/ 14 } ------>8------- Here, we are at line 7. Using the "next" command leads no where. However, setting a breakpoint on line 9 and issuing "continue" works. http://www.iu-bloomington.com/=20 Looking at the assembly instructions reveals that we're dealing with the critical section entry code [1] that should never be interrupted, in th= is case by the debugger's implicit breakpoints: ------8<------- ... 1 add_s r0,r13,0x38 2 mov_s r3,1 3 llock r2,[r0] <-. 4 brne.nt r2,0,14 --. | 5 scond r3,[r0] | | 6 bne -10 --|--' https://komiya-dental.com/ 7 brne_s r2,0,84 <-' ... ------>8------- --=20 You are receiving this mail because: You are on the CC list for the bug.=