JDK-8200109 : NMT: diff_malloc_site assert(early->flags() == current->flags(), "Must be the same memory type")
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 8,11,12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: x86
  • Submitted: 2018-03-22
  • Updated: 2022-08-03
  • Resolved: 2019-02-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 12 JDK 13 JDK 8 Other
11.0.3Fixed 12.0.2Fixed 13 b08Fixed 8u361Fixed openjdk8u212Fixed
Related Reports
Relates :  
Description
void MemDetailDiffReporter::diff_malloc_site(const MallocSite* early, const MallocSite* current)  const {
  assert(early->flags() == current->flags(), "Must be the same memory type"); <<--- here
  
  diff_malloc_site(current->call_stack(), current->size(), current->count(),
    early->size(), early->count(), early->flags());
}


MallocSite* early:

0x00000252`ef653218 
   +0x000 _call_stack      : NativeCallStack
      +0x000 __VFN_table : 0x00000000`579fc640 
      =00000000`58102340 EMPTY_STACK      : NativeCallStack
      +0x008 _stack           : 
       [00] 0x00000000`56cf83dc  "H???"
       [01] 0x00000000`57250b88  "???"
       [02] 0x00000000`56e9e871  "H???"
       [03] 0x00000000`56d77abc  "H???"
      +0x028 _hash_value      : 0x5bb5f291
   +0x030 e                : MemoryCounter
      +0x000 _count           : 0xc
      +0x008 _size            : 0x4600
      +0x010 _peak_count      : 0x1e
      +0x018 _peak_size       : 0x5500
   +0x050 _flags           : 7 ( mtInternal ) <<--

MallocSite* current:

   0x00000252`eabbade8 
   +0x000 _call_stack      : NativeCallStack
      +0x000 __VFN_table : 0x00000000`579fc640 
      =00000000`58102340 EMPTY_STACK      : NativeCallStack
      +0x008 _stack           : 
       [00] 0x00000000`56cf83dc  "H???"
       [01] 0x00000000`57250b88  "???"
       [02] 0x00000000`56e9e871  "H???"
       [03] 0x00000000`56d77abc  "H???"
      +0x028 _hash_value      : 0x5bb5f291
   +0x030 e                : MemoryCounter
      +0x000 _count           : 1
      +0x008 _size            : 0x400
      +0x010 _peak_count      : 4
      +0x018 _peak_size       : 0x2c200
   +0x050 _flags           : 5 ( mtGC ) <----
   
   
MallocSite stack:

[00]
jvm!AllocateHeap+0x37 [d:\dev\jdk\sandboxes\jfr_open_source\open\src\hotspot\share\memory\allocation.inline.hpp @ 70]:
00000000`56cf83d7 e8a4659600      call    jvm!NativeCallStack::NativeCallStack (00000000`5765e980)
00000000`56cf83dc 4889442420      mov     qword ptr [rsp+20h],rax
[01]
jvm!GenericGrowableArray::raw_allocate+0xb3 [d:\dev\jdk\sandboxes\jfr_open_source\open\src\hotspot\share\utilities\growablearray.cpp @ 55]:
00000000`57250b83 e81878aaff      call    jvm!AllocateHeap (00000000`56cf83a0)
00000000`57250b88 eb18            jmp     jvm!GenericGrowableArray::raw_allocate+0xd2 (00000000`57250ba2)
[02]
jvm!GrowableArray<void * __ptr64>::grow+0x5c [d:\dev\jdk\sandboxes\jfr_open_source\open\src\hotspot\share\utilities\growablearray.hpp @ 446]:
00000000`56e9e86c e85f223b00      call    jvm!GenericGrowableArray::raw_allocate (00000000`57250ad0)
00000000`56e9e871 4889442438      mov     qword ptr [rsp+38h],rax
[03]
jvm!GrowableArray<InlineTree * __ptr64>::append+0x37 [d:\dev\jdk\sandboxes\jfr_open_source\open\src\hotspot\share\utilities\growablearray.hpp @ 216]:
00000000`56d77ab7 e8546d1200      call    jvm!GrowableArray<void * __ptr64>::grow (00000000`56e9e810)
00000000`56d77abc 488b442440      mov     rax,qword ptr [rsp+40h]


So:

  assert(early->flags() == current->flags(), "Must be the same memory type");

== 

assert( 7 ( mtInternal ) ==  5 ( mtGC ) "Must be the same memory type");

Attaching a file with assert context. There exist a 17GB mdmp file on my local workstation. Issue appeared when running Kitchensink locally.
Comments
Fix Request: I would like to backport this fix to JDK12u. The same issue exists in JDK12 too.
26-02-2019

Fix Request This patch should be backported to 8u to avoid spurious false positives. 8u RFR is here: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2019-February/008561.html
26-02-2019

Fix Request: I would like to backport this fix to 11u, as it may result intermittent failures on runtime/NMT/JcmdDetailDiff.java test.
12-02-2019

URL: http://hg.openjdk.java.net/jdk/jdk/rev/2b64ebacce93 User: zgu Date: 2019-02-08 19:08:42 +0000
08-02-2019

We see this bug regularly on Linux s390x. Same thread stack. Happens intermittent on runtime/NMT/JcmdDetailDiff.java jtreg test.
22-10-2018