DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 538F8RXX2129179 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 538F8RXX2129179 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=N1o2Cixa X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A7A9385B519 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1744124907; bh=vrMiujvqsM6nJIO4brq/snNcT24/U2OzIxm1s2/k/fc=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=N1o2CixaQGi3sgD5Cf8BCJPfCNSibi3pgUhHKYQ9eSfumX7GSsVeDiGCeRuzqxk3h K1S8pLhexPCiRCl2nZkRrYJEB/cJOBtU8GdDvJYPkw396JDB3gnlYZE//z58A9vw1+ 7OET8iu7Jt8nhV2oVnSpppAjgTxB+nLQ5RUlzIcI= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8CB9D3858D35 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8CB9D3858D35 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744124881; cv=none; b=Nw6cq/HI/NvJgtdzLZ2jXAzaeifuVJr7ADJ/uNEQE1yL7Q5dZzkKU+5LWYzTX2EoPHnNL22elEk4AcVVYenQtm8V83Nc5v/E0e1VRnBBQdRXqf6/zPKo7PDw2TSLFURUVvkBAcXP1HSdNO/byq7uRqVblq3gb+5MRLsFwflRC0Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1744124881; c=relaxed/simple; bh=9mejA2hDEdBcFRmxIO60uWjAaBHhkPDgyjvnsGPV/A0=; h=Subject:To:From:Message-ID:Date:MIME-Version; b=aIsirDJfO2TKw1qfmHk2lJY5+202km3Z8p5C+FsLddC15pdvXc6mMpayqoG5LIQlmV38EULR+LF9P2j8tD8jhLIMVWQatyenSXdRkT5phLmWEDYnbSrSE4PUAh/AjKtVOM0+L3IogwzUB5p6/2u6r888p927El8cnsCvWC58Kfs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8CB9D3858D35 Subject: Re: ftruncate() may fail with EISDIR if other process calls open() To: cygwin AT cygwin DOT com References: <8006969c-037a-14a5-7a27-9572d48d605c AT t-online DOT de> Message-ID: Date: Tue, 8 Apr 2025 17:07:47 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 SeaMonkey/2.53.20 MIME-Version: 1.0 In-Reply-To: X-TOI-EXPURGATEID: 150726::1744124867-4CF5150B-50C58819/0/0 CLEAN NORMAL X-TOI-MSGID: 6f33f388-af38-460b-be89-0eae2c9a94af X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christian Franke via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Christian Franke Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Corinna Vinschen via Cygwin wrote: > On Apr 8 13:50, Corinna Vinschen via Cygwin wrote: >> On Apr 7 09:59, Christian Franke via Cygwin wrote: >>> Found because 'stress-ng --fcntl 2 --verify' reports "ftruncate failed, >>> errno=21": >> Thanks for the testcase. I know what happens. Stay tuned for a patch. > Nice problem. That's what happens if you try to do what an OS is doing, > without actually being an OS, just a user space lib. Theoretically we > should never cache any file information but always call the matching OS > functions. Only... this adds quite a few context switches every time > accessing files. Sigh. > > I just pushed 2d81f6ebe3dc ("Cygwin: open: always fix up cached DOS file > attributes after NtCreateFile"). > > Try the upcoming cygwin-3.7.0-0.47.g9e6193576f34. With a local build of 3.7.0-dev-49-g42df80dad079.x86_64, both the testcase and stress-ng no longer fail. -- Regards, Christian -- 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