Hi. I have looked into this problem and came up with the following workaround patch that still uses Unity and avoids the crash.
I found that the crash occurs because a new Radio menu is created with *empty label*
for which unity_gtk_action_group_get_state_name() returns null and this ends up with a null-pointer dereference at g_str_hash().
My suggestion is to modify _1gtk_1radio_1menu_1item_1new_1with_1label() in os.c to call gtk_radio_menu_item_new_with_label() with an arbitrary, non-empty string if the
given string for label is for empty string (2nd parameter). In this patch, I used the string with one space (" ") as an arbitrary text.
I confirmed that, with this patch, the test given by Thomas Singer passes and all tests in Test_org_eclipse_swt_widgets_MenuItem.java pass as well.
Please let me know if you have any question or suggestion for this patch. Thanks.
Created attachment 256390
Patch
Hi. I have looked into this problem and came up with the following workaround patch that still uses Unity and avoids the crash.
I found that the crash occurs because a new Radio menu is created with *empty label* action_ group_get_ state_name( ) returns null and this ends up with a null-pointer dereference at g_str_hash().
for which unity_gtk_
My suggestion is to modify _1gtk_1radio_ 1menu_1item_ 1new_1with_ 1label( ) in os.c to call gtk_radio_ menu_item_ new_with_ label() with an arbitrary, non-empty string if the
given string for label is for empty string (2nd parameter). In this patch, I used the string with one space (" ") as an arbitrary text.
I confirmed that, with this patch, the test given by Thomas Singer passes and all tests in Test_org_ eclipse_ swt_widgets_ MenuItem. java pass as well.
Please let me know if you have any question or suggestion for this patch. Thanks.
--- "a/bundles/ org.eclipse. swt/Eclipse SWT PI/gtk/ library/ os.c" 2013-05-14 11:50:23.000000000 +0900 org.eclipse. swt/Eclipse SWT PI/gtk/ library/ os.c" 2015-09-04 19:49:40.768009600 +0900 _1gtk_1radio_ 1menu_1item_ 1new_1with_ 1label) NATIVE_ ENTER(env, that, _1gtk_1radio_ 1menu_1item_ 1new_1with_ 1label_ FUNC); >GetByteArrayEl ements( env, arg1, NULL)) == NULL) goto fail; gtk_radio_ menu_item_ new_with_ label(( GSList *)arg0, (const gchar *)lparg1); gtk_radio_ menu_item_ new_with_ label(( GSList *)arg0, (const gchar *)" "); gtk_radio_ menu_item_ new_with_ label(( GSList *)arg0, (const gchar *)lparg1); >ReleaseByteArr ayElements( env, arg1, lparg1, 0); NATIVE_ EXIT(env, that, _1gtk_1radio_ 1menu_1item_ 1new_1with_ 1label_ FUNC);
+++ "b/bundles/
@@ -13868,7 +13868,10 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(
jintLong rc = 0;
OS_
if (arg1) if ((lparg1 = (*env)-
- rc = (jintLong)
+ if (lparg1[0] == '\0')
+ rc = (jintLong)
+ else
+ rc = (jintLong)
fail:
if (arg1 && lparg1) (*env)-
OS_