Details
-
Bug
-
Resolution: Fixed
-
P4
-
None
-
b05
-
generic
-
generic
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8271699 | 17.0.2 | Christoph Langer | P4 | Resolved | Fixed | b01 |
JDK-8271204 | 17.0.1 | Christoph Langer | P4 | Resolved | Fixed | b05 |
JDK-8270367 | 11.0.13-oracle | Harold Seigel | P4 | Resolved | Fixed | b02 |
JDK-8270462 | 11.0.13 | Zhengyu Gu | P4 | Resolved | Fixed | b01 |
JDK-8272540 | openjdk8u312 | David Holmes | P4 | Resolved | Fixed | b04 |
Description
SUMMARY: AddressSanitizer: stack-use-after-scope /.../jdk/src/hotspot/share/prims/jni.cpp:972 in DTraceReturnProbeMark_NewObjectA::~DTraceReturnProbeMark_NewObjectA()
In NewObjectA(), the return value of the function is passed to the probe-supporting macro by value instead of by reference:
DT_RETURN_MARK(NewObjectA, jobject, (const jobject)obj);
(notice 'const jobject' instead of 'const jobject&')
Casting a variable to a non-reference type technically makes the resulting expression a prvalue, which then gets bound to a reference that is alive up until the end of the function. The prvalue is then touched in the destructor of DTraceReturnProbeMark_NewObjectA (a local class created by the DT_RETURN_MARK macro) and this is detected by Address Sanitizer as stack-use-after-scope when running certain tests.
Attachments
Issue Links
- backported by
-
JDK-8270367 stack-use-after-scope in NewObjectA
- Resolved
-
JDK-8270462 stack-use-after-scope in NewObjectA
- Resolved
-
JDK-8271204 stack-use-after-scope in NewObjectA
- Resolved
-
JDK-8271699 stack-use-after-scope in NewObjectA
- Resolved
-
JDK-8272540 stack-use-after-scope in NewObjectA
- Resolved
- links to
-
Commit openjdk/jdk11u-dev/93f952c9
-
Commit openjdk/jdk17u/de786bbc
-
Commit openjdk/jdk/20eba355
-
Review openjdk/jdk11u-dev/128
-
Review openjdk/jdk17u/3
-
Review openjdk/jdk/4683