public inbox for
help / color / mirror / Atom feed
From: Jon TURNEY <>
Subject: [newlib-cygwin] Cygwin: Handle out of order modules for module offsets in stackdump
Date: Fri,  4 Nov 2022 15:11:31 +0000 (GMT)	[thread overview]
Message-ID: <> (raw);h=564c88b89833d711281f7b5dd2b74b453dc66ea9

commit 564c88b89833d711281f7b5dd2b74b453dc66ea9
Author: Jon Turney <>
Date:   Tue Nov 1 14:01:08 2022 +0000

    Cygwin: Handle out of order modules for module offsets in stackdump
    Improve address to module+offset conversion, to work correctly in the
    presence of out-of-order elements in InMemoryOrderModuleList.
    Fixes: d59651d4

 winsup/cygwin/ | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/ b/winsup/cygwin/
index 8cc454c90..c3433ab94 100644
--- a/winsup/cygwin/
+++ b/winsup/cygwin/
@@ -342,11 +342,13 @@ prettyprint_va (PVOID func_va)
-      if (mod->DllBase > func_va)
+      if ((func_va < mod->DllBase) ||
+	  (func_va > (PVOID)((DWORD_PTR)mod->DllBase + mod->SizeOfImage)))
       __small_sprintf (buf, "%S+0x%x", &mod->BaseDllName,
 		       (DWORD_PTR)func_va - (DWORD_PTR)mod->DllBase);
+      break;
   return buf;

                 reply	other threads:[~2022-11-04 15:11 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).