JDK-8211362 : Restrict export of libjpeg symbols from libjavafx_iio.so
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: openjfx11,openjfx12
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-10-01
  • Updated: 2021-08-31
  • Resolved: 2021-03-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
openjfx11.0.13Fixed
Related Reports
Relates :  
Description
libjavafx_iio.so contains a copy of libjpeg7 (soon to be libjpeg9)
and since we are exporting all the libjpeg symbols these may
clash with some other libjpeg on a system.
We should restrict the export to just the JNI interfaces as the
JDK does in similar situations.
 
See https://bugs.openjdk.java.net/browse/JDK-8200178 and
http://mail.openjdk.java.net/pipermail/build-dev/2018-March/021306.html

The gist of the fix there is to add a  JNIEXPORT directive to the declarations of the JNI functions in the JDK's own source files
which are compiled into the library and to update the makefile
so that all symbols not explicitly exported are internal.



Comments
Changeset: ed5cfe72 Author: Johan Vos <jvos@openjdk.org> Date: 2021-03-25 13:05:29 +0000 URL: https://git.openjdk.java.net/jfx/commit/ed5cfe72
25-03-2021

With PR#442 (https://git.openjdk.java.net/jfx/pull/442), the non-JNIEXPORT symbols are hidden since they are now compiled with -fvisibility=hidden The JNIEXPORT directive already has default visibility on linux, as jni_md.h contains: ``` #if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility) #ifdef ARM ... #else #define JNIEXPORT __attribute__((visibility("default"))) #endif #endif ``` The following JNI symbols are in the shared lib before and after the patch: 000000000000baa0 T Java_com_sun_javafx_iio_jpeg_JPEGImageLoader_decompressIndirect 000000000000b200 T Java_com_sun_javafx_iio_jpeg_JPEGImageLoader_disposeNative 000000000000b210 T Java_com_sun_javafx_iio_jpeg_JPEGImageLoader_initDecompressor 000000000000b080 T Java_com_sun_javafx_iio_jpeg_JPEGImageLoader_initJPEGMethodIDs 000000000000b830 T Java_com_sun_javafx_iio_jpeg_JPEGImageLoader_startDecompression
25-03-2021

Related discussion over review of JDK-8203884 : http://mail.openjdk.java.net/pipermail/openjfx-dev/2018-October/022596.html
04-10-2018

Raising to P3 since this is causing problems in some cases.
02-10-2018