When an java application using SWT toolkit (from the swt-devel port) open FileDialog, JVM crashes in the realpath() function. It's because SWT rely on a linux extension not present in FreeBSD. Fix: Put following patch to the files directory (and bump PORTEPOCH):
State Changed From-To: open->feedback Awaiting maintainers feedback
arg, try that again... ===> Updating from CVS ? swt-fix.diff M Makefile A files/patch-os.c ===> Generating patch ===> Viewing diff with less ? swt-fix.diff Index: Makefile =================================================================== RCS file: /home/ncvs/ports/x11-toolkits/swt-devel/Makefile,v retrieving revision 1.7 diff -u -r1.7 Makefile --- Makefile 20 Jul 2007 23:47:37 -0000 1.7 +++ Makefile 31 Jul 2007 21:29:03 -0000 @@ -7,6 +7,7 @@ PORTNAME= swt-devel DISTVERSION= 3.3 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= x11-toolkits devel java MASTER_SITES= ${MASTER_SITE_ECLIPSE} Index: files/patch-os.c =================================================================== RCS file: files/patch-os.c diff -N files/patch-os.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ files/patch-os.c 31 Jul 2007 21:29:03 -0000 @@ -0,0 +1,22 @@ +--- os.c.orig 2007-07-31 17:17:38.000000000 -0400 ++++ os.c 2007-07-31 17:21:59.000000000 -0400 +@@ -17397,11 +17397,18 @@ + jint rc = 0; + OS_NATIVE_ENTER(env, that, realpath_FUNC); + if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail; +- if (arg1) if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail; ++ if (arg1) { ++ if ((lparg1 = (*env)->GetByteArrayElements(env, arg1, NULL)) == NULL) goto fail; ++ } else { ++ lparg1 = malloc(PATH_MAX); ++ } + rc = (jint)realpath((const char *)lparg0, (char *)lparg1); + fail: + if (arg1 && lparg1) (*env)->ReleaseByteArrayElements(env, arg1, lparg1, 0); + if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0); ++ if (!arg1 && lparg1 && rc == 0) ++ free(lparg1); ++ + OS_NATIVE_EXIT(env, that, realpath_FUNC); + return rc; + } ===> Done
State Changed From-To: feedback->open Maintainer has supplied a patch.
miwi 2007-08-03 21:53:45 UTC FreeBSD ports repository Modified files: x11-toolkits/swt-devel Makefile distinfo Added files: x11-toolkits/swt-devel/files patch-os.c Log: - Fix JVM crashes - Bump PORTREVISION PR: 114819 Submitted by: Dmitrij Tejblum <dt@yandex.ru> Approved by: Robert Noland <rnoland@2hip.net> (maintainer) Revision Changes Path 1.8 +1 -0 ports/x11-toolkits/swt-devel/Makefile 1.7 +0 -3 ports/x11-toolkits/swt-devel/distinfo 1.1 +21 -0 ports/x11-toolkits/swt-devel/files/patch-os.c (new) _______________________________________________ cvs-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/cvs-all To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
State Changed From-To: open->closed Committed. Thanks!