From owner-freebsd-ports@FreeBSD.ORG Mon May 11 20:21:45 2015 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6AB2ED3D for ; Mon, 11 May 2015 20:21:45 +0000 (UTC) Received: from mail-la0-x230.google.com (mail-la0-x230.google.com [IPv6:2a00:1450:4010:c03::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9690173E for ; Mon, 11 May 2015 20:21:44 +0000 (UTC) Received: by laat2 with SMTP id t2so101687141laa.1 for ; Mon, 11 May 2015 13:21:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=averesystems.com; s=google; h=mime-version:date:message-id:subject:from:to:content-type; bh=iVP89h1rIAHHCkPakD0KNTrXZHpYoF1yxghsDxM5kTM=; b=nGwFy47+cdpwx1MG51geradmy2rTE8HQl9SXLZSguX03MpfL9GrHuKNFusYIBB/ZAn FOhUkZ8tWSvsuc43Ys9OAF97PbOuk6tsMKP2D9t3ooPDgRS8bayrv3/jFzlaUX6zNtJC yca1bs7LUn/vXQ+RXXNcLSoZumDrxNFnzNnMg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=iVP89h1rIAHHCkPakD0KNTrXZHpYoF1yxghsDxM5kTM=; b=DoxMvvdnmskEI55UH3bQyEqKSU0f3FzzfWYWeixHYykrNQsOUP7bXSEenxaudEiBCw GBBxteCWaP6lUBsrkoBFmHWrMs5s7vT5xY2Qz7DYDNJAYBG4Xj+UdIdzoricGmTU3YR+ GnEbm2vTOUWoyuk4hjnoTuFk7sxb595kao3ceoczoQNo4DAsSkWPLro8biZCr1cay+I6 61WKW/jol+kKhK4xUrhXhueoCeWxH0j5uJfvwYeKr8XC4dgbY44FuOAnCbTN5lw9nRfc kywNg7sriJrAVZWZQJb5yEzpAL8LKQTTvE6wuMD66hzPhVrBf2fxk9daZcPMdLqQb4J1 voHg== X-Gm-Message-State: ALoCoQkZBIuDFlStcAqIq7/qJOXPA/BmLDNfbcNUfZAP49t2paZLKdi/oqiVxjlyfbJqJFN0E0I5 MIME-Version: 1.0 X-Received: by 10.112.13.6 with SMTP id d6mr9165868lbc.117.1431375702959; Mon, 11 May 2015 13:21:42 -0700 (PDT) Received: by 10.114.83.97 with HTTP; Mon, 11 May 2015 13:21:42 -0700 (PDT) Date: Mon, 11 May 2015 16:21:42 -0400 Message-ID: Subject: gdb in ports From: Jason Woodward To: freebsd-ports@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2015 20:21:45 -0000 Hi all, I had sent this to Luca but maybe others might have an idea... I'm running into some difficulty debugging a live, multithreaded application. This seems to be the case with the 7.8.x gdbs and 7.9 (both 9.2 and 10 release). When I attach, I see duplicates for the first thread: 5 Thread 817ff2c00 (LWP 100541) 0x000000080bd6286c in poll () at poll.S:3 4 Thread 80efe8c00 (LWP 100546) 0x000000080bd6286c in poll () at poll.S:3 3 Thread 80efe9000 (LWP 100878) 0x000000080bd6286c in poll () at poll.S:3 * 2 Thread 80efe9400 (LWP 101124) 0x000000080bd6286c in poll () at poll.S:3 * 1 Thread 80efe9400 (LWP 101124) 0x000000080bd6286c in poll () at poll.S:3 Trying to select 1 or 2 always ends up selecting 2: (gdb) thread 1 [Switching to thread 2 (Thread 80efe9400 (LWP 101124))] #0 0x000000080bd6286c in poll () at poll.S:3 3 in poll.S (gdb) thread 2 [Switching to thread 2 (Thread 80efe9400 (LWP 101124))] #0 0x000000080bd6286c in poll () at poll.S:33 in poll.S (gdb) On top of this, when stepping through it seems threads that start and stop quickly have some sort of race condition that results in the thread tracking getting messed up. Sometimes I'll end up on thread 74, other times I will be on a thread that has gone away and "info threads" does not show me associated with any of the active threads. With 7.8.x I would see: Id Target Id Frame 75 Cannot find thread, Thread ID=101080, no thread to satisfy query Unsure if related, but after stepping through with 7.9, the following happens in fbsd_thread_wait(): infrun.c:5530: internal-error: switch_back_to_stepped_thread: Assertion `!tp->control.trap_expected' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) y This is a bug, please report it. For instructions, see: . infrun.c:5530: internal-error: switch_back_to_stepped_thread: Assertion `!tp->control.trap_expected' failed. A problem internal to GDB has been detected,further debugging may prove unreliable. Create a core file of GDB? (y or n) n take care, jason