From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25360 invoked by alias); 24 Jan 2018 20:43:52 -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 25346 invoked by uid 89); 24 Jan 2018 20:43:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=BAYES_00,GIT_PATCH_2,KAM_ASCII_DIVIDERS,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 24 Jan 2018 20:43:50 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5BD5A76541 for ; Wed, 24 Jan 2018 20:43:49 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-57.ams2.redhat.com [10.36.116.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8F5DF5E1CA; Wed, 24 Jan 2018 20:43:42 +0000 (UTC) Date: Wed, 24 Jan 2018 20:43:00 -0000 From: Jan Kratochvil To: Sergio Durigan Junior Cc: GDB Patches Subject: Re: [PATCH] Always print "Detaching after fork from child..." Message-ID: <20180124204339.GA16117@host1.jankratochvil.net> References: <20180124194714.26222-1-sergiodj@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180124194714.26222-1-sergiodj@redhat.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-SW-Source: 2018-01/txt/msg00490.txt.bz2 On Wed, 24 Jan 2018 20:47:14 +0100, Sergio Durigan Junior wrote: > https://bugzilla.redhat.com/show_bug.cgi?id=235197 As a justification for this patch: ------------------------------------------------------------------------------ cat >fork2.c < #include static void printit(void) { puts("printed"); } int main(void) { if (!fork()) printit(); return 0; } EOH gcc -o fork2 fork2.c -Wall -g gdb -q ./fork2 (gdb) b printit Breakpoint 1 at 0x40052b: file fork2.c, line 4. (gdb) r Starting program: /quad/home/jkratoch/t/fork2 printed [Inferior 1 (process 15812) exited normally] (gdb) q ------------------------------------------------------------------------------ As the GDB user does not expect the program could do any forks s/he is confused the breakpoint did not get hit and assumes GDB is just broken. But then I cannot say this patch is too great, it produces many uninteresting Detaching after fork from child process 24905. messages rather just annoying in most cases. So nowadays I feel the message is more an excuse how to show it is user's fault s/he did not read it. But I think nobody reads them as there are too many such messages. I believe the right fix would be to make "set detach-on-fork off" the default. But that is sure a new can of worms I do not want to speculate about. Jan