ADDITIONAL SYSTEM INFORMATION :
macOS Monterey
openjdk version "17.0.4.1" 2022-08-12
OpenJDK Runtime Environment (build 17.0.4.1+1)
OpenJDK 64-Bit Server VM (build 17.0.4.1+1, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
The same code that caused the crash inJDK-8287609 was
Found in dfontdecoder.c
jfx/modules/javafx.graphics/src/main/native-font/dfontdecoder.c
----
JNIEXPORT jintArray JNICALL Java_com_sun_javafx_font_DFontDecoder_getCTFontTags
(JNIEnv *env, jclass clazz, jlong fontPtr)
{
CTFontRef fontRef = (CTFontRef)fontPtr;
CTFontTableOptions options = kCTFontTableOptionNoOptions;
CFArrayRef tags = CTFontCopyAvailableTables(fontRef, options);
CFIndex count = CFArrayGetCount(tags);
----
The patch is in the Workaround section. I am OCA signed.
CUSTOMER SUBMITTED WORKAROUND :
diff --git a/modules/javafx.graphics/src/main/native-font/dfontdecoder.c b/modules/javafx.graphics/src/main/native-font/dfontdecoder.c
index 2ce8e875f3..2fdbc0a428 100644
--- a/modules/javafx.graphics/src/main/native-font/dfontdecoder.c
+++ b/modules/javafx.graphics/src/main/native-font/dfontdecoder.c
@@ -117,6 +117,9 @@ JNIEXPORT jintArray JNICALL Java_com_sun_javafx_font_DFontDecoder_getCTFontTags
CTFontRef fontRef = (CTFontRef)fontPtr;
CTFontTableOptions options = kCTFontTableOptionNoOptions;
CFArrayRef tags = CTFontCopyAvailableTables(fontRef, options);
+ if (tags == NULL) {
+ return NULL;
+ }
CFIndex count = CFArrayGetCount(tags);
jintArray intArrObj = (*env)->NewIntArray(env, count);
if (intArrObj == NULL) {
FREQUENCY : always
macOS Monterey
openjdk version "17.0.4.1" 2022-08-12
OpenJDK Runtime Environment (build 17.0.4.1+1)
OpenJDK 64-Bit Server VM (build 17.0.4.1+1, mixed mode, sharing)
A DESCRIPTION OF THE PROBLEM :
The same code that caused the crash in
Found in dfontdecoder.c
jfx/modules/javafx.graphics/src/main/native-font/dfontdecoder.c
----
JNIEXPORT jintArray JNICALL Java_com_sun_javafx_font_DFontDecoder_getCTFontTags
(JNIEnv *env, jclass clazz, jlong fontPtr)
{
CTFontRef fontRef = (CTFontRef)fontPtr;
CTFontTableOptions options = kCTFontTableOptionNoOptions;
CFArrayRef tags = CTFontCopyAvailableTables(fontRef, options);
CFIndex count = CFArrayGetCount(tags);
----
The patch is in the Workaround section. I am OCA signed.
CUSTOMER SUBMITTED WORKAROUND :
diff --git a/modules/javafx.graphics/src/main/native-font/dfontdecoder.c b/modules/javafx.graphics/src/main/native-font/dfontdecoder.c
index 2ce8e875f3..2fdbc0a428 100644
--- a/modules/javafx.graphics/src/main/native-font/dfontdecoder.c
+++ b/modules/javafx.graphics/src/main/native-font/dfontdecoder.c
@@ -117,6 +117,9 @@ JNIEXPORT jintArray JNICALL Java_com_sun_javafx_font_DFontDecoder_getCTFontTags
CTFontRef fontRef = (CTFontRef)fontPtr;
CTFontTableOptions options = kCTFontTableOptionNoOptions;
CFArrayRef tags = CTFontCopyAvailableTables(fontRef, options);
+ if (tags == NULL) {
+ return NULL;
+ }
CFIndex count = CFArrayGetCount(tags);
jintArray intArrObj = (*env)->NewIntArray(env, count);
if (intArrObj == NULL) {
FREQUENCY : always
- relates to
-
JDK-8287609 macOS: SIGSEGV at [CoreFoundation] CFArrayGetCount / sun.font.CFont.getTableBytesNative
- Resolved