X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=HW6fyzepPTlksHe7 xNNlOxYj2XAmFlyU/mtXSDfjYhSn37T+XY8lwqRJeu7IsPzlW2Oz+QlcvEAWimI+ ZMUGHesPNbTyZVekgVShdTA3exQ7Q3PjWFebr9nNE2ehY7HlurDuFH/cAjIDgk6n POpC2DqS8ad4dwpf1LyDR9XTpMM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=JW147nlW+/cEDSqK+X+ydK gQ+iQ=; b=h4YCA1tYG6uqq6rd5qrUOjMsmD57WxHoiKt0zcfWuhH9osZmRQy2wn j6a8im+sWUfkxVlpqT6gs+YrwbXMt6FEmCBVmbwHTAlWtbVc+RVOrLlJ2Q/ukd4v XOfyIqd5Fx6eHhe0mMu7zwESZJWOAeF/JfOaCuvgN+R5TPtz99qT0= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1 spammy=8.2.1-1, 8211, Cant, Can't X-HELO: rgout0706.bt.lon5.cpcloud.co.uk X-OWM-Source-IP: 86.179.112.104 (GB) X-OWM-Env-Sender: jonturney AT btinternet DOT com X-VadeSecure-score: verdict=clean score=0/300, class=clean X-SNCR-VADESECURE: CLEAN Subject: Re: Can't debug bash with gdb 8.2.1-1 To: Ken Brown , The Cygwin Mailing List References: <37d412b3-f0ff-b079-4d64-16b01898b420 AT cornell DOT edu> <73dcccf2-33a0-7608-269b-e9cb9abc2238 AT dronecode DOT org DOT uk> <10d70ba8-41a8-10e8-0ab0-5be526931de7 AT cornell DOT edu> From: Jon Turney Message-ID: Date: Tue, 23 Jul 2019 19:02:29 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <10d70ba8-41a8-10e8-0ab0-5be526931de7@cornell.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 23/07/2019 16:42, Ken Brown wrote: > On 7/23/2019 9:51 AM, Jon Turney wrote: >> On 22/07/2019 15:59, Ken Brown wrote: >>> With the test version of gdb, attempting to debug bash fails as follows: >>> >>> $ gdb bash >>> GNU gdb (GDB) (Cygwin 8.2.1-1) 8.2.1 >>> [...] >>> Reading symbols from bash...Reading symbols from >>> /usr/lib/debug//usr/bin/bash.exe.dbg...done. >>> done. >>> (gdb) r -c ls >>> Starting program: /usr/bin/bash -c ls >>> [...] >>> /usr/bin/bash: initialize_job_control: getpgrp failed: No error >>> [...] >>> [Inferior 1 (process 31876) exited with code 01] >>> >>> This problem doesn't occur with gdb-8.1.1-1. >> Thanks for reporting this. >> >> I had also tripped over this problem recently: It seems that changes in gdb >> (bisection lands on [1]) mean that any call to getpgrp() in the inferior fails >> (this can be demonstrated with a test program that just calls that). > > I can't reproduce that with the following test program: > > $ cat getpgrp_test.c > #include > int > main () > { > pid_t t = getpgrp (); > } Hmm.... let me clarify what I mean: $ cat getpgrp_test.c #include #include int main() { printf("getpgrp() = %d\n", getpgrp()); } $ gcc getpgrp_test.c -o getpgrp_test.exe $ ./getpgrp_test getpgrp() = 1241 $ gdb ./getpgrp_test GNU gdb (GDB) (Cygwin 8.2.1-1) 8.2.1 [...] Reading symbols from ./getpgrp_test...done. (gdb) r Starting program: /work/getpgrp_test getpgrp() = -1 [Inferior 1 (process 11428) exited normally] >> I believe this is behaviour is caused by some kind of defect in the cygwin DLL, >> but I haven't made much progress in investigating it. (I don't really understand >> how the inferior gets into a state where getpgrp() fails, which isn't really >> supposed to happen...) > > POSIX says that getpgrp() never fails, but Cygwin's getpgrp() can in fact fail. > I'm about to send a proposed fix to cygwin-patches. I've just checked that the > bash example succeeds with my patch installed. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple