[sctp-dev] RFR [9] 8034181: SIGBUS at Java_sun_nio_ch_SctpChannelImpl_receive0

Chris Hegarty chris.hegarty at oracle.com
Mon Mar 24 14:09:25 UTC 2014


Alan, Dmitry,

I updated the webrev. It now allocates memory dynamically, and asserts 
that the number of bytes read is less than the size of sctp_notification 
( for notifications ).

http://cr.openjdk.java.net/~chegar/8034181/webrev.01/webrev/

-Chris.

On 22/03/14 08:19, Alan Bateman wrote:
> On 22/03/2014 08:13, Chris Hegarty wrote:
>> The native SCTP implementation assumes that the given byte buffer (
>> buffer address + position ) is memory aligned. It re-uses the buffer
>> for handling notifications from the SCTP Stack ( as well as for
>> reading data off the socket ). This can result in a SIBGUS on
>> sparc(v9) if the address is not 4 byte aligned [1].
>>
>> The trivial solution is to copy the SCTP notification into a stack
>> allocated buffer, for handling, if the given address is not 4 byte
>> aligned.
>>
>> http://cr.openjdk.java.net/~chegar/8034181/webev.00/webrev/
>>
> It looks like the stack allocated buffer will be out of scope when you
> use it and I assume it would be safer to declare buf at L465 or so.
>
> -Alan.


More information about the sctp-dev mailing list