On Thu, 12 Jan 2023 02:20:04 GMT, Chris Plummer wrote:
> `VirtualMachineImpl.removeObjectMirror(ObjectReferenceImpl object)` is not
> used. Furthermore it confuses the reader that runs across
> `removeObjectMirror()` calls, because what is actually being called is
> `removeObjectMirror(SoftObj
There are a few places in the instrument coding where errors occur in our jtreg
test, but the already existing error logging method jplis_assert_msg /
jplis_assert is unfortunately missing so not much details are shown. This could
be enhanced.
-
Commit messages:
- JDK-8299957
Cha
On Thu, 12 Jan 2023 02:14:10 GMT, Archie L. Cobbs wrote:
>>>
>>> D'oh, you're right. But if you made `returnMe()` static or private then the
>>> argument would still hold.
>>>
>>> > And, if the method is static, same story - you are passing ref3 somewhere
>>> > else, and ref3 potentially cont
On Wed, 11 Jan 2023 09:22:03 GMT, Fredrik Bredberg wrote:
>> Implementation of relativized locals in interpreter frames for x86. x64,
>> arm, aarch64, ppc64le and riscv.
>> Not relativized locals on zero and s390 but done some changes to cope with
>> the changed generic code.
>> Tested tier1-ti
Please review this patch that fixes a few memory leaks in JNI code.
[The latest
documentation](https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#releaseprimitivetypearrayelements-routines)
of JNI functions makes an explicit note about the use of JNI_COMMIT:
> If `JNI_COMMI
On Wed, 11 Jan 2023 03:30:03 GMT, Archie L. Cobbs wrote:
>> This PR adds a new lint warning category `this-escape`.
>>
>> It also adds `@SuppressWarnings` annotations as needed to the JDK itself to
>> allow the JDK to continue to compile with `-Xlint:all`.
>>
>> A 'this' escape warning is gene
On Wed, 11 Jan 2023 03:30:03 GMT, Archie L. Cobbs wrote:
>> This PR adds a new lint warning category `this-escape`.
>>
>> It also adds `@SuppressWarnings` annotations as needed to the JDK itself to
>> allow the JDK to continue to compile with `-Xlint:all`.
>>
>> A 'this' escape warning is gene
On Wed, 11 Jan 2023 03:30:03 GMT, Archie L. Cobbs wrote:
>> This PR adds a new lint warning category `this-escape`.
>>
>> It also adds `@SuppressWarnings` annotations as needed to the JDK itself to
>> allow the JDK to continue to compile with `-Xlint:all`.
>>
>> A 'this' escape warning is gene
Please review this fix for DwarfParser cleaner.
The original code registered the cleaner using a lambda that captured a
reference to the parser object; as a result, the object was never GCed, and the
cleaner never ran.
In this version I moved the lambda creation to a static method, so that it
On Thu, 12 Jan 2023 09:57:00 GMT, Maurizio Cimadamore
wrote:
> I'm not sure what you mean by (1f). You mean this can be embedded in an
> exception being thrown? Is that different from (2)?
Yes, this would be a different case from any other that you'd have to handle in
the code if you wanted t
On Thu, 12 Jan 2023 14:59:12 GMT, Archie L. Cobbs wrote:
>>> * On the Java stack
>>> (a) The current 'this' instance
>>> (b) A method parameter
>>> (c) A local variable
>>> (d) A temporary value that is part of the current expression being
>>> evaluated
>>> (e) The return value from a
On Thu, 12 Jan 2023 13:01:44 GMT, Maurizio Cimadamore
wrote:
>> Archie L. Cobbs has updated the pull request incrementally with two
>> additional commits since the last revision:
>>
>> - Use the more appropriate Type comparison method Types.isSameType().
>> - Add some more comments to clarif
On Thu, 12 Jan 2023 15:10:19 GMT, Maurizio Cimadamore
wrote:
> Interesting example - I thought you might have been referring to a case where
> the class being analyzed was itself an exception.
Yes - although that example doesn't compile (oops!). Just replace `catch
(RuntimeException e)` with
On Thu, 12 Jan 2023 10:18:27 GMT, Maurizio Cimadamore
wrote:
>> Archie L. Cobbs has updated the pull request incrementally with two
>> additional commits since the last revision:
>>
>> - Use the more appropriate Type comparison method Types.isSameType().
>> - Add some more comments to clarif
On Thu, 12 Jan 2023 12:08:51 GMT, Daniel Jeliński wrote:
> Please review this fix for DwarfParser cleaner.
>
> The original code registered the cleaner using a lambda that captured a
> reference to the parser object; as a result, the object was never GCed, and
> the cleaner never ran.
>
> In
On Thu, 12 Jan 2023 10:25:27 GMT, Maurizio Cimadamore
wrote:
>> Archie L. Cobbs has updated the pull request incrementally with two
>> additional commits since the last revision:
>>
>> - Use the more appropriate Type comparison method Types.isSameType().
>> - Add some more comments to clarif
On Thu, 12 Jan 2023 10:32:19 GMT, Maurizio Cimadamore
wrote:
> If we have a class with a private constructor and public static factory
> invoking said constructor, and the constructor makes this escape, isn't that
> an issue we should detect?
A static factory method will not create a subclass
> `VirtualMachineImpl.removeObjectMirror(ObjectReferenceImpl object)` is not
> used. Furthermore it confuses the reader that runs across
> `removeObjectMirror()` calls, because what is actually being called is
> `removeObjectMirror(SoftObjectReference ref)`.
Chris Plummer has updated the pull r
On Thu, 12 Jan 2023 16:20:12 GMT, Archie L. Cobbs wrote:
>> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java
>> line 218:
>>
>>> 216: new TreeScanner() {
>>> 217:
>>> 218: private Lint lint = ThisEscapeAnalyzer.this.lint;
>>
>> On a first loo
On Thu, 12 Jan 2023 16:44:44 GMT, Chris Plummer wrote:
>> `VirtualMachineImpl.removeObjectMirror(ObjectReferenceImpl object)` is not
>> used. Furthermore it confuses the reader that runs across
>> `removeObjectMirror()` calls, because what is actually being called is
>> `removeObjectMirror(Sof
On Wed, 11 Jan 2023 14:49:59 GMT, Thomas Stuefe wrote:
>> Justin King has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Initialize memory to zero in zGranuleMap
>>
>> Signed-off-by: Justin King
>
> Curious, I always thought we do Arr
On Thu, 12 Jan 2023 10:48:49 GMT, Maurizio Cimadamore
wrote:
>> Archie L. Cobbs has updated the pull request incrementally with two
>> additional commits since the last revision:
>>
>> - Use the more appropriate Type comparison method Types.isSameType().
>> - Add some more comments to clarif
On Thu, 12 Jan 2023 10:56:53 GMT, Maurizio Cimadamore
wrote:
>> Archie L. Cobbs has updated the pull request incrementally with two
>> additional commits since the last revision:
>>
>> - Use the more appropriate Type comparison method Types.isSameType().
>> - Add some more comments to clarif
On Thu, 12 Jan 2023 11:09:35 GMT, Maurizio Cimadamore
wrote:
>> Archie L. Cobbs has updated the pull request incrementally with two
>> additional commits since the last revision:
>>
>> - Use the more appropriate Type comparison method Types.isSameType().
>> - Add some more comments to clarif
On Thu, 12 Jan 2023 17:13:55 GMT, Archie L. Cobbs wrote:
>> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java
>> line 411:
>>
>>> 409: final boolean referenceExpressionNode;
>>> 410: switch (tree.getTag()) {
>>> 411: case CASE:
>>
>> surpri
On Wed, 11 Jan 2023 03:30:03 GMT, Archie L. Cobbs wrote:
>> This PR adds a new lint warning category `this-escape`.
>>
>> It also adds `@SuppressWarnings` annotations as needed to the JDK itself to
>> allow the JDK to continue to compile with `-Xlint:all`.
>>
>> A 'this' escape warning is gene
On Thu, 12 Jan 2023 12:15:17 GMT, Maurizio Cimadamore
wrote:
>> Archie L. Cobbs has updated the pull request incrementally with two
>> additional commits since the last revision:
>>
>> - Use the more appropriate Type comparison method Types.isSameType().
>> - Add some more comments to clarif
On Thu, 12 Jan 2023 12:17:32 GMT, Maurizio Cimadamore
wrote:
> There is a concept of push/popScope and then there's a separate concept of
> call stack (which is just a list of diagnostic position up to the point). I
> wonder if this could be better modeled by using a single class e.g.
> Scope
On Thu, 12 Jan 2023 12:26:27 GMT, Maurizio Cimadamore
wrote:
> Do we really need a set for this?
There are surely other ways to model things. But I got myself really confused
trying to build more complicated models.
What I ended up with is this simple model that works:
* There is a set of `Re
On Thu, 12 Jan 2023 17:39:05 GMT, Vicente Romero wrote:
>> Archie L. Cobbs has updated the pull request incrementally with two
>> additional commits since the last revision:
>>
>> - Use the more appropriate Type comparison method Types.isSameType().
>> - Add some more comments to clarify how
On Thu, 12 Jan 2023 17:48:37 GMT, Archie L. Cobbs wrote:
>> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java
>> line 909:
>>
>>> 907:
>>> 908: // Check for implicit outer 'this' reference
>>> 909: if (this.types.hasOuterClass(currentClassT
On Thu, 12 Jan 2023 12:28:12 GMT, Maurizio Cimadamore
wrote:
> This might also be related with the fact that we deal with return values in
> different ways than with e.g. values returned from a nested scope (where we
> just pop, and then copy all pending expression to the outer depth).
Yes, a
On Thu, 12 Jan 2023 18:11:01 GMT, Maurizio Cimadamore
wrote:
>> Same comment as previous: I don't quite know what I'm doing and I'm loathe
>> to break what is already working. Do you have a suggested patch?
>
> I can't seem to be able to run tests - I get failures in the build:
>
>
> * For ta
On Thu, 12 Jan 2023 16:40:33 GMT, Maurizio Cimadamore
wrote:
> I guess what I'm thinking about:
No leak is possible in that example.
* `new Foo()` creates an instance of `Foo` (not a subclass of `Foo`) therefore
`m()` is not overridden
* Any subclass of `Foo` that may exist in the outside worl
On Thu, 12 Jan 2023 18:18:38 GMT, Maurizio Cimadamore
wrote:
>> I can't seem to be able to run tests - I get failures in the build:
>>
>>
>> * For target support_test_micro_tools-classes__the.BUILD_INDIFY_batch:
>
> This patch:
>
>
> diff --git a/make/test/BuildMicrobenchmark.gmk
> b/make/t
On Thu, 12 Jan 2023 18:37:06 GMT, Archie L. Cobbs wrote:
>> I guess what I'm thinking about:
>>
>> class Foo {
>> private Foo() {
>> m(this);
>> }
>>
>> public void m() { ... } // overridable
>>
>> static Foo makeFoo() { return new Foo(); }
>> }
>
>> I guess wha
On Thu, 12 Jan 2023 17:29:22 GMT, Maurizio Cimadamore
wrote:
>> I put it there because of switch expressions and `yeild`... ?
>
> Well, yield can... yield a value - `case` doesn't. So I'm confused. Also
> because the variable is called `referenceExpressionNode` and `CASE` is not an
> expressio
On Thu, 12 Jan 2023 17:33:48 GMT, Archie L. Cobbs wrote:
>> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java
>> line 875:
>>
>>> 873: // Reference to this?
>>> 874: if (tree.name == names._this || tree.name == names._super) {
>>> 875: i
On Thu, 12 Jan 2023 17:40:36 GMT, Maurizio Cimadamore
wrote:
> But the filtering will end up dropping the expression Ref on the floor,
> right? (because B and A are unrelated).
Ah, I see what you mean.
Here's a more complete example:
public class CastLeak {
public CastLeak() {
(
On Thu, 12 Jan 2023 18:40:38 GMT, Maurizio Cimadamore
wrote:
>> This patch:
>>
>>
>> diff --git a/make/test/BuildMicrobenchmark.gmk
>> b/make/test/BuildMicrobenchmark.gmk
>> index 1c89328a388..7c3f0293edc 100644
>> --- a/make/test/BuildMicrobenchmark.gmk
>> +++ b/make/test/BuildMicrobenchmark
On Thu, 12 Jan 2023 09:23:49 GMT, Daniel Jeliński wrote:
> Please review this patch that fixes a few memory leaks in JNI code.
>
> [The latest
> documentation](https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#releaseprimitivetypearrayelements-routines)
> of JNI functions
On Thu, 12 Jan 2023 09:23:49 GMT, Daniel Jeliński wrote:
> Please review this patch that fixes a few memory leaks in JNI code.
>
> [The latest
> documentation](https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#releaseprimitivetypearrayelements-routines)
> of JNI functions
On Thu, 12 Jan 2023 18:48:25 GMT, Maurizio Cimadamore
wrote:
>>> I guess what I'm thinking about:
>>
>> No leak is possible in that example.
>> * `new Foo()` creates an instance of `Foo` (not a subclass of `Foo`)
>> therefore `m()` is not overridden
>> * Any subclass of `Foo` that may exist in
On Thu, 12 Jan 2023 19:24:50 GMT, Archie L. Cobbs wrote:
>> This patch passes all tests:
>>
>>
>> diff --git
>> a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java
>>
>> b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/ThisEscapeAnalyzer.java
>> index 9
On Thu, 12 Jan 2023 12:08:51 GMT, Daniel Jeliński wrote:
> Please review this fix for DwarfParser cleaner.
>
> The original code registered the cleaner using a lambda that captured a
> reference to the parser object; as a result, the object was never GCed, and
> the cleaner never ran.
>
> In
On Thu, 12 Jan 2023 19:01:10 GMT, Maurizio Cimadamore
wrote:
>> The code you quoted has nothing specifically to do with method invocations.
>> This code is simply handing the evaluation of the expressions `this` and
>> `super`. For example, `this` could just be a parameter we're passing to
>>
On Thu, 12 Jan 2023 21:28:12 GMT, Archie L. Cobbs wrote:
>> My point is about who puts ThisRef in the set to begin with. It seems to me
>> that ThisRef is put there at the start of a method analysis. After which,
>> there's several code points where we say "if there's a direct ThisRef in the
>
On Thu, 12 Jan 2023 09:23:49 GMT, Daniel Jeliński wrote:
> Please review this patch that fixes a few memory leaks in JNI code.
>
> [The latest
> documentation](https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#releaseprimitivetypearrayelements-routines)
> of JNI functions
On Wed, 11 Jan 2023 06:26:18 GMT, Xue-Lei Andrew Fan wrote:
> The sprintf is deprecated in Xcode 14 because of security concerns. The issue
> was addressed in [JDK-8296812](https://bugs.openjdk.org/browse/JDK-8296812)
> for hotspot impl, and
> [JDK-8299378](https://bugs.openjdk.org/browse/JDK-
On Thu, 12 Jan 2023 12:08:51 GMT, Daniel Jeliński wrote:
> Please review this fix for DwarfParser cleaner.
>
> The original code registered the cleaner using a lambda that captured a
> reference to the parser object; as a result, the object was never GCed, and
> the cleaner never ran.
>
> In
On Thu, 12 Jan 2023 08:10:29 GMT, Matthias Baesken wrote:
> There are a few places in the instrument coding where errors occur in our
> jtreg test, but the already existing error logging method jplis_assert_msg /
> jplis_assert is unfortunately missing so not much details are shown. This
> cou
On Thu, 12 Jan 2023 16:44:44 GMT, Chris Plummer wrote:
>> `VirtualMachineImpl.removeObjectMirror(ObjectReferenceImpl object)` is not
>> used. Furthermore it confuses the reader that runs across
>> `removeObjectMirror()` calls, because what is actually being called is
>> `removeObjectMirror(Sof
> This PR adds a new lint warning category `this-escape`.
>
> It also adds `@SuppressWarnings` annotations as needed to the JDK itself to
> allow the JDK to continue to compile with `-Xlint:all`.
>
> A 'this' escape warning is generated for a constructor `A()` in a class `A`
> when the compiler
On Thu, 12 Jan 2023 19:12:27 GMT, Archie L. Cobbs wrote:
>> Uhm. Turns out I probably did not understand the filter correctly, and now
>> I'm more dubious about what it actually does. Say you have this hierarchy:
>>
>>
>> interface A { }
>> class B {
>> B() {
>> A a = (A)this;
>
On Thu, 12 Jan 2023 21:47:28 GMT, Maurizio Cimadamore
wrote:
> Ok - I thought false negative was the thing to absolutely avoid - and that
> was the no. 1 concern.
You're right. I think at the time I reasoned that it would be unusual enough
for the type of an expression to start as an instanc
> Please review this patch that fixes a few memory leaks in JNI code.
>
> [The latest
> documentation](https://docs.oracle.com/en/java/javase/17/docs/specs/jni/functions.html#releaseprimitivetypearrayelements-routines)
> of JNI functions makes an explicit note about the use of JNI_COMMIT:
>
>>
On Thu, 12 Jan 2023 21:02:23 GMT, Chris Plummer wrote:
> There are occurrences of JNI_COMMIT on macos in libawt and libsaproc. Is
> there a reason you did not fix these also?
My search for JNI_COMMIT filtered out all *.m files. Thanks for pointing that
out.
libsaproc is corrected now. I will f
On Thu, 12 Jan 2023 21:26:09 GMT, Chris Plummer wrote:
> This seems like a pretty serious flaw with using Lambdas and Cleaners that
> probably should be brought up with the libs and language teams.
They are aware of this issue; it's even mentioned in [this
article](https://inside.java/2022/05/
58 matches
Mail list logo