X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3A0573858C56 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1713570421; bh=iybDSc3TadmWOrbSg0cBIZlo/I1Z1PyBFIyNearZm2E=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=xFK69IP7KhnU3BpnWwaHWe96mEhts5g/M4CQhOnzlffVfsBqLvpdX1CAccJ6DiTvF DQYasvQtbNHO2aDEfzIyAQVC8+B0uaGklr818kIW2PcwRb/D9JQphZR/+4SUumGMwN KwpLU1qmGNaXRHdlYFFcrGC6kUn+l5MZm0QKE21M= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF9293858415 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AF9293858415 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713570399; cv=none; b=j7gYPt14nEj2fUrWUvAXKm6PRQNrvdUoNWHyFLbmXrXF74jMgLsZrQcm9my/V2uDtW4YWwc0mnCQ6pBS1dHFqhi6iFbeiymrJTJztobcYXwHr3XrihmmUWJo4XGQ6AZhb0+EvY5rRgOSx1vbCBETNNPfDpkOtnDsbA4ZxmTp7Co= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713570399; c=relaxed/simple; bh=d/GND8Z/7CZ4RYuGu7EuLnYgfiSKjfIlkC/A/e6XtEo=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=anjV3twzLefKgr+4UVZyXKX/LhpeXIl53NsvcqFQ70RR/l+x/7552VziD2CK/cWfISJNcSap6ZDTvLsxUg61DiSZn7u0aEzDsLZRfMDdWtAVJ+3FBxjCyQdIp5KDsJkzNGIWwb/COXUUEnZuVpVHnw5ncERh1Pxx2jUP+K83Ipo= ARC-Authentication-Results: i=1; server2.sourceware.org X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713570395; x=1714175195; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zwQj9uQHbFZH2PjhV6hCW0wH81Fz5btGVXJKGLArrZQ=; b=JMA7yON0JcCZNHmJaQgA8hLSpFahtZEXqsrb8pL8kLsBqBw4PsyCNNGT/1LKTGM2wA A9cy/5tml//c/0GN4iYtWqFls3140kEOjZB5cfzz5FyFt5HNrj8IhoU+6DXeFRkXuk6t p4stQfxwJaN8BwXBB4G9L99Zq+PgvBp3fUua0G8JoP6RypptUUA5FCVWRA/9FDXA/4Nh Yg84skvruVyrbwNw7HLK6gcBw5Fd1J7zSXeKD/o7rXAxaC5pHIysKFztowq/sJ+fq6PZ pRcuG8rb1sPsd2WBfd3jyp//JBUPLu46k31o1Grz6n3uJHROaa+oUMdHIo+tnmbsUBOY a6fg== X-Gm-Message-State: AOJu0YzsQxTKwliVAQqvdexIcPnWAYcXkWai+d4D6orxQOBCE3mhL4qi EE/Y5jvPVav/PhTc8OTwDC+NSgUadnUIMx3Mzk83Bm1FMBZC6HVwssYwiK9iE4vWcK1yvKpWisc +7M+YYcNfYoW5hZBxXzqxn/Zis+pkOA== X-Google-Smtp-Source: AGHT+IEp0B/js57QZcX2jb9xdRImySdwRbE3ApDzs8Dufixus//vNVpZPCZTTgTcL9cFeav58hfjdl60tiBa0WMavm0= X-Received: by 2002:ac2:4465:0:b0:515:bacd:adbf with SMTP id y5-20020ac24465000000b00515bacdadbfmr2053838lfl.34.1713570394814; Fri, 19 Apr 2024 16:46:34 -0700 (PDT) MIME-Version: 1.0 References: <36e07086-b975-416d-b2c1-a5bd208cb7de AT SystematicSW DOT ab DOT ca> In-Reply-To: <36e07086-b975-416d-b2c1-a5bd208cb7de@SystematicSW.ab.ca> Date: Sat, 20 Apr 2024 01:46:08 +0200 Message-ID: Subject: Re: Cygwin 3.5.1: unable to open output file '/cygdrive/t/tmpdir/x-01564d.o': 'Operation not permitted' To: cygwin AT cygwin DOT com X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 List-Id: General Cygwin discussions and problem reports List-Archive: List-Post: List-Help: List-Subscribe: , From: Dan Shelton via Cygwin Reply-To: Dan Shelton Content-Type: text/plain; charset="utf-8" Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 43JNl2iN4066420 On Mon, 11 Mar 2024 at 17:59, Brian Inglis via Cygwin wrote: > > On 2024-03-11 04:27, Roland Mainz via Cygwin wrote: > > On Mon, Mar 11, 2024 at 8:01 AM Cedric Blancher via Cygwin > > wrote: > >> On Fri, 8 Mar 2024 at 03:25, Dan Shelton via Cygwin wrote: > >>> I've run into a problem with clang on Cygwin 3.5.1 and 3.6. My machine > >>> does not have much disk space left, so I switched TMPDIR to the > >>> network drive. But clang then failed, like this: > >>> > >>> $ cat x.c > >>> #include > >>> int main(int ac, char *av[]) { puts("hello world"); return 0 ; } > >>> $ mkdir /cygdrive/t/tmpdir > >>> $ TMPDIR=/cygdrive/t/tmpdir clang x.c > >>> error: unable to open output file '/cygdrive/t/tmpdir/x-01564d.o': > >>> 'Operation not permitted' > >>> 1 error generated. > >>> > >>> /cygdrive/t/tmpdir/ is a clean dir. > >>> /usr/bin/touch /cygdrive/t/tmpdir/dummy works without problems > >> > >> I can confirm the bug, but only for the clang version linked to > >> Cygwin. clang version of MinGW does not show that error, so this looks > >> like a Cygwin bug. > > > > I can reproduce the bug on Cygwin "CYGWIN_NT-10.0-19045 > > 3.6.0-0.73.gc2310061c66a.x86_64": > > ---- snip ---- > > $ cat x.c > > #include > > int main(int ac, char *av[]) { puts("hello world"); return 0 ; } > > > > $ TMPDIR=/cygdrive/t/tmpdir/ strace -o clang_tmpdir_on_nfs41fs.log > > "C:\cygwin64\bin\clang-8.exe" x.c > > error: unable to open output file '/cygdrive/t/tmpdir/x-8cb6f7.o': > > 'Operation not permitted' > > 1 error generated. > > ---- snip ---- > > > > Full strace log is at https://nrubsig.kpaste.net/ff6248c25 (I use the > > line numbers from that site below). > > > > It seems starting with line 2949 this goes wrong: > > ---- snip ---- > > 505 5069822 [main] clang-8 40295 symlink_info::check: 0x0 = > > NtCreateFile (\??\T:\tmpdir\x-8cb6f7.o) > > 3645 5073467 [main] clang-8 40295 symlink_info::check: not a symlink > > 266 5073733 [main] clang-8 40295 symlink_info::check: 0 = > > symlink.check(T:\tmpdir\x-8cb6f7.o, 0x7FFFF96E0) (mount_flags 0x4020, > > path_flags 0x0) > > 310 5074043 [main] clang-8 40295 path_conv::check: > > this->path(T:\tmpdir\x-8cb6f7.o), has_acls(1) > > 305 5074348 [main] clang-8 40295 build_fh_pc: fh 0x800027A30, dev 000000C3 > > 1441 5075789 [main] clang-8 40295 __set_errno: int > > check_access(security_descriptor&, GENERIC_MAPPING&, ACCESS_MASK, int, > > bool):600 setting errno 13 > > 257 5076046 [main] clang-8 40295 check_file_access: flags 0x2, ret -1 > > ---- snip ---- > > > > So |build_fh_pc()| somehow fails with error 13... but I don't understand why... > > > > And then there is this weird ACL: > > ---- snip ----- > > $ ls -l /cygdrive/t/tmpdir/x-8cb6f7.o > > -rw------- 1 Unix_User+197608 Unix_Group+197121 0 Mar 11 11:00 > > /cygdrive/t/tmpdir/x-8cb6f7.o > > $ getfacl /cygdrive/t/tmpdir/x-8cb6f7.o > > # file: /cygdrive/t/tmpdir/x-8cb6f7.o > > # owner: Unix_User+197608 > > # group: Unix_Group+197121 > > user::--- > > group::--- > > other::--- > > ---- snip ---- > > > > /usr/bin/file, echo&&/&/usr/bin/cat can read/write that file > > ---- snip ---- > > $ file /cygdrive/t/tmpdir/x-8cb6f7.o > > /cygdrive/t/tmpdir/x-8cb6f7.o: empty > > $ echo "foo" >>/cygdrive/t/tmpdir/x-8cb6f7.o > > $ cat /cygdrive/t/tmpdir/x-8cb6f7.o > > foo > > ---- snip ---- > > > > I have no idea why clang fails in this case... I need help with this one... > > For normal temp space behaviour under Cygwin, I found you have to: > > chmod -c a+rwxt /cygdrive/t/tmpdir/ > setfacl -m u::rwx,g::rwx,o::rwx,d:u::rwx,d:g::rwx,d:o::rwx /cygdrive/t/tmpdir/ > > to set the DACLs to rwx and avoid any problems. That does not work either. Dan -- Dan Shelton - Cluster Specialist Win/Lin/Bsd -- 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