RFR(xs): 8075044 : Query dbghelp.dll version number at run time, not at compile time
Markus Gronlund
markus.gronlund at oracle.com
Mon Mar 16 19:04:04 UTC 2015
Hi Thomas,
I am a bit worried about the changes from the API_VERSION constant which is defined in ImageHlp.h as:
#define API_VERSION_NUMBER 11
to using the runtime values returned in the API_VERSION struct from calling dbghelp::ImagehlpApiVersion() without any conversions:
This is what I get on my laptop (win7 x86 /32-bit)
dbghelp::ImagehlpApiVersion() // function pointer via C:\Windows\System32\dbghelp.dll (some old version: 6.1.7061.17514):
+0x000 MajorVersion : 4
+0x002 MinorVersion : 0
+0x004 Revision : 5
+0x006 Reserved : 0
I thought this might be due to the fact of an older version of dbghelp.dll - I therefore set the function pointer to the Windows SDK 8.1 version of dbghelp.dll (6.3.9600.16384):
+0x000 MajorVersion : 4
+0x002 MinorVersion : 0
+0x004 Revision : 5
+0x006 Reserved : 0
Same data.
I also queried Imagehlp.dll (6.1.7601.18288) using the same API:
+0x000 MajorVersion : 4
+0x002 MinorVersion : 0
+0x004 Revision : 5
+0x006 Reserved : 0
I am not sure if "MajorVersion == 4" is the same as / should be interpreted the same as "#define API_VERSION_NUMBER 11" ?
In any case, only looking at the MajorVersion number returned with no adaptation changes behavior:
// Older versions of dbghelp.h doesn't contain all the dumptypes we want, dbghelp.h with
// API_VERSION_NUMBER 11 or higher contains the ones we want though
if (version->MajorVersion >= 11) {
dumpType = (MINIDUMP_TYPE)(dumpType | MiniDumpWithFullMemoryInfo | MiniDumpWithThreadInfo |
MiniDumpWithUnloadedModules);
}
I previously go the 11 from the constant, but now as I described above, I am getting 4, and therefore, less information in the .mdmp.
Are you pulling out a 11 from MajorVersion?
/Markus
-----Original Message-----
From: Thomas Stüfe [mailto:thomas.stuefe at gmail.com]
Sent: den 16 mars 2015 12:33
To: Staffan Larsen
Cc: hotspot-runtime-dev at openjdk.java.net
Subject: Re: RFR(xs): 8075044 : Query dbghelp.dll version number at run time, not at compile time
Hi all,
still need a second reviewer and also a sponsor. Thanks!
Thomas
On Thu, Mar 12, 2015 at 1:58 PM, Staffan Larsen <staffan.larsen at oracle.com>
wrote:
> Looks good!
>
> Thanks,
> /Staffan
>
> > On 12 mar 2015, at 13:50, Thomas Stüfe <thomas.stuefe at gmail.com> wrote:
> >
> > Hi all,
> >
> > please take a look at this tiny change:
> >
> > webrev:
> http://cr.openjdk.java.net/~stuefe/webrevs/8075044/webrev.01/webrev/
> > bug: https://bugs.openjdk.java.net/browse/JDK-8075044
> >
> > This changes the version number query for dbghelp.dll from a compile
> > time check to a run time check.
> >
> > Thanks!
> >
> > Thomas Stuefe
>
>
More information about the hotspot-runtime-dev
mailing list