delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/10/10/15:22:27

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B62353858C52
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1696965745;
bh=p/KgBaPaFcMoksvOyWDynY443/1iytCVcLW5ewufriQ=;
h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:
List-Help:List-Subscribe:From:Reply-To:From;
b=g1ZN9+js4XKIIqVhfq5nZsQcfycGGmrbxJstnW++mATzSslfB3ZLb9mun9PlzfUc3
WBMznnyTWclB7JKcNGA/icgv86GQ6Z4q/3M3eRDrL2RiDGzGD08w/gGjr87ybOWH5u
xfRsqS02yvYQXwSvLMSpNnjXywLl2eEE6xqkpUBA=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3B8D43858CDB
Date: Tue, 10 Oct 2023 19:22:03 +0000
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
Subject: Freezing because cwdstuff::set has excessive release_write
Message-ID: <FBphpN4LL2Dqry5xVx3GF2FZQd7TMNO4Tqmk06glsEus-YNDU5epdecaqha2X9O3uJAlJVomBeZK3NCZ9boqvaW8SafM9dbfGBsHhEcBSC4=@proton.me>
Feedback-ID: 63211331:user:proton
MIME-Version: 1.0
X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_INFOUSMEBIZ, RCVD_IN_MSPIKE_H4,
RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_PASS,
TXREP autolearn=no 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 <cygwin.cygwin.com>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: tryandbuy via Cygwin <cygwin AT cygwin DOT com>
Reply-To: tryandbuy <tryandbuy AT proton DOT me>
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

I think that there is an excessive release_write() in cwdstuff::set.
A link to the call:
https://github.com/cygwin/cygwin/blob/fe5886a500e66cddf0f57eea3049d25d5f8765e9/winsup/cygwin/path.cc#L4871C13-L4871C13

This call leads to a double release of SRW lock which causes deadlocks in some cases.

Test cases to this issue:
1) using Cygwin terminal
  1.  open Cygwin terminal
  2.  mkdir test; cd test; echo 123 > 1.txt
  3.  chmod -x .
  4.  strace cat 1.txt  # <-- freeze
      # cd ..; strace cat test/1.txt  # <-- no freeze

2) using windows console
  1. open cmd.exe
  2. cd <path to the previously created test directory>
  3. C:\cygwin64\bin\cat.exe 1.txt  & rem <-- freeze
     rem cd ..; C:\cygwin64\bin\cat.exe test\1.txt <-- no freeze


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

- Raw text -


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