From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7375 invoked by alias); 23 May 2012 07:29:50 -0000 Received: (qmail 7346 invoked by uid 22791); 23 May 2012 07:29:48 -0000 X-SWARE-Spam-Status: No, hits=-3.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 May 2012 07:29:35 +0000 From: "qiyao at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug threads/13869] Latest gdb 7.4 (CVS HEAD) has problem with "target async": Cannot get thread event message: debugger service failed Date: Wed, 23 May 2012 07:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: threads X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: qiyao at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: qiyao at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status CC AssignedTo Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2012-q2/txt/msg00155.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13869 Yao Qi changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |qiyao at gcc dot gnu.org AssignedTo|unassigned at sourceware |qiyao at gcc dot gnu.org |dot org | --- Comment #1 from Yao Qi 2012-05-23 07:29:33 UTC --- I can reproduce this problem on CVS trunk with existing test case gdb.thread/manythreads.c $ ./gdb -ex "set target-async on" -ex "set non-stop on" -ex "run" ./testsuite/gdb.threads/manythreads ... Thread <255> executing [Thread 0xb77feb70 (LWP 12986) exited] [New Thread 0xb77feb70 (LWP 12987)] Cannot get thread event message: debugger service failed (gdb) (gdb) quit Initial analysis shows that this problem is caused by the race condition between gdb (with libthread_db) and inferior (with libpthreads.so) on accessing some shared state variables, such as __nptl_last_event. The code in nptl to access shared state variables is written in a thread-safe way (using some atomic and compare-and-swap operations), however, GDB doesn't coordinate with inferior on accessing them. The fix would be `stopping all threads in inferior when gdb tries to access state variables in thread library in async & non-stop mode'. I'll post a patch to @gdb-patches in two or three days. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.