[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#798924: /usr/lib/x86_64-linux-gnu/jni/libatk-wrapper.so.6.0.0: SIGSEGV on Netbeans startup



Package: libatk-wrapper-java-jni
Version: 0.33.3-1.1
Followup-For: Bug #798924

I'm refreshing the patch with a potential fix for an aditional crash (a
double free() invocation) which crashed java too. I'm not sure it really
fixed it, but it's harmless if it didn't, anyway.


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.2.1 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=pt_BR.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)

Versions of packages libatk-wrapper-java-jni depends on:
ii  libatk-bridge2.0-0   2.18.0-1
ii  libatk-wrapper-java  0.33.3-1.1
ii  libatk1.0-0          2.18.0-1
ii  libatspi2.0-0        2.18.0-1
ii  libc6                2.19-22
ii  libcairo-gobject2    1.14.2-2
ii  libcairo2            1.14.2-2
ii  libdbus-1-3          1.10.0-3
ii  libgdk-pixbuf2.0-0   2.32.0-1
ii  libglib2.0-0         2.46.0-2
ii  libgtk-3-0           3.16.6-1
ii  libgtk2.0-0          2.24.28-1
ii  libpango-1.0-0       1.38.0-3
ii  libpangocairo-1.0-0  1.38.0-3

libatk-wrapper-java-jni recommends no packages.

libatk-wrapper-java-jni suggests no packages.

-- no debconf information
Index: java-atk-wrapper-0.33.3/jni/src/AtkWrapper.c
===================================================================
--- java-atk-wrapper-0.33.3.orig/jni/src/AtkWrapper.c
+++ java-atk-wrapper-0.33.3/jni/src/AtkWrapper.c
@@ -258,6 +258,11 @@ JNICALL Java_org_GNOME_Accessibility_Atk
                                                             jobject jAccContext)
 {
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
+  if (!global_ac) {
+   if (jaw_debug)
+     g_warning("%s: global_ac == NULL", __func__);
+   return;
+  }
   CallbackPara *para = alloc_callback_para(global_ac);
   gdk_threads_add_idle(focus_notify_handler, para);
 }
@@ -335,6 +340,11 @@ JNICALL Java_org_GNOME_Accessibility_Atk
 {
 
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
+  if (!global_ac) {
+     if (jaw_debug)
+     g_warning("%s: global_ac == NULL", __func__);
+   return;
+  } 
   CallbackPara *para = alloc_callback_para(global_ac);
   para->is_toplevel = (jIsToplevel == JNI_TRUE) ? TRUE : FALSE;
   gdk_threads_add_idle(window_open_handler, para);
@@ -412,6 +422,11 @@ JNICALL Java_org_GNOME_Accessibility_Atk
                                                             jboolean jIsToplevel)
 {
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
+  if (!global_ac) {
+     if (jaw_debug)
+     g_warning("%s: global_ac == NULL", __func__);
+   return;
+  }
   CallbackPara *para = alloc_callback_para(global_ac);
   para->is_toplevel = (jIsToplevel == JNI_TRUE) ? TRUE : FALSE;
   gdk_threads_add_idle(window_close_handler, para);
@@ -462,6 +477,11 @@ JNICALL Java_org_GNOME_Accessibility_Atk
                                                                jobject jAccContext)
 {
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
+  if (!global_ac) {
+     if (jaw_debug)
+     g_warning("%s: global_ac == NULL", __func__);
+   return;
+  }
   CallbackPara *para = alloc_callback_para(global_ac);
   gdk_threads_add_idle(window_minimize_handler, para);
 }
@@ -511,6 +531,11 @@ JNIEXPORT void JNICALL Java_org_GNOME_Ac
                                                                               jobject jAccContext)
 {
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
+  if (!global_ac) {
+     if (jaw_debug)
+     g_warning("%s: global_ac == NULL", __func__);
+   return;
+  }
   CallbackPara *para = alloc_callback_para(global_ac );
   gdk_threads_add_idle(window_maximize_handler, para);
 }
@@ -561,6 +586,11 @@ JNIEXPORT void JNICALL Java_org_GNOME_Ac
 {
 
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
+  if (!global_ac) {
+     if (jaw_debug)
+     g_warning("%s: global_ac == NULL", __func__);
+   return;
+  }
   CallbackPara *para = alloc_callback_para(global_ac);
   gdk_threads_add_idle(window_restore_handler, para);
 }
@@ -609,6 +639,11 @@ JNIEXPORT void JNICALL Java_org_GNOME_Ac
                                                                               jobject jAccContext) {
 
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
+  if (!global_ac) {
+     if (jaw_debug)
+     g_warning("%s: global_ac == NULL", __func__);
+   return;
+  }
   CallbackPara *para = alloc_callback_para(global_ac);
   gdk_threads_add_idle(window_activate_handler, para);
 }
@@ -659,6 +694,11 @@ JNICALL Java_org_GNOME_Accessibility_Atk
 {
 
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
+  if (!global_ac) {
+     if (jaw_debug)
+     g_warning("%s: global_ac == NULL", __func__);
+   return;
+  }
   CallbackPara *para = alloc_callback_para(global_ac);
   gdk_threads_add_idle(window_deactivate_handler, para);
 }
@@ -710,6 +750,11 @@ JNICALL Java_org_GNOME_Accessibility_Atk
 {
 
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
+  if (!global_ac) {
+     if (jaw_debug)
+     g_warning("%s: global_ac == NULL", __func__);
+   return;
+  }
   CallbackPara *para = alloc_callback_para(global_ac);
   gdk_threads_add_idle(window_state_change_handler, para);
 }
@@ -1044,6 +1089,11 @@ JNICALL Java_org_GNOME_Accessibility_Atk
                                                            jobjectArray args)
 {
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
+  if (!global_ac) {
+     if (jaw_debug)
+     g_warning("%s: global_ac == NULL", __func__);
+   return;
+  }
   jobjectArray global_args = (jobjectArray)(*jniEnv)->NewGlobalRef(jniEnv, args);
   CallbackPara *para = alloc_callback_para(global_ac);
   para->signal_id = (gint)id;
@@ -1099,6 +1149,11 @@ JNICALL Java_org_GNOME_Accessibility_Atk
                                                                   jboolean value)
 {
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
+  if (!global_ac) {
+     if (jaw_debug)
+     g_warning("%s: global_ac == NULL", __func__);
+   return;
+  }
   CallbackPara *para = alloc_callback_para(global_ac);
   AtkStateType state_type = jaw_util_get_atk_state_type_from_java_state( jniEnv, state );
   para->atk_state = state_type;
@@ -1295,6 +1350,11 @@ JNICALL Java_org_GNOME_Accessibility_Atk
                                                               jobject jAccContext)
 {
   jobject global_ac = (*jniEnv)->NewGlobalRef(jniEnv, jAccContext);
+  if (!global_ac) {
+   if (jaw_debug)
+     g_warning("%s: global_ac == NULL", __func__);
+   return;
+  }
   CallbackPara *para = alloc_callback_para(global_ac);
   gdk_threads_add_idle(bounds_changed_handler, para);
 }
Index: java-atk-wrapper-0.33.3/jni/src/jawobject.c
===================================================================
--- java-atk-wrapper-0.33.3.orig/jni/src/jawobject.c
+++ java-atk-wrapper-0.33.3/jni/src/jawobject.c
@@ -296,6 +296,7 @@ jaw_object_get_name (AtkObject *atk_obj)
   {
     (*jniEnv)->ReleaseStringUTFChars(jniEnv, jaw_obj->jstrName, atk_obj->name);
     (*jniEnv)->DeleteGlobalRef(jniEnv, jaw_obj->jstrName);
+    atk_obj->name = NULL;
   }
 
   if (jstr != NULL)

Reply to: