From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21239 invoked by alias); 21 Sep 2011 10:20:50 -0000 Received: (qmail 20990 invoked by uid 22791); 21 Sep 2011 10:20:47 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Sep 2011 10:20:31 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1R6Juo-0002b6-6O from pedro_alves@mentor.com ; Wed, 21 Sep 2011 03:20:30 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 21 Sep 2011 11:20:28 +0100 From: Pedro Alves To: gdb@sourceware.org Subject: Re: Displaced stepping not always working as expected Date: Wed, 21 Sep 2011 10:20:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.0; x86_64; ; ) Cc: Marc Khouzam References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201109211120.26531.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00078.txt.bz2 On Tuesday 20 September 2011 20:54:24, Marc Khouzam wrote: > Hi, > > I just need a hint on where next to look... > I've been asked to look into problems with non-stop on > a user-mode-linux virtual machine > (http://user-mode-linux.sourceforge.net/) So does this only happen with UML? UML uses ptrace internally for its own business, I wouldn't be surprised if there's something wonky going on at that level. > On that AMD 64bit machine, I cannot step or resume past a breakpoint > when using non-stop with a multi-threaded program _if_ any of the > threads is still running. If I interrupt all threads, then displaced > stepping works. I wouldn't be surprised if the UM kernel is reporting a spurious SIGTRAP to gdb. Try "set debug lin-lwp 1" as well, but I don't think it'll tell you much. Maybe peeking at eflags or the siginfo of that SIGTRAP reveals something. > During the failure case, I confirmed that the displaced > instruction does _not_ get executed (the memory it should have > changed stays the same). So, the PC stays in the same place > and the step does not move forward. > > I tried to turn on 'set debug infrun 1', but I get the exact same > logs during the failure as during a success case. > > Sometimes, if I keep trying to step, it will finally work (could be > after 3 attempts, could be after 100 attempts or more). It seems > related to what the other running thread is doing at the time. > > Can someone let me know where in GDB I can look to see why a displaced > instruction is not being executed? Or maybe other debug logs to enable? Try "set debug lin-lwp 1", and see if the resume was preempted and for some bizarre reason the core is getting a cached wait status instead of really resuming the thread. Otherwise, this smells like a UML problem. -- Pedro Alves