[sctp-dev] FW: Use SCTP with Java 1.6?
Christopher Hegarty -Sun Microsystems Ireland
Christopher.Hegarty at Sun.COM
Mon Jan 18 03:56:11 PST 2010
Hi Dennis,
handleSocketError is an exported nio function in JDK7, but not JDK6. The
sctp implementation calls it in the case of an error on the socket. You
will receive an error from the dynamic linker becuase this function is
not in libnio of JDK6, if running SCTP with Suns JDK6.
While not strictly not a bug in JDK7, I think we can simply copy the
small native function, handleSockeError, to the SCTP implementation and
have it built into libsctp.so removing this dependency.
Thanks for reporting this issue. I filed the following bug:
6917317: (sctp) Remove dependency on handleSocketError
-Chris.
Dennis Hjort wrote:
>
> Hi Christopher, sending this one to the list too. !
>
> We seem to have trigger something during testing SCTP in jdk6, causing a
> an error, that works using Sockets, and TCP.
>
> Here comes an example of output:
>
> <SNIPP>
> eodenns at ltesim12:~/SockIO/src$ java
> -Xbootclasspath/a:/proj/ltesim/usr/eodenns/jdk6classes/sctp6.jar Main
> Client starting Doing accept Client connecting...
> Doing accept1
> Doing accept2
> Doing accept3
> Doing accept4
> Sending traffic...
> Doing accept5
> Doing accept6
> Avg number of msgs sent per second: 13077 Doing accept Client starting
> Client connecting...
> Doing accept1
> Sending traffic...
> Doing accept2
> Doing accept3
> Doing accept4
> Doing accept5
> Doing accept6
> Avg number of msgs sent per second: 13545 Client starting Client
> connecting...
> Sending traffic...
> Doing accept
> Doing accept1
> Doing accept2
> Doing accept3
> Doing accept4
> Doing accept5
> Doing accept6
> Doing accept
> java: relocation error:
> /proj/ltesim/usr/eodenns/jdk1.6.0_18/jre/lib/amd64/libsctp.so: symbol
> handleSocketError, version SUNWprivate_1.1 not defined in file libnio.so
> with link time reference </SNIPP>
>
> And I've attached the source we used to exhibit this behavior.
>
> We might have done some "do not do like this" shortcuts, and if we have,
> please tell us what we done wrong ! :-)
>
> With kind regards
>
> // Dennis
>
>
> -----Original Message-----
> From: Christopher.Hegarty at Sun.COM [mailto:Christopher.Hegarty at Sun.COM]
> Sent: den 14 januari 2010 15:22
> To: Dennis Hjort
> Subject: Re: [sctp-dev] Use SCTP with Java 1.6?
>
> On 14/01/2010 14:14, Dennis Hjort wrote:
>> Ow, sorry, I read it the wrong way ! :-)
>>
>> And after running with that one it works just perfectly ! :-)
>>
>> Now I'll try to use it in a bigger scope, and I'll get back to you !
>
> That would be great. Looking forward to hearing your experience with it.
>
> -Chris.
>
>> With kind regards !
>>
>> // D
>>
>> -----Original Message-----
>> From: Christopher.Hegarty at Sun.COM [mailto:Christopher.Hegarty at Sun.COM]
>> Sent: den 14 januari 2010 14:57
>> To: Dennis Hjort
>> Subject: Re: [sctp-dev] Use SCTP with Java 1.6?
>>
>> You will need to get the libstcp.so from the link on the webpage I
> sent.
>> Please look at the red writing on this page.
>>
>> The reason you will need to get this "special" native library is that
>> the most recent changes I pushed (a few days ago) add new native
>> methods to libsctp so that we can remove dependencies on JDK7 specific
>
>> native methods. Until the next JDK7 promotion, b80 I believe, you
>> cannot simply get libsctp from JDK7. After b80 this should be fine.
>>
>> Let me know how it goes.
>>
>> -Chris.
>>
>> On 14/01/2010 13:52, Dennis Hjort wrote:
>>> Hi Christopher !
>>>
>>> I followed you instructions using JDK6 update u18 on our linux
>>> platform (amd64), and got the following error when executing the
>> TestSCTP:
>>> eodenns at ltesim12:~$ java -Xbootclasspath/a:jdk6classes/sctp6.jar
>>> TestSCTP
>>> Exception in thread "main" java.lang.UnsatisfiedLinkError:
>>> sun.nio.ch.SctpNet.init()V
>>> at sun.nio.ch.SctpNet.init(Native Method)
>>> at sun.nio.ch.SctpNet.<clinit>(SctpNet.java:309)
>>> at
> sun.nio.ch.SctpChannelImpl.<init>(SctpChannelImpl.java:131)
>>> at com.sun.nio.sctp.SctpChannel.open(SctpChannel.java:165)
>>> at TestSCTP.main(TestSCTP.java:4)
>>>
>>> But when I think about it I do have a old release of JDK7 where I got
>
>>> the libsctp.so from ... I'll do another try after I've downloaded a
>>> later jdk7 release...
>>>
>>> // D
>>>
>>> -----Original Message-----
>>> From: Christopher.Hegarty at Sun.COM
>>> [mailto:Christopher.Hegarty at Sun.COM]
>>> Sent: den 14 januari 2010 11:24
>>> To: Dennis Hjort
>>> Cc: sctp-dev at openjdk.java.net
>>> Subject: Re: [sctp-dev] Use SCTP with Java 1.6?
>>>
>>> You may want to get the latest JDK6 update, u18, which was just
>>> releases
>>> ;-)
>>>
>>> http://java.sun.com/javase/downloads/
>>>
>>> -Chris.
>>>
>>> On 14/01/2010 10:19, Dennis Hjort wrote:
>>>> Thanks Christopher ! :-)
>>>>
>>>> I'll get right on trying it out ! :-)
>>>>
>>>> With kind regards
>>>>
>>>> // D
>>>>
>>>> -----Original Message-----
>>>> From: Christopher.Hegarty at Sun.COM
>>>> [mailto:Christopher.Hegarty at Sun.COM]
>>>> Sent: den 13 januari 2010 12:41
>>>> To: Dennis Hjort; Michal Lefler
>>>> Cc: sctp-dev at openjdk.java.net
>>>> Subject: Re: [sctp-dev] Use SCTP with Java 1.6?
>>>>
>>>> Hi Dennis, Michal,
>>>>
>>>> I added a page to the sctp project site [1] with, what I believe are
>
>>>> detailed, instructions of how to use SCTP with JDK6. Please take a
>>>> look and try them out.
>>>>
>>>> If you encounter any problems of find something lacking from the
>>>> instructions then please let me know. If the instructions are
>>>> sufficient and you getting it running without any problem, please
>>>> let
>>>> me know you experience.
>>>>
>>>> -Chris.
>>>>
>>>> [1] http://openjdk.java.net/projects/sctp/html/sctp6.html
>>>>
>>>> Dennis Hjort wrote:
>>>>> Hi Christopher !
>>>>>
>>>>> I've been reading your posts regarding this topic, and downloaded
>>>>> the source, and applied the patch. Now I would like to compile a
>>>>> jdk6 compatible sctp-lib! :-)
>>>>>
>>>>> As you already know, our management is holding of moving up to JDK7
>
>>>>> until a standard release, maybe even longer, and we are now trying
>>>>> to cut of performance costs in the product we are building, and now
>
>>>>> we even have numbers on what our implementation using the JNI
>>>>> library +
>>>>> additions to our eventkernel to handle the blocking channels is
>>>>> costing in performance, so it would be great to be able to use the
>>>>> sctplib with
>>>>> JDK6 already ! :-)
>>>>>
>>>>> So, if it's possible I would appreciate the detailed instructions
>>>>> on
>>>>> how to get it working with JDK6 ! :-)
>>>>>
>>>>> With kind regards
>>>>>
>>>>> // Dennis
>>>>>
>>>>> -----Original Message-----
>>>>> From: sctp-dev-bounces at openjdk.java.net
>>>>> [mailto:sctp-dev-bounces at openjdk.java.net] On Behalf Of Christopher
>
>>>>> Hegarty - Sun Microsystems Ireland
>>>>> Sent: den 8 januari 2010 17:23
>>>>> To: Michal Lefler
>>>>> Cc: sctp-dev at openjdk.java.net
>>>>> Subject: Re: [sctp-dev] Use SCTP with Java 1.6?
>>>>>
>>>>> Hi Michal,
>>>>>
>>>>> I was trying to come up with a list of things to do to get the SCTP
>
>>>>> implementation working on JDK6, when I came across a previous
>>>>> attempt I made at it. To my surprise I had actually got further
>>>>> than I thought, and I found a list of changes I wanted to push into
>>>>> JDK7 so
>>>>> make this simpler ( as well as a few new ones ).
>>>>>
>>>>> From that I created;
>>>>> 6915313: (sctp) Reorganize implementation to make it more
>>>>> feasible
>>>>> to port to JDK6
>>>>>
>>>>> Webrev:
>>>>> http://cr.openjdk.java.net/~chegar/6915313/webrev.0/webrev/
>>>>>
>>>>> With these changes applied we can simply take the JDK7 SCTP code,
>>>>> and with two very minor edits have it run with JDK6. I did this and
>
>>>>> have
>>>>> it running with JDK6u17. Without the above mentioned changes it is
>>>>> a
>>>>> little more tricky because you need to make many more edits and
>>>>> recompile the native code.
>>>>>
>>>>> I will be requesting a review of 6915313 and hope to be in a
>>>>> position to push it early next week. I can then send detailed
>>>>> instructions of
>>>>> how to get it working with JDK 6.
>>>>>
>>>>> -Chris.
>>>>>
>>>>> On 06/01/2010 14:57, Christopher Hegarty - Sun Microsystems Ireland
>>>>> wrote:
>>>>>> Hi Michal,
>>>>>>
>>>>>> There is no binary/package of SCTP available for JDK6. We received
>
>>>>>> a number of inquiries about this so far, but none of which are
>>>>>> considered a high enough priority to consider an official backport
>
>>>>>> to
>>>>> JDK6.
>>>>>> That being said, a while back I took the API and implementation
>>>>>> from
>>>>>> JDK7 and tried to bolt it onto a JDK6 update. It was close to
>>>>>> completion, but I got side tracked with other things. When
>>>>>> designing the API, and doing the implementation, I considered the
>>>>>> possibility
>>>>>> that it may one day be ported to JDK6. If you look at the
>>>>>> implementation and you will see that there are very little JDK7
>>>>>> dependencies. It should be relatively straight forward to extract
>>>>>> the API and implementation and have it run with JDK6. One caveat,
>>>>>> the implementation depends on a sun private API and will only run
>>>>>> with
>>>>> Sun's JDK.
>>>>>> Is this something you would be willing to work on? I can certainly
>
>>>>>> help, but I don't have the time right now to run with it myself.
>>>>>>
>>>>>> -Chris.
>>>>>>
>>>>>> On 06/01/2010 06:09, Michal Lefler wrote:
>>>>>>> Hi.
>>>>>>>
>>>>>>> I would like to use this SCTP implementation with my Java 1.6_17.
>
>>>>>>> Is
>>>>>>> there a binary distribution of this package alone?
>>>>>>>
>>>>>>> How can I use this SCTP package with Java 1.6?
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> Michal.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
More information about the sctp-dev
mailing list