From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25733 invoked by alias); 5 Feb 2014 18:21:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 25718 invoked by uid 89); 5 Feb 2014 18:21:24 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wg0-f49.google.com Received: from mail-wg0-f49.google.com (HELO mail-wg0-f49.google.com) (74.125.82.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 05 Feb 2014 18:21:23 +0000 Received: by mail-wg0-f49.google.com with SMTP id a1so558534wgh.4 for ; Wed, 05 Feb 2014 10:21:20 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.119.168 with SMTP id kv8mr2406888wjb.41.1391624480043; Wed, 05 Feb 2014 10:21:20 -0800 (PST) Received: by 10.194.17.104 with HTTP; Wed, 5 Feb 2014 10:21:19 -0800 (PST) In-Reply-To: <8761ovp1hw.fsf@gnu.org> References: <8761ovp1hw.fsf@gnu.org> Date: Wed, 05 Feb 2014 18:21:00 -0000 Message-ID: Subject: Re: Fun with LD_PRELOAD From: Doug Evans To: =?ISO-8859-1?Q?Ludovic_Court=E8s?= Cc: guile-user@gnu.org, "gdb-patches@sourceware.org" , saugustine@google.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00044.txt.bz2 On Tue, Feb 4, 2014 at 3:21 AM, Ludovic Court=E8s wrote: > Hi, Doug, > > Doug Evans skribis: > >> It's kinda useful to see the system call tracing amongst gdb's own >> debug output, but my real goal is to explore ways of exercising gdb >> that are otherwise harder to do. >> With this I can script what happens when gdb does ptrace,waitpid,tkill,e= tc. >> Whether this exploration yields anything useful ... TBD. > > Looks fun. So the main application would be to stress-test GDB and see > if it misses signals sent to application threads right when GDB is about > to stop them, for example, right? Something like that. For example, a colleague at Google tripped over a bug that requires a specific timing to replicate. I don't have all the details at hand, but I think I'm hitting the same assert. infrun.c:1948: internal-error: resume: Assertion `pc_in_thread_step_range (pc, tp)' failed. AIUI, It happens, for example, when the user does a "next", and a signal arrives on another thread while the thread being next'd has stepped into a subroutine (thus requiring gdb to step out to implement the semantics of "next"). I now have a simple repro (at least for the assert I'm seeing), and it was very straightforward to write. It involves tracking the PTRACE_SINGLESTEP being issued to one thread (that implement "next") and at the right time send a signal to another thread. I've made it very easy to add more syscalls, and the wrapping machinery itself is not gdb specific. Maybe it would be useful in either apps, I don't know.