X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4D4C33861036 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1599593533; bh=uyHKLRO6Yl2iIxmu5vXDdbMDAczh0bLMJ5gPoXdA0uY=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=AiFcQpVsBXdAr3/PyqGvIE8MR0rUim1Zo+0xWZ8UdPMqCCGylV93CkXhLOAxLTXdT KCq8MDc4g+Tu+FNOTthj7X8yEEBDnJ7trSa3KtFpKH1yKSQuCKZfGcYDm6au9B8+yl OMql8IAA2bOCkBUvwn0kiy1VEPcvYUPIm/T7vVZU= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 320583861036 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aGg+h3wS0qbs+Cr+XUJkMbwLiPQXEJOEGdf8OTNxy9CDuwn7V/8dRAUnBYEt3nKOBcbiaqBuGvn7EF0UzXMp9QU4wP+bo4qXoCOs3SOln73NMUtunLBgDtJBXOFq57GOPLVmNB+9Etx85jHyzWrgieNOW+lM3U5Mz1FIUHygP+SI4MkNyjUYuAt+E+wOgXqNarbURGTdkj3dCi31PHgeQkFm8mQjxD8rZFWvz3l3/0NyO6Pri5YZCn8i9ia7jpRYsl/5GmjwFvq0i3PWcRA4a1GHcSwe1B9Yl1PTcfmrlGjDD2eGcfZr1tH+3+pyq5rOQkkH+A3RX6hYDxLFm17uOA== 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=+H9dPnolUaCzDunROyzz2O+jr1Q8ELaR5UYXLGYkFvE=; b=LW/Up+JN7IUN3l1IFK7lNPtinJs/ONc7LOhTXTP1f1QEcb4xnDV6DsUn8/aX+9GpjgjxMLdmN0mncCczCTBCtlSO0S0cAuQ+DtlRskp016X5rT5eWhLH8UIsPQSrO8MDtr80+wdkF3rTXnJRqVNqZJRDom+r66pQ7FjEoFWE+yn31oPFp5DlQtkgt9pFmDnxY9++XdKugLUJLQxzn0g3LUIHIGfOZlkOL8phYi5J5A2OGxIpflbZ6aFbfqcH9/MImat33xQq64NPU6X5sduQnULnRhtq42KWsCk8HuagyYZcVvK0C4faSRnku9UPb0EXThxjoUea/pnHNm6X4nXfIg== 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 Subject: Re: ag 2 <(echo 2) gets assertion "p >= path" failed: .. /cygwin-3.1.7 ... /cygwin/path.cc", line 3065, function: int symlink_info::check To: cygwin AT cygwin DOT com References: <26aedc53-30f2-d1a2-f9e8-c8a5dfa548c1 AT cornell DOT edu> <6c7185c9-f0a5-2b73-974f-04b55f8e6508 AT cornell DOT edu> <0ed7b3f0-7e2b-eb28-596b-6dcba9ee51dd AT cornell DOT edu> Message-ID: <76a478c7-fabe-b8e9-581e-9ffcc08f53ed@cornell.edu> Date: Tue, 8 Sep 2020 15:32:07 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 In-Reply-To: <0ed7b3f0-7e2b-eb28-596b-6dcba9ee51dd@cornell.edu> Content-Language: en-US X-ClientProxiedBy: CH2PR14CA0034.namprd14.prod.outlook.com (2603:10b6:610:56::14) To MN2PR04MB6176.namprd04.prod.outlook.com (2603:10b6:208:e3::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [IPv6:2604:6000:b407:7f00:fc34:902a:527a:1c90] (2604:6000:b407:7f00:fc34:902a:527a:1c90) by CH2PR14CA0034.namprd14.prod.outlook.com (2603:10b6:610:56::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16 via Frontend Transport; Tue, 8 Sep 2020 19:32:08 +0000 X-Originating-IP: [2604:6000:b407:7f00:fc34:902a:527a:1c90] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 07615072-35c5-4000-391a-08d8542de028 X-MS-TrafficTypeDiagnostic: MN2PR04MB5742: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: O38sj8U2hOVNUAmXQ9tCOsMziXF+8aD75zk5Srkk/1Zkq5irJei1z/sMMr6rhRleCvou9C9/g/aRmyDl4gVjxZAI3Y35uWloqluzttTeZsBgrKRTjy0GxNEVruJem/l0NUqglAReMJxa7rG+AiWCbRxEeQLfruFE+qh3i4hhwxjR0VsQ3uquOfw4UG45BoqcJksTCukmuWklGoxTblI1zFGPdMQt6ELIIbmkUjdwAehGJNB8VZA/Jj8x8+nA7TLtGW2kCSaWhKSA1WOX8RSZQIsWZzQYEm3KNnTSHXCwx99wxnExG9BxQJOndY6vLNvH37BFquoqSK5BTGhOXET12vjTnXiWZc51tpjTEns5Zo15hNdC98qesYUL/pmtv0BfOfBfVdPEwd0VzPYD4rJOQolWoY3h1EiY3XY5h+cBEBo4gQU46++JvpmDUtCBujw+ViuakWpawfNTIsHkpoYikqCOYjkJntCBe/o76UDq48o= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR04MB6176.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(376002)(136003)(396003)(346002)(366004)(39860400002)(5660300002)(2616005)(66946007)(66476007)(66556008)(53546011)(8936002)(83380400001)(2906002)(31686004)(16526019)(75432002)(186003)(6916009)(478600001)(316002)(36756003)(31696002)(4326008)(86362001)(6486002)(8676002)(786003)(52116002)(966005)(43740500002)(460985005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: qoJAAccYJkj3Zvab91URhw5ecq5e3CUtW6No2dH2fPMSfAFNS8ChYqWh/eH9RcceyIGaILKERLvD/8q9NYvz7a8oM5aUBpu3m4OM6dS9EX9EqNIVpfboItwqQgIRf3QTfzi46nc/VZ489IhW60qsQLiXsoFNI0hI59f8AKhFKQ5lfW5VHNzkCCZ+FOIStNMYkHBr24qaEYS1lp5BQjKHJCAqCC9AB0kzyY47e/hUXLYVotZRDdWL4Z0qRFDx5ELiPRn62S5wR4aV5+cmkMs+f8Io761OOfV9gSkNoSnVrLmcgM9l3SpPHoiX/Q1PlogyLIIUdMu54Ari9YgEZi44MleVNjqeDwLr23KHAo4KOUDgNjPb5CrYcT09Q/4lNi7vjxghCmpUYY+HMoYe2IJxCcAhXcwJbP7QklgXEMLNjkwZz53SLm+//KMGU/PDF37wnDbsdbS4t8qKx9rNo26WS1ReGgJybal4z9nTbX3hYo12D7b+fhBYNOcU6t8g9utJFFAsCfLWUnDbu7WW1fezaex7ZeoV2lFqHGcWc5EBbBN4pwXGKNxRZNhF2L7VfOuOfbtYOW4T7l6bkRXSSV14Uk4WW6oQvmFPF4V3LeilXzDWUNZttgvUw5hYZRnEbW88eXWyOdqDTrUOu75cywJH7YyS2RBDtg1cCOG+3tJqgCMVMDKnOIdb0vQ1lN1GcwwFuhzFLLOytHwGiWofec57gw== X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 07615072-35c5-4000-391a-08d8542de028 X-MS-Exchange-CrossTenant-AuthSource: MN2PR04MB6176.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Sep 2020 19:32:08.5648 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 52SJr93thW0JUsAROgON76Vnpl8ynlHYffWhwHZ72d8C2qcuOAaALdGBvGEiI3jRd3DnOAq8wGIz6+++aPV/Jg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR04MB5742 X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_INVALID, DKIM_SIGNED, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Ken Brown via Cygwin Reply-To: Ken Brown Content-Type: text/plain; charset="windows-1252"; Format="flowed" Errors-To: cygwin-bounces AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 088JWcY1032604 On 9/8/2020 3:26 PM, Ken Brown via Cygwin wrote: > On 9/7/2020 4:35 PM, Ken Brown via Cygwin wrote: >> On 9/6/2020 4:28 PM, Ken Brown via Cygwin wrote: >>> On 9/6/2020 3:47 PM, Ken Brown via Cygwin wrote: >>>> On 9/6/2020 2:43 PM, David Dyck via Cygwin wrote: >>>>> This command triggers an assertion failure >>>>>    "ag" is from the_silver_searcher >>>>> >>>>> $ ag 2 <(echo 2) >>>>> assertion "p >= path" failed: file >>>>> "/home/corinna/src/cygwin/cygwin-3.1.7/cygwin-3.1.7-1.x86_64/src/newlib-cygwin/winsup/cygwin/path.cc", >>>>> >>>>> line 3065, function: int symlink_info::check(char*, const >>>>> suffix_info*, fs_info&, path_conv_handle&) >>>>> Aborted (core dumped) >>>>> >>>>>   3473k 2020/08/22 C:\cygwin64\bin\cygwin1.dll >>>>>      Cygwin DLL version info: >>>>>          DLL version: 3.1.7 >>>>> bash                                    4.4.12-3                        OK >>>>> the_silver_searcher                     2.2.0-1                         OK >>>> [...] >>>>> assertion "p >= path" failed: file >>>>> "/home/corinna/src/cygwin/cygwin-3.1.7/cygwin-3.1.7-1.x86_64/src/newlib-cygwin/winsup/cygwin/path.cc", >>>>> >>>>> line 3065, function: int symlink_info::check(char*, const >>>>> suffix_info*, fs_info&, path_conv_handle&) >>>>> Aborted (core dumped) >>>> [...] >>>>> I've reported this on github as an "ag" bug, but I think it is a bug in cygwin >>>> >>>> An assertion failure in Cygwin code is a Cygwin bug.  I'll take a look. >>> >>> Running >>> >>>    bash -c '/usr/bin/ag 2 <(echo 2)' >>> >>> under strace yields the following: >>> >>>    242  191767 [main] ag 33659 open: open(/dev/fd/63/.ignore, 0x0) >>> [...] >>>     30  192584 [main] ag 33659 mount_info::conv_to_win32_path: src_path >>> /proc/self/fd/63/.ignore, dst /proc/self/fd/63/.ignore, flags 0x0, rc 0 >>> [...] >>>     31  193366 [main] ag 33659 mount_info::conv_to_win32_path: >>> conv_to_win32_path (pipe:[4295036184]/.ignore) >>> [...] >>>     31  193550 [main] ag 33659 mount_info::conv_to_win32_path: >>> conv_to_win32_path (pipe:[4295036184]) >>> [...] >>>     34  193615 [main] ag 33659 symlink_info::check: 0xC0000034 = NtCreateFile >>> (\??\C:pipe:[4295036184]) >>> >>> The assertion fails because the path 'C:pipe:[4295036184]' doesn't contain a >>> backslash.  But probably we should never have allowed ourselves to get to the >>> point of considering that path. >> >> I've made some progress but haven't figured out the fix yet.  First, for >> easier debugging, here's a simpler way to reproduce the problem: >> >> $ cat proc_bug.c >> #include >> #include >> #include >> #include >> >> int >> main () >> { >>    int fd[2]; >>    char fname[100]; >> >>    if (pipe (fd) < 0) >>      { >>        perror ("pipe"); >>        exit (1); >>      } >>    sprintf (fname, "/dev/fd/%d/foo", fd[0]); >>    if (open (fname, O_RDONLY) < 0) >>      { >>        perror ("open"); >>        exit (1); >>      } >> } >> >> $ gcc -o proc_bug proc_bug.c >> >> $ ./proc_bug.exe >> assertion "p >= path" failed: file >> "../../../../newlib-cygwin/winsup/cygwin/path.cc", line 3065, function: int >> symlink_info::check(char*, const suffix_info*, fs_info&, path_conv_handle&) >> Aborted (core dumped) >> >> Here's what happens.  The program is trying to open /dev/fd/3/foo, where file >> descriptor 3 is the read end of a pipe.  path_conv check resolves this to >> /proc//fd/3/foo, creates an fhandler_process for this path, and calls (at >> path.cc:782) fhandler_process::exists.  The latter fills the filebuf with >> "pipe:[xxxxxxxxxx]/foo" and returns virt_fsdir.  We're now at path.cc:808, and >> everything is set up for the assertion failure. > > This is now fixed.  David, you can test it as soon as Corinna has a chance to > make a new Cygwin snapshot. That's now done: https://cygwin.com/snapshots/ Ken -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple