From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by sourceware.org (Postfix) with ESMTPS id AF9293858415 for ; Fri, 19 Apr 2024 23:46:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AF9293858415 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AF9293858415 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::12b 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 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-516ef30b16eso3157339e87.3 for ; Fri, 19 Apr 2024 16:46:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713570395; x=1714175195; darn=cygwin.com; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=zwQj9uQHbFZH2PjhV6hCW0wH81Fz5btGVXJKGLArrZQ=; b=lvaU4zY29yAbfxaAgJ8b0xcCXPYK+Q1zv+gUJWjsD9UMtlEQHr6aMYKsE+4B8G6YbY Uo2eT5NPqPHjhGPGrJyZFCcL1hV8JzqEW2bq7Iqufy0Djfj9mm3EexPY4Gd5Z0enbTx0 /FMt3IPDftjPrw8Y0uY57nm3T8MgmbW5FxYGgORZxagT7nQ7zWF8J4OwKFc3/wjLqneI A9K8RvhszVkKAlcyiEwqq7Uhmgi1vqInEL0yXnbVmwRkFeqvpwSk1Vldih5y4mhKLlyu QJAYHKPMUuhoPD1DLcaOOsFw25gJAl/HIibfk2pCicFxGysoZTBR0/5ZYSSSaK0c2ZTK p6Hw== 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@SystematicSW.ab.ca> In-Reply-To: <36e07086-b975-416d-b2c1-a5bd208cb7de@SystematicSW.ab.ca> From: Dan Shelton 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@cygwin.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 List-Id: On Mon, 11 Mar 2024 at 17:59, Brian Inglis via Cygwin w= rote: > > On 2024-03-11 04:27, Roland Mainz via Cygwin wrote: > > On Mon, Mar 11, 2024 at 8:01=E2=80=AFAM 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 machin= e > >>> 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=3D/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=3D/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 =3D > > 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 =3D > > 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 00= 0000C3 > > 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 understan= d 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 on= e... > > For normal temp space behaviour under Cygwin, I found you have to: > > chmod -c a+rwxt /cygdrive/t/tm= pdir/ > setfacl -m u::rwx,g::rwx,o::rwx,d:u::rwx,d:g::rwx,d:o::rwx /cygdrive/t/tm= pdir/ > > to set the DACLs to rwx and avoid any problems. That does not work either. Dan --=20 Dan Shelton - Cluster Specialist Win/Lin/Bsd