From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 80975 invoked by alias); 11 Mar 2018 20:15:55 -0000 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 Received: (qmail 80849 invoked by uid 89); 11 Mar 2018 20:15:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=tget, gplv3, gplhtml, apropos X-HELO: mail-yw0-f171.google.com Received: from mail-yw0-f171.google.com (HELO mail-yw0-f171.google.com) (209.85.161.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 11 Mar 2018 20:15:32 +0000 Received: by mail-yw0-f171.google.com with SMTP id x17so97056ywj.1 for ; Sun, 11 Mar 2018 13:15:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=0oOZP/saSA978HnAthOJ3poG7KMf1YlU5vCCLH0JA64=; b=JqR9nOzEHhMr010RwBtpJUhYerqepy3sv0Jnb7SBkUhdnSTjSGyXDpLJC4o2JJrds+ VWQ61avWgvWZwUo4NkbMoQ+FvdKTOLuRyqS+ewW7T8qqKYhfvXJfxx9KWEvEzEi2kYYf ngt5yVIISq19QuWHjBezqfMVDOgOmXeUAuwEkJ2dCLnA8R7Ti6k0vqF7PixtvBvOM4hD sWDx+ZQa//S8fPTvieFg9SUVU61WqqSLUdTJlo0X96FUpnlHlexhQ0ZDWdXcjEZsvaX3 BnIPuFF1qHSmZghqnU6BDLrsYsVGngAQMMGlLLfpfmaaeetYeqyp8mVbDhX9bjj+SHdm WVEQ== X-Gm-Message-State: AElRT7Fy4iiuJLSc7lqoOCYtTxM1hJSiETQalEcS0sweu8Gl/fHDAbId enLIpeHKnH6ZcLH0iXr5JOqSSPRenn4vEF9s3eKHNnyJ X-Google-Smtp-Source: AG47ELuCZQbyJTiZYOQbmyZxGGQLRYAEIKvXWawad3Whsp52B4QSMVBVaq9J9VTTJW9PlIOfoX/nGpSDymIs0r8pDjI= X-Received: by 2002:a25:db4b:: with SMTP id g72-v6mr3240230ybf.403.1520799329966; Sun, 11 Mar 2018 13:15:29 -0700 (PDT) MIME-Version: 1.0 Received: by 10.129.152.199 with HTTP; Sun, 11 Mar 2018 13:15:09 -0700 (PDT) From: LE GARREC Vincent Date: Sun, 11 Mar 2018 20:15:00 -0000 Message-ID: Subject: Run multiple parallel instances of gdb To: gdb@sourceware.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00027.txt.bz2 Hi everybody, I would like to sort crashes found by fuzzing. So I have around 1000 files that make my application crashes. I made a small program to run gdb and to extract backtraces to file. To increase speed, I run parallel instances. Problem, with parallel instances, my program stopped. It doesn't crashes, it stops. I have to run "fg" from terminal to continue and it's happening very often. So actually, I'm running with single thread. Is it normal ? Did I do something wrong ? If you need more information, I can give you. Please find after simple steps to reproduce the case, Thanks for you advices, Vincent Le Garrec [1] : crash program main.c (in /tmp folder) int main() { int *t = 0xDEADBEEF; *t = 1; } Run it and it should crash. [2] : multiple execution of gdb loopgdb.cpp #include #include #include #include #include #include #include #include void run_gdb() { pid_t child_pid = fork(); std::cout << "run" << std::endl; if (child_pid != 0) { pid_t wait_pid; { wait_pid = waitpid(child_pid, nullptr, WNOHANG); sleep(1); } while(wait_pid == 0); } else { execlp("/usr/bin/gdb", "-batch-silent", "-ex", "run", "-ex", "set logging overwrite on", "-ex", "set logging on", "-ex", "set pagination off", "-ex", "handle SIG33 pass nostop noprint", "-ex", "backtrace full", "-ex", "set logging off", "-ex", "quit", "--args", "/tmp/main", nullptr); } } int main() { int nthreads = std::thread::hardware_concurrency(); std::vector> threads(nthreads); for (size_t t = 0; t < nthreads; t++) { threads[t] = std::async(std::launch::async, std::bind( []() { while(true) { run_gdb(); } })); } for (std::future & t : threads) { t.get(); } } Run it (g++ loopgdb.cpp -o loopgdb -lpthread) and you will see that the program in command-line will stopped. [3] gdb --version GNU gdb (Gentoo 8.1 p1) 8.1 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: . Find the GDB manual and other documentation resources online at: . For help, type "help". Type "apropos word" to search for commands related to "word".