RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux

Phil Race
From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps
the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux.

I ended up having to go this way because its is the least unsatisfactory solution.
I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime
because too many systems have to old a version of harfbuzz.

This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10

There are couple of incidental fixes in here too
- "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version
- harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy
- I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502

-------------

Commit messages:
 - 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux

Changes: https://git.openjdk.java.net/jdk/pull/2982/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2982&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8255790
  Stats: 96 lines in 2 files changed: 7 ins; 57 del; 32 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2982.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2982/head:pull/2982

PR: https://git.openjdk.java.net/jdk/pull/2982
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux

Sergey Bylokhov-2
On Sat, 13 Mar 2021 00:15:16 GMT, Phil Race <[hidden email]> wrote:

> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps
> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux.
>
> I ended up having to go this way because its is the least unsatisfactory solution.
> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime
> because too many systems have to old a version of harfbuzz.
>
> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10
>
> There are couple of incidental fixes in here too
> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version
> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy
> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502

Marked as reviewed by serb (Reviewer).

-------------

PR: https://git.openjdk.java.net/jdk/pull/2982
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux

Alexander Zvegintsev-2
In reply to this post by Phil Race
On Sat, 13 Mar 2021 00:15:16 GMT, Phil Race <[hidden email]> wrote:

> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps
> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux.
>
> I ended up having to go this way because its is the least unsatisfactory solution.
> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime
> because too many systems have to old a version of harfbuzz.
>
> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10
>
> There are couple of incidental fixes in here too
> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version
> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy
> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502

make/modules/java.desktop/lib/Awt2dLibraries.gmk line 465:

> 463:         tautological-constant-out-of-range-compare int-to-pointer-cast \
> 464:         undef missing-field-initializers range-loop-analysis
> 465:     HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244 4090 4146 4334 4819 4101 4068 4805 4138

Looks like that this block has extra indent of 1 space.

make/modules/java.desktop/lib/Awt2dLibraries.gmk line 479:

> 477:   # when building libharfbuzz
> 478:   ifeq ($(call isTargetOs, aix), true)
> 479:     LIBHARFBUZZ_CFLAGS += -qdebug=necan

I couldn't find the `-qdebug=necan` in the updated makefile. Does the [JDK-8258484](https://bugs.openjdk.java.net/browse/JDK-8258484) handled is some other way?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2982
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux

Magnus Ihse Bursie-3
In reply to this post by Sergey Bylokhov-2
On Sat, 13 Mar 2021 00:34:33 GMT, Sergey Bylokhov <[hidden email]> wrote:

>> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps
>> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux.
>>
>> I ended up having to go this way because its is the least unsatisfactory solution.
>> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime
>> because too many systems have to old a version of harfbuzz.
>>
>> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10
>>
>> There are couple of incidental fixes in here too
>> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version
>> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy
>> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502
>
> Marked as reviewed by serb (Reviewer).

It feels a bit unfortunate that we had to end up this way. :-( I've read through the bug report and unnderstand that this might be the least bad way... but still.

Just thinking out loud, you don't think it would be better to build harfbuzz separately, but as a static library, that is then included in libfontmanager? The main win of doing that, I think, is the ability to have all the disabled warnings confined to the lower-quality upstream source. The resulting code would be the same. And from a build performance perspective I don't think any way of doing it matters.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2982
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux

Phil Race
In reply to this post by Phil Race
On Sat, 13 Mar 2021 00:15:16 GMT, Phil Race <[hidden email]> wrote:

> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps
> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux.
>
> I ended up having to go this way because its is the least unsatisfactory solution.
> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime
> because too many systems have to old a version of harfbuzz.
>
> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10
>
> There are couple of incidental fixes in here too
> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version
> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy
> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502

> Just thinking out loud, you don't think it would be better to build harfbuzz separately, but as a static library, that is then included in libfontmanager? The main win of doing that, I think, is the ability to have all the disabled warnings confined to the lower-quality upstream source. The resulting code would be the same. And from a build performance perspective I don't think any way of doing it matters.

I don't know that this would be worth such an effort. I've clearly separated the warnings we are disabling for HARFBUZZ and there's really not a lot of likelihood in my mind that these warnings will suddenly also start to apply to the small amount of JDK code that is in libfontmanager which is also much simpler code.

BTW I noticed we are still disabling all warnings for sunFont.c and after this is done I'll likely see if I can make a source code change to resolve that.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2982
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux

Phil Race
In reply to this post by Alexander Zvegintsev-2
On Mon, 15 Mar 2021 10:46:45 GMT, Alexander Zvegintsev <[hidden email]> wrote:

>> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps
>> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux.
>>
>> I ended up having to go this way because its is the least unsatisfactory solution.
>> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime
>> because too many systems have to old a version of harfbuzz.
>>
>> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10
>>
>> There are couple of incidental fixes in here too
>> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version
>> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy
>> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502
>
> make/modules/java.desktop/lib/Awt2dLibraries.gmk line 479:
>
>> 477:   # when building libharfbuzz
>> 478:   ifeq ($(call isTargetOs, aix), true)
>> 479:     LIBHARFBUZZ_CFLAGS += -qdebug=necan
>
> I couldn't find the `-qdebug=necan` in the updated makefile. Is the [JDK-8258484](https://bugs.openjdk.java.net/browse/JDK-8258484) handled in some other way?

I'll restore this.

> make/modules/java.desktop/lib/Awt2dLibraries.gmk line 465:
>
>> 463:         tautological-constant-out-of-range-compare int-to-pointer-cast \
>> 464:         undef missing-field-initializers range-loop-analysis
>> 465:     HARFBUZZ_DISABLED_WARNINGS_microsoft := 4267 4244 4090 4146 4334 4819 4101 4068 4805 4138
>
> Looks like that this block has extra indent of 1 space.

Yes, I'll update it.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2982
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v2]

Phil Race
In reply to this post by Phil Race
On Mon, 15 Mar 2021 18:52:38 GMT, Magnus Ihse Bursie <[hidden email]> wrote:

> I was actually thinking that such a change would be simpler; more or less amounting to changing from LIBRARY to STATIC_LIBRARY. But if you feel that it is too much work, fine...

If you say so .. I have no idea what build changes would be needed. I'm just more familiar and comfortable with this and leaving aside the graal stuff I don't know if it is used like that anywhere by the main JDK build.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2982
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v2]

Magnus Ihse Bursie-3
In reply to this post by Phil Race
On Mon, 15 Mar 2021 18:57:28 GMT, Phil Race <[hidden email]> wrote:

>> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps
>> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux.
>>
>> I ended up having to go this way because its is the least unsatisfactory solution.
>> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime
>> because too many systems have to old a version of harfbuzz.
>>
>> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10
>>
>> There are couple of incidental fixes in here too
>> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version
>> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy
>> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>
>   8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux

Marked as reviewed by ihse (Reviewer).

-------------

PR: https://git.openjdk.java.net/jdk/pull/2982
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v2]

Alexander Zvegintsev-2
In reply to this post by Phil Race
On Mon, 15 Mar 2021 18:57:28 GMT, Phil Race <[hidden email]> wrote:

>> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps
>> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux.
>>
>> I ended up having to go this way because its is the least unsatisfactory solution.
>> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime
>> because too many systems have to old a version of harfbuzz.
>>
>> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10
>>
>> There are couple of incidental fixes in here too
>> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version
>> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy
>> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>
>   8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux

make/modules/java.desktop/lib/Awt2dLibraries.gmk line 456:

> 454:    # when building libharfbuzz
> 455:    ifeq ($(call isTargetOs, aix), true)
> 456:      LIBHARFBUZZ_CFLAGS += -qdebug=necan

Should it be `HARFBUZZ_CFLAGS` instead of `LIBHARFBUZZ_CFLAGS`? I don't see any usage of `LIBHARFBUZZ_CFLAGS` in this makefile.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2982
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v3]

Phil Race
In reply to this post by Phil Race
> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps
> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux.
>
> I ended up having to go this way because its is the least unsatisfactory solution.
> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime
> because too many systems have to old a version of harfbuzz.
>
> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10
>
> There are couple of incidental fixes in here too
> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version
> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy
> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502

Phil Race has updated the pull request incrementally with one additional commit since the last revision:

  8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2982/files
  - new: https://git.openjdk.java.net/jdk/pull/2982/files/f668b327..a92a146c

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

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

PR: https://git.openjdk.java.net/jdk/pull/2982
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v2]

Phil Race
In reply to this post by Alexander Zvegintsev-2
On Tue, 16 Mar 2021 10:38:19 GMT, Alexander Zvegintsev <[hidden email]> wrote:

>> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>>
>>   8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux
>
> make/modules/java.desktop/lib/Awt2dLibraries.gmk line 456:
>
>> 454:    # when building libharfbuzz
>> 455:    ifeq ($(call isTargetOs, aix), true)
>> 456:      LIBHARFBUZZ_CFLAGS += -qdebug=necan
>
> Should it be `HARFBUZZ_CFLAGS` instead of `LIBHARFBUZZ_CFLAGS`? I don't see any usage of `LIBHARFBUZZ_CFLAGS` in this makefile.

D'oh. It was LIB* in the old code and I copy / pasted and of course can't test that.
I've uploaded a fix.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2982
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v3]

Magnus Ihse Bursie-3
In reply to this post by Phil Race
On Tue, 16 Mar 2021 16:56:22 GMT, Phil Race <[hidden email]> wrote:

>> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps
>> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux.
>>
>> I ended up having to go this way because its is the least unsatisfactory solution.
>> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime
>> because too many systems have to old a version of harfbuzz.
>>
>> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10
>>
>> There are couple of incidental fixes in here too
>> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version
>> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy
>> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>
>   8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux

Marked as reviewed by ihse (Reviewer).

-------------

PR: https://git.openjdk.java.net/jdk/pull/2982
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux [v3]

Alexander Zvegintsev-2
In reply to this post by Phil Race
On Tue, 16 Mar 2021 16:56:22 GMT, Phil Race <[hidden email]> wrote:

>> From a build perspective this partially reverts https://bugs.openjdk.java.net/browse/JDK-8249821 except that it keeps
>> the harfbuzz sources separate and still supports building and running against a system harfbuzz which is only of interest or relevance on Linux.
>>
>> I ended up having to go this way because its is the least unsatisfactory solution.
>> I did not want us to build a devkit to link against a system linux only to find we couldn't use it at runtime
>> because too many systems have to old a version of harfbuzz.
>>
>> This solves the Manjaro Linux problem and I've manually verified building against a system hardbuxz on Ubuntu 20.10
>>
>> There are couple of incidental fixes in here too
>> - "libharfbuzz" should not have been in the EXTRA_HEADERS var when building against a system version
>> - harfbuzz/hb-ucdn is gone and should not be listed as a header directory needed to build the bundled copy
>> - I expect it also resolves https://bugs.openjdk.java.net/browse/JDK-8262502
>
> Phil Race has updated the pull request incrementally with one additional commit since the last revision:
>
>   8255790: GTKL&F: Java 16 crashes on initialising GTKL&F on Manjaro Linux

Marked as reviewed by azvegint (Reviewer).

-------------

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