RFR: 8311993: Test serviceability/sa/UniqueVtableTest.java failed: duplicate vtables detected

David Holmes dholmes at openjdk.org
Mon Aug 26 01:35:09 UTC 2024


On Thu, 22 Aug 2024 19:50:01 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

> On Windows SA agent gets a class vtable from symbols, exported from jvm.dll (it exports symbols like "??_7" + type + "@@6B@").
> But symbol lookup function first requests WinDbg about the symbol.
> Sometimes WinDbg routine IDebugSymbols::GetOffsetByName() returns offset for both class and class pointer types. Returned offsets correspond to symbols like "jvm!class_name::`vftable'".
> The behavior is intermittent, I was not able to find what is the reason.
> The fix adds workaround for the case - if GetOffsetByName succeeded, we check if corresponding symbol contains requested one.
> So it returns expected offset for non-vtable symbols like "MaxJNILocalCapacity" (GetOffsetByName returns offset for "jvm!MaxJNILocalCapacity"), but returns 0 for vtlb lookup.
> 
> Additionally added check for results of IDebugSymbols::SetImagePath/SetSymbolPath
> 
> Testing: tier1,tier2,hs-tier5-svc

Not an expert on this code by any means, but this seems a reasonable way to tackle the problem.

Thanks.

src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp line 865:

> 863:   // As a workaround check if returned symbol contains requested symbol.
> 864:   ULONG64 disp = 0L;
> 865:   char buf[512];

s/512/SYMBOL_BUFSIZE/ ?

-------------

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/20684#pullrequestreview-2259468929
PR Review Comment: https://git.openjdk.org/jdk/pull/20684#discussion_r1730492007


More information about the serviceability-dev mailing list