DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 5678TJDY4117501
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 5678TJDY4117501
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=pnMpY245
X-Recipient: archive-cygwin@delorie.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7ADEC385840B
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
	s=default; t=1751876953;
	bh=g2SKSWlg1Ey20s34ifaFTHOoxsk4YoCLhpiSONkja5g=;
	h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe:
	 List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:
	 From;
	b=pnMpY245Pp5OUw0so6RrP4KhdxXmn21DwNbS9tvs4L5HCCSkZrRPYx5bwAch1mkSM
	 /dT6/RHrCx8kGT93U6+E0oCFzzEks6rmkNHNmO4Xq+jJkJX+m/A66FJmCt6/oTqjgN
	 MxJ8lvK2FYHIHUEk45NtG3tuyBDSqBA0PoPTvl+Y=
X-Original-To: cygwin@cygwin.com
Delivered-To: cygwin@cygwin.com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 226A13858D29
Date: Mon, 7 Jul 2025 10:28:14 +0200
To: cygwin@cygwin.com
Subject: Re: Segfault if /proc/PID/maps is opened in parallel threads [CAUSE:
 RtlQueryProcessDebugInformation]
Message-ID: <aGuFHqjgqW51xIFH@calimero.vinschen.de>
Mail-Followup-To: cygwin@cygwin.com
References: <2f7ae08b-80c9-4497-f07c-5d527bbb7ec2@t-online.de>
 <17bba06c-4bdd-01df-8477-235aff98b2cb@t-online.de>
 <9deb7d60-b05d-ad7f-e316-64781687953b@t-online.de>
 <68cbc37b-4825-6e3f-5918-f4fee20d7c05@t-online.de>
 <aGVeI9glhLe2UzTu@calimero.vinschen.de>
 <aGZjZKoT86ptfahW@calimero.vinschen.de>
 <1627d7b2-15f0-c58e-49e1-13f992561bc9@t-online.de>
MIME-Version: 1.0
Content-Disposition: inline
In-Reply-To: <1627d7b2-15f0-c58e-49e1-13f992561bc9@t-online.de>
X-BeenThere: cygwin@cygwin.com
X-Mailman-Version: 2.1.30
Precedence: list
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-request@cygwin.com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
 <mailto:cygwin-request@cygwin.com?subject=subscribe>
From: Corinna Vinschen via Cygwin <cygwin@cygwin.com>
Reply-To: cygwin@cygwin.com
Cc: Corinna Vinschen <corinna-cygwin@cygwin.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cygwin-bounces~archive-cygwin=delorie.com@cygwin.com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie.com@cygwin.com>

On Jul  5 19:34, Christian Franke via Cygwin wrote:
> Corinna Vinschen via Cygwin wrote:
> > I just added two patches, one of them dropping RtlQueryProcessDebugInformation
> > in favor of EnumProcessModules in dlsym(), the other by adding a global
> > mutex to format_process_maps while accessing the debug buffer.  I could
> > reproduce the crash even if RtlQueryProcessDebugInformation was serialized.
> > I could only avoid the crash by serializing the entire code from
> > RtlCreateQueryDebugBuffer up to and including RtlDestroyQueryDebugBuffer.
> > 
> > This ignores native processes which have a hard time to access
> > /proc anyway.
> 
> Many tests show that the problem with /proc/PID/maps does no longer occur,
> thanks.

Great, thanks for testing.

> dlsym() not tested, sorry.

It's basically a revert of an older patch anyway, since originally
dlsym() used EnumProcessModules().  I checked that it could still
resolve a symbol from cygwin1.dll when using dlsym(RTLD_DEFAULT, ...).


Thanks,
Corinna

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