delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/07/24/10:33:34

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:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-id:content-transfer-encoding
:mime-version; q=dns; s=default; b=sPHenZfOQQV8Z+C7qzyUF0vtuqICK
wX05QThL47uxyAF8t8yXjkEdzs3F1PPcwumCZVcq8fWnSGB6TX8uVuv6W8GsXlnZ
MKWoVIHfPbmIRTYZU01F64Qv4T6lf6LPP1e9GG+8+87lZBKmC2au4cw12H02QNeH
lgo6N6H2CmIE/Y=
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:from:to:subject:date:message-id:references
:in-reply-to:content-type:content-id:content-transfer-encoding
:mime-version; s=default; bh=MMsC+wpFuLj6LdsPtTrO5w1EbYw=; b=xnK
RUdl/B+piQTrOd2HODX6A+ktCSwSd0rE0VaksufaskKuoerd50fHTbR0UKwTBWJu
zz6A9I39olKTDPzEJaMu1kYhFcuoe2+85IQerjdU9TkInTVnTvKf24z11nZGpHVc
0V960/V34czc1FA0lfOChuR0ba8/s5sXt35W3lDE=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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=2.1 required=5.0 tests=BAYES_00,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,SEM_URI,SEM_URIRED,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 spammy=8.2.1-1, sk:getpgrp, UD:getpgrp_test.c, UD:getpgrp_test.exe
X-HELO: NAM04-BN3-obe.outbound.protection.outlook.com
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RyOjNdoSoLqpfXPZXnqqn+3STk24spTS/dcl2ApfCCn2ZbVfPs5712pDzhG5ZSGv0WvYfomwWUCauaLlVjuK6HEy7uR+OUKklyi1089lE8htuSWJ1YOGcKzDdBtuAGa35uyiNZAtbRqZD4lQDe36hsXoC2z7EGLxT9TjPFyHhM1AgQjy+xpuqNpCFyJ2cGeir5xNuin4MU9uMYw9nt+K4mlKOelue35RvRVbPXUMglq3ntN1g75LE0+DjOcM9zUdCHvRmMVuzgBuXttUspBfykA6pU/gEvrUk8lERoYxl/jJDWm9SmJ1VDCBdut8y0OsokAVbSQRHB6erbw0QTx84A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2lmheuj0QIAr4OcwDVAedQOVC08CTi6ke6sie7VALwk=; b=OiXcxRs6MnNYKvisIpNXiP0i3OfyvrBI4L5aW944jXSMgS9SUMaKfaeBs5A/HqptgP0XuZNPO4kG/zCGl2ATXC7BkbReZuXziPY85nQNeZarV4C0sECmaCOf2K3BJlph9qu1JraNvCyq3SHZwkdACtUTV/mrpDBNLb/tBOBAnxAV60v+v8JDxaFFB3TbR5Dqqs7DWaf8hik8Cibb9WKjX4ZYo1bXaVQFlD7CVoN0q5qJxc4wagfp2O+g/0g3A7OBBXddKw7tgwBladBlFZu+IRTE3Sn5brx65Sc2KYb5LrSx5dniOYBzBRhqU7okzZEk8owdLEAiFS+p6FcAIxadXQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=cornell.edu;dmarc=pass action=none header.from=cornell.edu;dkim=pass header.d=cornell.edu;arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cornell.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2lmheuj0QIAr4OcwDVAedQOVC08CTi6ke6sie7VALwk=; b=N7ZDqUTHT85OB/c2nmFqBv+31HlXGr3nMvcA+vxvur43vRkeNrWedptEg4BuMQXjWVViNetjP7FNZ5c+celVMse8cgjem0WquyJjmTIbYLM7eZtEM/KuT9cfJQvoVqQ4s8MtZ9MjURsdk+WCzPJbyTWfTocyIsN2nJaQxdz1A14=
From: Ken Brown <kbrown AT cornell DOT edu>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Re: Can't debug bash with gdb 8.2.1-1
Date: Wed, 24 Jul 2019 14:32:40 +0000
Message-ID: <69e822c7-d02c-170c-9fed-c0972df16438@cornell.edu>
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> <d4efc941-490d-135b-cfd3-ef7b25f93104 AT dronecode DOT org DOT uk> <bb19dff5-80ed-ef65-d9a8-2a359705423c AT cornell DOT edu>
In-Reply-To: <bb19dff5-80ed-ef65-d9a8-2a359705423c@cornell.edu>
user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0
authentication-results: spf=none (sender IP is ) smtp.mailfrom=kbrown AT cornell DOT edu;
x-ms-oob-tlc-oobclassifiers: OLM:4303;
received-spf: None (protection.outlook.com: cornell.edu does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: ksb2 AT cornell DOT edu
X-IsSubscribed: yes
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id x6OEXGiK000756

On 7/24/2019 8:33 AM, Ken Brown wrote:
> $ cat getpgrp_test.c
> #include <unistd.h>
> #include <stdio.h>
> #include <errno.h>
> 
> int
> main ()
> {
>     pid_t pid = getpid ();
>     pid_t pgid = getpgid (0);
>     printf ("getpid () = %d, getpgid (0) = %d, errno = %d\n", pid, pgid, errno);
> }
> 
> $ gcc -o getpgrp_test -Wall -g -O0 getpgrp_test.c
> 
> $ ./getpgrp_test.exe
> getpid () = 1424, getpgid (0) = 1424, errno = 0
> 
> $ gdb ./getpgrp_test.exe
> GNU gdb (GDB) (Cygwin 8.2.1-1) 8.2.1
> [...]
> (gdb) r
> Starting program: /home/kbrown/Documents/programming/misc_examples/getpgrp_test.exe
> [...]
> getpid () = 1427, getpgid (0) = -1, errno = 0
> [...]
> [Inferior 1 (process 23872) exited normally]
> 
> So getpgid (0) returns -1 without setting errno.  I think this means that
> pinfo::init() didn't fail, but for some reason myself->pgid == -1.

I just ran the above gdb session under strace and found several lines like this:

    25 32828861 [main] gdb 1799 tcsetpgrp: 0 = tcsetpgrp(0, -1)

I haven't looked at the gdb code, but doesn't this mean that gdb is trying to 
set pgrp to -1?  If so, why?  And shouldn't tcsetpgrp return -1 with EINVAL?

Ken

--
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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019