Bug 114819 - [patch] x11-toolkits/swt-devel crashes in realpath when invoke FileDialog
Summary: [patch] x11-toolkits/swt-devel crashes in realpath when invoke FileDialog
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-23 00:30 UTC by Dmitrij Tejblum
Modified: 2007-08-03 23:00 UTC (History)
0 users

See Also:


Attachments
file.diff (846 bytes, patch)
2007-07-23 00:30 UTC, Dmitrij Tejblum
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitrij Tejblum 2007-07-23 00:30:02 UTC
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):
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-07-23 00:30:12 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 Robert Noland 2007-08-01 01:46:58 UTC
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
Comment 3 Mark Linimon freebsd_committer freebsd_triage 2007-08-01 04:11:42 UTC
State Changed
From-To: feedback->open

Maintainer has supplied a patch.
Comment 4 dfilter service freebsd_committer freebsd_triage 2007-08-03 22:53:50 UTC
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"
Comment 5 Martin Wilke freebsd_committer freebsd_triage 2007-08-03 22:53:57 UTC
State Changed
From-To: open->closed

Committed. Thanks!