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 AT delorie DOT 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 AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 226A13858D29 Date: Mon, 7 Jul 2025 10:28:14 +0200 To: cygwin AT cygwin DOT com Subject: Re: Segfault if /proc/PID/maps is opened in parallel threads [CAUSE: RtlQueryProcessDebugInformation] Message-ID: Mail-Followup-To: cygwin AT cygwin DOT com References: <2f7ae08b-80c9-4497-f07c-5d527bbb7ec2 AT t-online DOT de> <17bba06c-4bdd-01df-8477-235aff98b2cb AT t-online DOT de> <9deb7d60-b05d-ad7f-e316-64781687953b AT t-online DOT de> <68cbc37b-4825-6e3f-5918-f4fee20d7c05 AT t-online DOT de> <1627d7b2-15f0-c58e-49e1-13f992561bc9 AT t-online DOT de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1627d7b2-15f0-c58e-49e1-13f992561bc9@t-online.de> 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: Corinna Vinschen via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Corinna Vinschen Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" 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