JDK-8196880 : VS2017 Addition of Global Delete Operator with Size Parameter Conflicts with Arena's Chunk Provided One
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 11
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows
  • Submitted: 2018-02-06
  • Updated: 2022-06-07
  • Resolved: 2018-02-20
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 7 JDK 8
11 b03Fixed 7u211Fixed 8u192Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
arena.cpp
<directory>open/src/hotspot/share/adlc/arena.cpp(60): error C2956: sized deallocation function 'operator delete(void*, size_t)' would be chosen as placement deallocation function.
<directory>/open/src/hotspot/share/adlc/arena.cpp(31): note: see declaration of 'Chunk::operator delete'
<directory>open/src/hotspot/share/adlc/arena.cpp(67): error C2956: sized deallocation function 'operator delete(void*, size_t)' would be chosen as placement deallocation function.
<directory>/open/src/hotspot/share/adlc/arena.cpp(31): note: see declaration of 'Chunk::operator delete'
<directory>/open/src/hotspot/share/adlc/arena.cpp(97): error C2956: sized deallocation function 'operator delete(void*, size_t)' would be chosen as placement deallocation function.
<directory>/open/src/hotspot/share/adlc/arena.cpp(31): note: see declaration of 'Chunk::operator delete'
Comments
URL: http://hg.openjdk.java.net/jdk/jdk/rev/6b8fb182bb17 User: jwilhelm Date: 2018-02-28 18:06:35 +0000
28-02-2018

URL: http://hg.openjdk.java.net/jdk/hs/rev/6b8fb182bb17 User: lfoltan Date: 2018-02-20 12:15:50 +0000
20-02-2018

C++14 3.7.4.2/p2 says "If a class T has a member deallocation function named operator delete with exactly one parameter, then that function is a usual deallocation function. If class T does not declare such an operator delete but does declare a member deallocation function named operator delete with exactly two parameters, the second of which has type std::size_t, then this function is a usual deallocation function." We're running into problems because we have a placement new with an apparently corresponding usual delete. One possibility is to make that two-argument delete a placement deallocation function, rather than a usual deallocation function. I think we can accomplish that by just adding a one-argument delete.
06-02-2018

VS2017 description and a suggested fix can be found at: https://msdn.microsoft.com/en-us/library/mt723604.aspx, search for "Placement new and delete". Removing Chunk::operator delete in order to force the compiler to prefer the new global placement delete operator does not resolve the issue.
06-02-2018