Re: macro expansion producing 'defined' has undefined behavior

2022-02-17 Thread David Holmes

Hi Simmias,

On 14/02/2022 1:24 pm, 殷玉婷 wrote:

Hi,

When I ran
make images in my local computer to compile the openjdk9u by guideline 
<>, I encountered the following problems:


9u is not expected to be built by recent Xcode, it was a much older 
release (not sure if anyone is actually updating it at all):


https://wiki.openjdk.java.net/display/Build/Supported+Build+Platforms

You either need to downgrade your build tools, or else upgrade the 
OpenJDK version you want to build.


Cheers,
David


Compiling 61 files for BUILD_INTERIM_jdk.jdeps
Compiling 457 files for BUILD_INTERIM_jdk.javadoc
In file included from 
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/test/native/gc/g1/test_freeRegionList.cpp:25:
In file included from 
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp:28:
In file included from 
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp:33:
In file included from 
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.hpp:31:
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp:126:5:
 error: macro expansion producing 'defined' has undefined behavior 
[-Werror,-Wexpansion-to-defined]
#if HEAP_REGION_SET_FORCE_VERIFY
 ^
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp:53:38:
 note: expanded from macro 'HEAP_REGION_SET_FORCE_VERIFY'
#define HEAP_REGION_SET_FORCE_VERIFY defined(ASSERT)
  ^
In file included from 
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/test/native/gc/g1/test_freeRegionList.cpp:25:
In file included from 
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp:28:
In file included from 
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp:37:
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/g1HeapVerifier.hpp:67:5:
 error: macro expansion producing 'defined' has undefined behavior 
[-Werror,-Wexpansion-to-defined]
#if HEAP_REGION_SET_FORCE_VERIFY
 ^
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp:53:38:
 note: expanded from macro 'HEAP_REGION_SET_FORCE_VERIFY'
#define HEAP_REGION_SET_FORCE_VERIFY defined(ASSERT)
  ^
2 errors generated.
make[3]: *** 
[/Users/simmias/java/github/openjdk/jdk9u-master/build/macosx-x86_64-normal-server-release/hotspot/variant-server/libjvm/gtest/objs/test_freeRegionList.o]
 Error 1
make[3]: *** Waiting for unfinished jobs
make[2]: *** [hotspot-server-libs] Error 2
make[2]: *** Waiting for unfinished jobs
?:  API?
?: ??, ??? -Xlint:deprecation ?

ERROR: Build failed for target 'images' in configuration 
'macosx-x86_64-normal-server-release' (exit code 2)

=== Output from failing command(s) repeated here ===
* For target hotspot_variant-server_libjvm_gtest_objs_test_freeRegionList.o:
In file included from 
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/test/native/gc/g1/test_freeRegionList.cpp:25:
In file included from 
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp:28:
In file included from 
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/g1CollectedHeap.hpp:33:
In file included from 
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/g1ConcurrentMark.hpp:31:
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp:126:5:
 error: macro expansion producing 'defined' has undefined behavior 
[-Werror,-Wexpansion-to-defined]
#if HEAP_REGION_SET_FORCE_VERIFY
 ^
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/heapRegionSet.hpp:53:38:
 note: expanded from macro 'HEAP_REGION_SET_FORCE_VERIFY'
#define HEAP_REGION_SET_FORCE_VERIFY defined(ASSERT)
  ^
In file included from 
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/test/native/gc/g1/test_freeRegionList.cpp:25:
In file included from 
/Users/simmias/java/github/openjdk/jdk9u-master/hotspot/src/share/vm/gc/g1/g1CollectedHeap.inline.hpp:28:
... (rest of output omitted)

* All command lines available in 
/Users/simmias/java/github/openjdk/jdk9u-master/build/macosx-x86_64-normal-server-release/make-support/failure-logs.
=== End of repeated output ===

No indication of failed target found.
Hint: Try searching the build log for '] Error'.
Hint: See common/doc/building.html#troubleshooting for assistance.

make[1]: *** [main] Error 2
make: *** [images] Error 2

I tried the ways on the internet which added the env(CGO_CPPFLAGS), but it did 
not work.
I am really looking forward to your reply.
Thanks

Local env:
os: mac 11.5.2
xcode version: 13.2.1
xcode-select version:  2384
planning c

Re: RFR: JDK-8281003 - MethodHandles::lookup throws NPE if caller is null

2022-02-17 Thread Thiwa Chantarangkul


Integrated: 8188073: Add Capstone as backend for hsdis

2022-02-17 Thread Magnus Ihse Bursie
On Wed, 16 Feb 2022 21:55:36 GMT, Magnus Ihse Bursie  wrote:

> The Capstone library is a simple to use, efficient disassembly library, 
> distributed under the MIT license. 
> 
> This PR implements an hsdis backend using Capstone. It has been tested on 
> Linux, macOS and Windows (x64).
> 
> The actual C implementation of the backend was done by @JornVernee. I assume 
> there are plenty of room for enhancing this implementation, with options like 
> in the binutils backend. Such improvements can be done later, by teams more 
> familiar with the requirements of hsdis.

This pull request has now been integrated.

Changeset: f830cbec
Author:Magnus Ihse Bursie 
URL:   
https://git.openjdk.java.net/jdk/commit/f830cbec909b91ad0f00f46a3496d83ecb5912ed
Stats: 499 lines in 9 files changed: 328 ins; 118 del; 53 mod

8188073: Add Capstone as backend for hsdis

Co-authored-by: Magnus Ihse Bursie 
Co-authored-by: Jorn Vernee 
Reviewed-by: erikj

-

PR: https://git.openjdk.java.net/jdk/pull/7506


Integrated: JDK-8281000 ClassLoader::registerAsParallelCapable throws NPE if caller is null

2022-02-17 Thread Tim Prinzing
On Fri, 11 Feb 2022 20:36:26 GMT, Tim Prinzing  wrote:

> JDK-8281000 ClassLoader::registerAsParallelCapable throws NPE if caller is 
> null

This pull request has now been integrated.

Changeset: a6f8a386
Author:Tim Prinzing 
Committer: Mandy Chung 
URL:   
https://git.openjdk.java.net/jdk/commit/a6f8a386efa7af162f4b815951287f0a9bc1f396
Stats: 216 lines in 5 files changed: 216 ins; 0 del; 0 mod

8281000: ClassLoader::registerAsParallelCapable throws NPE if caller is null

Reviewed-by: erikj, ihse, mchung, bchristi

-

PR: https://git.openjdk.java.net/jdk/pull/7448


Re: RFR: 8188073: Add Capstone as backend for hsdis [v2]

2022-02-17 Thread Erik Joelsson
On Thu, 17 Feb 2022 15:16:41 GMT, Magnus Ihse Bursie  wrote:

>> The Capstone library is a simple to use, efficient disassembly library, 
>> distributed under the MIT license. 
>> 
>> This PR implements an hsdis backend using Capstone. It has been tested on 
>> Linux, macOS and Windows (x64).
>> 
>> The actual C implementation of the backend was done by @JornVernee. I assume 
>> there are plenty of room for enhancing this implementation, with options 
>> like in the binutils backend. Such improvements can be done later, by teams 
>> more familiar with the requirements of hsdis.
>
> Magnus Ihse Bursie has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Fix indentation

Marked as reviewed by erikj (Reviewer).

-

PR: https://git.openjdk.java.net/jdk/pull/7506


Re: RFR: 8188073: Add Capstone as backend for hsdis [v2]

2022-02-17 Thread Magnus Ihse Bursie
> The Capstone library is a simple to use, efficient disassembly library, 
> distributed under the MIT license. 
> 
> This PR implements an hsdis backend using Capstone. It has been tested on 
> Linux, macOS and Windows (x64).
> 
> The actual C implementation of the backend was done by @JornVernee. I assume 
> there are plenty of room for enhancing this implementation, with options like 
> in the binutils backend. Such improvements can be done later, by teams more 
> familiar with the requirements of hsdis.

Magnus Ihse Bursie has updated the pull request incrementally with one 
additional commit since the last revision:

  Fix indentation

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7506/files
  - new: https://git.openjdk.java.net/jdk/pull/7506/files/03974854..05c19820

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7506&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7506&range=00-01

  Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7506.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7506/head:pull/7506

PR: https://git.openjdk.java.net/jdk/pull/7506


Re: RFR: 8188073: Add Capstone as backend for hsdis [v2]

2022-02-17 Thread Magnus Ihse Bursie
On Thu, 17 Feb 2022 14:11:12 GMT, Erik Joelsson  wrote:

>> Magnus Ihse Bursie has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Fix indentation
>
> make/Hsdis.gmk line 157:
> 
>> 155: 
>> 156: $(INSTALLED_HSDIS): $(BUILD_HSDIS_TARGET)
>> 157: ifeq ($(HSDIS_BACKEND), binutils)
> 
> Don't we usually indent conditionals to the recipe level using spaces?

Yes we do. Embarrassing. 😊

-

PR: https://git.openjdk.java.net/jdk/pull/7506


Re: RFR: 8188073: Add Capstone as backend for hsdis

2022-02-17 Thread Erik Joelsson
On Wed, 16 Feb 2022 21:55:36 GMT, Magnus Ihse Bursie  wrote:

> The Capstone library is a simple to use, efficient disassembly library, 
> distributed under the MIT license. 
> 
> This PR implements an hsdis backend using Capstone. It has been tested on 
> Linux, macOS and Windows (x64).
> 
> The actual C implementation of the backend was done by @JornVernee. I assume 
> there are plenty of room for enhancing this implementation, with options like 
> in the binutils backend. Such improvements can be done later, by teams more 
> familiar with the requirements of hsdis.

One style nit.

make/Hsdis.gmk line 157:

> 155: 
> 156: $(INSTALLED_HSDIS): $(BUILD_HSDIS_TARGET)
> 157: ifeq ($(HSDIS_BACKEND), binutils)

Don't we usually indent conditionals to the recipe level using spaces?

-

Marked as reviewed by erikj (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7506


Integrated: 8203290: [AIX] Check functionality of JDK-8199712 (Flight Recorder)

2022-02-17 Thread Tyler Steele
On Fri, 17 Dec 2021 19:07:54 GMT, Tyler Steele  wrote:

> Just in time for the holidays I have completed an implementation of the JFR 
> functionality for AIX. As a side note, this is my first submission to OpenJDK 
> 👋
> 
> ### Implementation notes and alternatives considered
> 
> After modifying the build system to allow the --enable-jvm-feature-jfr to 
> work on AIX, my task was to implement the interfaces from os_perf.hpp. The 
> os_perf_aix.cpp implementation that existed was, I believe, a copy of the 
> Linux implementation. A review of the code in that file showed that 
> NetworkInterface, CPUPerformanceInterface, and SystemProcessInterface would 
> require modification to work on AIX. Using the Linux implementation as a 
> guide, I initially expected to use files from the aix procfs like 
> /proc//psinfo, and /proc//status in a manner similar to the Linux 
> implementation. However, I ended up using libperfstat for all functionality 
> required by the interfaces.
> 
> ### Testing
> 
> Testing for JFR seems to be quite light in the repo both before and after 
> this change. In addition to performing manual testing, I have added some 
> basic sanity checks that ensure events can be created and committed (using 
> jtreg), and performs some basic checks on the results of the interface member 
> functions (using gtest).
> 
> ### More notes
> 
> I've sent an email to the JFR group about a TOC overflow warning I 
> encountered while building (for the release server target). I believe the fix 
> is to pass -qpic=large when using the xlc toolchain, but my modifications to 
> flags-cflags.m4 have not been successful in removing this warning.

This pull request has now been integrated.

Changeset: c0275e18
Author:Tyler Steele 
Committer: Thomas Stuefe 
URL:   
https://git.openjdk.java.net/jdk/commit/c0275e18b7cb4a01385b79ced46560322aeacc97
Stats: 1230 lines in 10 files changed: 461 ins; 502 del; 267 mod

8203290: [AIX] Check functionality of JDK-8199712 (Flight Recorder)

Implements JFR for AIX

Reviewed-by: erikj, mdoerr, mgronlun, stuefe, ihse

-

PR: https://git.openjdk.java.net/jdk/pull/6885