<AWT Dev> RFR: 8254024: Enhance native libs for AWT and Swing to work with GraalVM Native Image
Andrii Rodionov
github.com+1538227+arodionov at openjdk.java.net
Fri Oct 16 22:23:10 UTC 2020
On Fri, 16 Oct 2020 21:54:56 GMT, Andrii Rodionov <github.com+1538227+arodionov at openjdk.org> wrote:
>>> Actually, we have found this issue during JCK tests execution that was built as a native image. The fix criteria are
>>> the successful tests run.
>>
>> But what exact steps should be done to reproduce this bug w/o using jck or any external tools? Something like:
>> - Clone JDK
>> - Build JDK using some specific options.
>> - Create some small test case
>> - Somehow create the native image
>> - Run the app -> boom -> bug is reproduced
>
> Yes, I understand what you mean.
> Unfortunately, I don't know a straightforward way.
> Maybe the easiest way to reproduce an error and validate the fix is to download the future version of GraalVM with
> AWT/Swing support (hope it will be at the end of October), replace `libawt.a` to its unpatched library version and then
> build a native image based on the following code:
> float[] data = new float[]{0.0f, 1.1f, 2.2f, 3.3f, 4.4f, 5.5f, 6.6f, 7.7f, 8.8f};
> Kernel kernel = new Kernel(3, 3, data);
> ConvolveOp op = new ConvolveOp(kernel);
>
> BufferedImage src = new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB);
> BufferedImage dest = new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB);
>
> op.filter(src, dest);
> The built image run should throw "Unable to convolve src image" ImagingOpException exception.
In general, the 2 following points should be changed and tested in the static libraries:
- rename conflicting/duplicate symbols in libraries that are linked together
- have a workaround for the functionality implemented via dlopen/dlsym
-------------
PR: https://git.openjdk.java.net/jdk/pull/562
More information about the awt-dev
mailing list