X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=2y5iMBypNZiLxThxhaLL1x7T21a4BrVAR8xIo8EreHI=; b=nhpS+5JRzTubXsgPFXHCe7tiW4Qb2iaHXU6cSNLKa1uUSXO9RqabY+p9CBz+SFMEEN WNTcuuJf6paLfn5jUI4nXjre2gwRQ/iVtRP6JGZUTg7xKvFW3euLw57jO6ah/Kavnpm0 KjfMpTpjm83ZLgeY1C0by/PqDLremNfWpdRZg3mNKI061/wSLjwAllC/nnYx6WhaSpDK AeQha4wo0PHEoap6RoukuVJg2VzJDN4W5U3Nkb7F8a6wDIIuo+LCx/z2ZSYLrtyx6vCI oV8xTO5jCTMC5OF1ag1DtePaL8gDmV8CLcLrLV/8yvXOaFoLcM1LGUyj8tdL3uCUeWPn sfDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:references:in-reply-to:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2y5iMBypNZiLxThxhaLL1x7T21a4BrVAR8xIo8EreHI=; b=mxvXz9uC7KnxCTXjEdhxQJ6LEbjj4ydInwg9IX0QTJ+ujkRqkqXpaMJgWXQcyyQkuS zetR2FfWrahgRJnU1gu+HXeq1Ixo9B1Y7ghKRskwz3zEN8ZQb5OGccqJSzjn90cfg8+A 5CCcIVEwP2OPoK7FE9OauDLqHNl027tbh8QvrqIZgw0M1znK8EhhMMtl2hxd4YowoE2E HYN/pBu0pFp8gw3bUEdrsb8PMo09TEQ3rydMNEgFnRmYC7QQPgOgKpBeSr4RFXAw8ju/ 3RiHY+Bs78LBU8Z1uKj7uKbctCKRKIxJNMPOMxQRlqyv4FIsNG0h1ehnKkHLs8+cK7IG bq0A== X-Gm-Message-State: AO0yUKVcNzjaJXyg5NC7GaS3kRhC8Z1J8W3PjD/Ge80ki6GbL5A75G8m MNZWRFNgbyjgiFkRe2i+pNzuyouVe2W6gUzqAmFvQDN1 X-Google-Smtp-Source: AK7set+3nKEnXWLfR2BvrvAQt6LWhKPCMHeNkGOi4PpRk9dNZXdXBqx8Y/1lwi3Sa2u4RZf33Nn+mMS3/yPO4qJ44n0= X-Received: by 2002:a05:600c:4fd0:b0:3da:fa8a:8511 with SMTP id o16-20020a05600c4fd000b003dafa8a8511mr161896wmq.185.1676545815897; Thu, 16 Feb 2023 03:10:15 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: From: "Ozkan Sezer (sezeroz AT gmail DOT com) [via djgpp AT delorie DOT com]" Date: Thu, 16 Feb 2023 14:10:14 +0300 Message-ID: Subject: Re: dxe: page fault when derefencing an exported pointer variable To: djgpp AT delorie DOT com Content-Type: text/plain; charset="UTF-8" Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 2/16/23, Ozkan Sezer wrote: > dxe: page fault when derefencing an exported pointer variable > > The project in question is libmikmod along with its mikmod player: > https://github.com/sezero/mikmod > > The libmikmod library exports many functions and variables, only > one of those variables is a pointer: > https://github.com/sezero/mikmod/blob/master/libmikmod/playercode/mdriver.c#L51 > > The 'normal' vars don't seem to have a problem, but dereferencing > that particular pointer results in a page fault: > https://github.com/sezero/mikmod/blob/master/mikmod/src/display.c#L338-L339 > > At time of dereferencing the pointer is not actually NULL, because > if I write an accessor returning that pointer and export and use it > then things work. (Yes, the library and its api are a mess, I know) > > Using dxe3gen from CVS -- can give instructions to reproduce / test > if requested. > > Anyone has an insight, please? I forgot to mention that: - I link to the DXE module using an import library, not manually. - There are no issues if I link the exe statically to libmikmod. Need help with this - any insight would be appreciated.