delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/07/02/16:30:24

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=0.3 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,T_TO_NO_BRKTS_FREEMAIL
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
From: Thomas Shanks <thomas DOT shanks AT gmail DOT com>
Date: Fri, 2 Jul 2010 16:29:41 -0400
Message-ID: <AANLkTinPXSl_xGRma70oHxHi7omHCLhI7D9vCvWq0aqw@mail.gmail.com>
Subject: vimdiff sharing violation race condition when diffing .bashrc [Was: Re: Trouble with vimdiff and strace on most recent cygwin]
To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

On Tue, Jun 22, 2010 at 9:13 PM, Thomas Shanks <thomas DOT shanks AT gmail DOT com> wrote:
...
> $ vimdiff  /etc/skel/.bashrc ~/.bashrc
> 2 files to edit
>  7 [?47h [27m [24m [0m [H [J [25;1H"/etc/skel/.bashrc" 130L, 3754C
> "~/.bashrc"  [25;13H [K [25;13H135L, 3884C      1 [main] gvim 1752
> exception::handle: Exception: STATUS_ACCESS_VIOLATION
>   1164 [main] gvim 1752 open_stackdumpfile: Dumping stack trace to
> gvim.exe.stackdump
>      1 [main] gvim 3760 exception::handle: Exception: STATUS_ACCESS_VIOLATION
...


Cygwin.dll and/or Vim devs:

It appears the file was somehow being locked by one of the vim
processes (why does starting vim take a read-lock on .bashrc?) at the
moment the other one was trying to read it.

It is, it seems, a race condition.  It was failing due to sharing
violation 95% of the time, with both (!) vim processes failing to load
their required file the majority of the time.  This indicates that
somehow the problem goes both ways: both the vim reading .bashrc and
the other one trying to use .bashrc can experience a sharing violation
in the same vimdiff call.

The question I have is: why does starting vimdiff use .bashrc, and why
would they both manage to experience a sharing violation when only one
is editing .bashrc?

Could this apply equally to diffing anything that vim loads during
startup, including a syntax highlighting filetype config file or other
config file?

Thomas Shanks

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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