delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2025/04/05/11:54:58

DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 535FswH6388808
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 535FswH6388808
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=dqx8HAK9
X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B1B83858294
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1743868496;
bh=NeChccdukdKejgOdmD/X7996GJz19hTzWP4yGKLd/+c=;
h=Date:To:cc:Subject:In-Reply-To:References:List-Id:
List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:
From:Reply-To:From;
b=dqx8HAK9csWpnytjYjtMAI+8IQ5eIVqMnOkAS3GEoj+EiB25HWw0TFwfcQN5jt7C6
mnVu0RPo+ThR0oxdPeXaO5A0f0hf7GYc6/bXZpFBv7gaCEXJRgsf6OGj2ba0VE44Mu
BKtR/aQtvWAec2x/Cp030FkA0U7PUGWs3hOqCtso=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3F4413858294
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3F4413858294
ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1743868436; cv=none;
b=UIrwmRNqVyBWju83k7soQSzUKueW/C4RZIeLkkZp+Y9yWpxsrqHRqJUmDECKPGxBE5kA9kdv2y9lp3+o7Qd52BH3HuG9qvB+l8RrwEucYCPYqUXCs8OsjXdxqnqlQjMhQLrdp5heWfK+1I7zjspgQrie8CMilFPnxfc/KxCLyyo=
ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key;
t=1743868436; c=relaxed/simple;
bh=jrHmYA7bjrYhDg0kJ+uW6o+JbWWe4yW9GAxGy7qcdj0=;
h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;
b=aOzbeayQk9cA4dkjFVn1oByreu6CSBeQ/8vQFZVS6zMQOjtPq49F1pvooeJvvX18zEgPt3ttcjKbIIJln4+FYIXHzqrw88Bxhpe7sYPWuHZToBcuiHkR6m8OINNZ+gQwl703qyPF5GRhodGd/UFv/DXfkqpjLZBkhub/m5WCDCQ=
ARC-Authentication-Results: i=1; server2.sourceware.org
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3F4413858294
Date: Sat, 5 Apr 2025 08:53:55 -0700 (PDT)
X-X-Sender: jeremyd AT resin DOT csoft DOT net
To: Jon Turney <jon DOT turney AT dronecode DOT org DOT uk>
cc: cygwin AT cygwin DOT com
Subject: Re: dladdr and dll refcount
In-Reply-To: <15190784-9033-46f6-b8d5-1136283958fe@dronecode.org.uk>
Message-ID: <21539ea0-3742-ff54-76dd-0f2bf495364d@jdrake.com>
References: <2ace5ff8-29a2-06a4-6c24-668439d4eb08 AT jdrake DOT com>
<15190784-9033-46f6-b8d5-1136283958fe AT dronecode DOT org DOT uk>
MIME-Version: 1.0
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-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
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: Jeremy Drake via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Jeremy Drake <cygwin AT jdrake DOT com>
Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com>

On Sat, 5 Apr 2025, Jon Turney wrote:

> On 05/04/2025 06:28, Jeremy Drake via Cygwin wrote:
> > I just happened to look at dlfcn.cc dladdr function, and I had a question.
> > Should dladdr be using the GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT
> > flag?  It doesn't seem like dladdr should be incrementing the refcount.
>
> Indeed. Well spotted.
>
> This looks like my mistake back in commit
> c8432a01c8401c121940c806a9d868c4adc4cefd
>
> Assuming that flag is available on all applicable Windows versions, it
> certainly looks like we should be using it (otherwise, I guess we just
> immediately free the handle).

This function (and flag) go back to XP.  (I remember this because I was
irked about not being able to use it, the company I worked for was
supporting old windows versions well past their sell-by date).  I'll send
a patch.

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