Bug 230321 - java/openjdk8 - SCTP do not work
Summary: java/openjdk8 - SCTP do not work
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Greg Lewis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-03 07:52 UTC by Timo Voelker
Modified: 2018-12-27 10:47 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (java)


Attachments
patch file (1.53 KB, patch)
2018-08-03 07:52 UTC, Timo Voelker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timo Voelker 2018-08-03 07:52:11 UTC
Created attachment 195811 [details]
patch file

I found an issue with SCTP support in OpenJDK8 for FreeBSD. In my example 

https://github.com/msvoelker/java-sctp/

it happened that OpenJDK8 calls sendmsg with an buffer address != NULL and a buffer length of 0, which is an invalid argument for FreeBSD. I found the code lines in the function Java_sun_nio_ch_sctp_SctpChannelImpl_send0 of

jdk/src/solaris/native/sun/nio/ch/sctp/SctpChannelImpl.c

Besides that, I changed two ifdef statements for FreeBSD (see attached patch file). If I copy this patch file to the files directory of the OpenJDK8 port, I'm able to install OpenJDK and to run the example application.

sudo cp patch-jdk-src-solaris-native-sun-nio-ch-sctp-SctpChannelImpl.c /usr/ports/java/openjdk8/files
cd /usr/ports/java/openjdk8
sudo make install

I just saw that hwh found this issue already for OpenJDK7.

https://lists.freebsd.org/pipermail/freebsd-java/2010-September/008906.html

Thanks,

Timo
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-12-08 19:09:40 UTC
A commit references this bug:

Author: glewis
Date: Sat Dec  8 19:09:29 UTC 2018
New revision: 486983
URL: https://svnweb.freebsd.org/changeset/ports/486983

Log:
  . Fix SCTP support.

  PR:		230321
  Submitted by:	Timo Voelker <timo.voelker@fh-muenster.de>

Changes:
  head/java/openjdk8/Makefile
  head/java/openjdk8/files/patch-jdk-src-solaris-native-sun-nio-ch-sctp-SctpChannelImpl.c
Comment 2 Greg Lewis freebsd_committer freebsd_triage 2018-12-08 19:10:08 UTC
Thanks for the patch!  Committed.
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-12-27 10:47:21 UTC
A commit references this bug:

Author: ale
Date: Thu Dec 27 10:46:57 UTC 2018
New revision: 488531
URL: https://svnweb.freebsd.org/changeset/ports/488531

Log:
  MFH: r485094 r486973 r486983 r487219 r488521

  - Fix reversed ccache version detection logic.  Enable ccache support.
  - Use '-pthread' for Clang.  Clang supports '-pthread' on all BSDs except
  for Darwin. [1]

  Reported by:	Achilleas Mantzios <achill@matrix.gatewaynet.com> [1]
  Tested by:	Achilleas Mantzios <achill@matrix.gatewaynet.com> [1]

  . Update to 8u192.

  PR:		230364

  . Fix SCTP support.

  PR:		230321
  Submitted by:	Timo Voelker <timo.voelker@fh-muenster.de>

  . Fix build on gcc based architectures (e.g. powerpc64)

  PR:		233883
  Submitted by:	Piotr Kubaj <pkubaj@anongoth.pl>

  Add support for millisecond resolution to get/setLastModifiedTime
  in both Java IO and NIO.

  Approved by:	portmgr (bapt)

Changes:
_U  branches/2018Q4/
  branches/2018Q4/java/openjdk8/Makefile
  branches/2018Q4/java/openjdk8/distinfo
  branches/2018Q4/java/openjdk8/files/patch-bsd
  branches/2018Q4/java/openjdk8/files/patch-bsd-test
  branches/2018Q4/java/openjdk8/files/patch-common_autoconf_build-performance.m4
  branches/2018Q4/java/openjdk8/files/patch-common_autoconf_generated-configure.sh
  branches/2018Q4/java/openjdk8/files/patch-configure
  branches/2018Q4/java/openjdk8/files/patch-hotspot_make_bsd_makefiles_gcc.make
  branches/2018Q4/java/openjdk8/files/patch-jdk-make-lib-Awt2dLibraries.gmk
  branches/2018Q4/java/openjdk8/files/patch-jdk-src-solaris-native-java-io-UnixFileSystem_md.c
  branches/2018Q4/java/openjdk8/files/patch-jdk-src-solaris-native-sun-nio-ch-sctp-SctpChannelImpl.c
  branches/2018Q4/java/openjdk8/files/patch-jdk-src-solaris-native-sun-nio-fs-UnixNativeDispatcher.c