From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by sourceware.org (Postfix) with ESMTPS id 6445D386F474 for ; Wed, 29 Jul 2020 11:22:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6445D386F474 Received: by mail-io1-xd32.google.com with SMTP id k23so24054039iom.10 for ; Wed, 29 Jul 2020 04:22:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=vJakGYZLDN3KiVkdYF1juXr4CCuL5mfLiynW4HO9+HY=; b=FPrb5ZeTFYQxqkRaBTN/jdW67qFcQ/5dAp2272vVcHOaGeYUt+EYgquVxtcFF7ZbqL oVkcDYpyfRtbZxc379QV7EQCPdc95vW8C2hAatWAxTlFWdByTUPOfXJWPzEkdksE5j08 9QoJhyHxH5z4sM9BjNrr7AgBePdJBCajFX65IRSpOXr0GToC3CF/MQhp3RdtB4lY6iBK c0Gc16xfMcWmtAPQEBu0DccROadqUdo5UsG2C50h0EdeyNoZNsHIhQYC8M41M0EUn9TA oJol9Jfi4CU/lYf1fDyn9rAmYCKRfcDX76oFjrUFLPe7RgOsfrhlG34ps2aYeg3JZMUK N6Mg== X-Gm-Message-State: AOAM532TK+QTmOk1IJF7ZAoXGMBqW38H2aEgiynp+zED85OIS4sO2LBQ zSx0lEsaFBpdT2P5Q+Di/l1fxMOiilX2m2GsZPftcev2CnUR2Q== X-Google-Smtp-Source: ABdhPJwCV9GnSLGlMl6QCqHpt6Z/QlUn9UvCu1P9n0iAPczVU+XYCC4eD77bOA3iVPZuOZiq7z6Xv+Jz9j671DJtri4= X-Received: by 2002:a05:6602:2c01:: with SMTP id w1mr33897463iov.130.1596021743327; Wed, 29 Jul 2020 04:22:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "E. Madison Bray" Date: Wed, 29 Jul 2020 13:22:10 +0200 Message-ID: Subject: Re: Cygwin's sqlite3 modifies DLL search order To: cygwin@cygwin.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 11:22:25 -0000 (Oops, resending this upon realizing I didn't reply to the list) On Fri, Jul 17, 2020, 09:34 Jan Nijtmans wrote: > > Op do 16 jul. 2020 om 18:48 schreef E. Madison Bray via Cygwin: > > > > Hi all, > > > > After some significant headache I discovered a problem introduced by > > the Cygwin patches for sqlite3. The effect of this patch is that it > > modifies the DLL search order for all subsequent DLL loads (by > > filename instead of absolute path) in the application. > > Thanks for bringing this to my attention. I'm open to suggestions how > to fix this. Yes, this code is already in for a long time. It even contains > an experimental part (the part within #ifdef _WIN32), when I was > trying to make a Win32 build of SQLite work in a Cygwin environment, > oviously a bad idea ...... > > Thinking about it, I have an idea how to fix it: Currently extensions > (when using the win32 vfs) are loaded using the Win32 function > LoadLibrary(). Changing that to use dlopen() might already have > the desired effect, then this section can simply be removed > completely. > > Thanks! > Jan Nijtmans Hi Jan, Thanks for commenting on this, and thank you for all the work you've done maintaining this port! Yes, the original patch you came up with made sense to me so I was still a little confused by why the SetDllDirectory stuff was added. But I'm sure it fixed something at the time. As long as we're patching it for Cygwin anyways I think your idea to use dlopen() makes sense. Cygwin's dlopen should do all the path management properly anyways :)