8026385: [macosx] (awt) setjmp/longjmp changes the process signal mask on OS X
Summary: Use _setjmp/_longjmp instead
Reviewed-by: prr, anthony
Contributed-by: David DeHaven <david.dehaven@oracle.com>
--- a/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c Mon May 19 10:03:58 2014 -0700
+++ b/jdk/src/share/native/sun/awt/image/jpeg/imageioJPEG.c Mon May 19 23:21:39 2014 +0400
@@ -56,6 +56,12 @@
#undef MAX
#define MAX(a,b) ((a) > (b) ? (a) : (b))
+#ifdef __APPLE__
+/* use setjmp/longjmp versions that do not save/restore the signal mask */
+#define setjmp _setjmp
+#define longjmp _longjmp
+#endif
+
/* Cached Java method ids */
static jmethodID JPEGImageReader_readInputDataID;
static jmethodID JPEGImageReader_skipInputBytesID;
--- a/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c Mon May 19 10:03:58 2014 -0700
+++ b/jdk/src/share/native/sun/awt/image/jpeg/jpegdecoder.c Mon May 19 23:21:39 2014 +0400
@@ -47,6 +47,12 @@
#include <jpeglib.h>
#include "jerror.h"
+#ifdef __APPLE__
+/* use setjmp/longjmp versions that do not save/restore the signal mask */
+#define setjmp _setjmp
+#define longjmp _longjmp
+#endif
+
/* The method IDs we cache. Note that the last two belongs to the
* java.io.InputStream class.
*/
--- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c Mon May 19 10:03:58 2014 -0700
+++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_jpeg.c Mon May 19 23:21:39 2014 +0400
@@ -30,6 +30,12 @@
#include <setjmp.h>
+#ifdef __APPLE__
+/* use setjmp/longjmp versions that do not save/restore the signal mask */
+#define setjmp _setjmp
+#define longjmp _longjmp
+#endif
+
/* stream input handling */
typedef struct
--- a/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c Mon May 19 10:03:58 2014 -0700
+++ b/jdk/src/share/native/sun/awt/splashscreen/splashscreen_png.c Mon May 19 23:21:39 2014 +0400
@@ -71,7 +71,12 @@
goto done;
}
+#ifdef __APPLE__
+ /* use setjmp/longjmp versions that do not save/restore the signal mask */
+ if (_setjmp(png_set_longjmp_fn(png_ptr, _longjmp, sizeof(jmp_buf)))) {
+#else
if (setjmp(png_jmpbuf(png_ptr))) {
+#endif
goto done;
}