src/os/solaris/vm/os_solaris.cpp compilation failed on SPARC
Paul Hohensee
paul.hohensee at oracle.com
Wed Oct 19 07:42:46 PDT 2011
I believe it happens only on S11.
socklen_t can be a size_t (at least it might be in my S10 copy of in.h), so
the real fix isn't as simple as this. You have to allocate a local
socklen_t
and copy the incoming argument into and out of it. Also, there's a bunch
more places where socklen_t should be used, including in the jdk libs,
where the copy scheme is already used in a number of places.
A fast fix is to use Azeem's webrev.
Paul
On 10/19/11 10:18 AM, Christian Thalinger wrote:
> On Oct 19, 2011, at 3:52 PM, Daniel D. Daugherty wrote:
>
>>> Today when I tried to build solaris-sparc I got the following error:
>>>
>>> "/home/ct232829/hsx/hotspot-comp/7090904/src/os/solaris/vm/os_solaris.cpp", line 6440: Error: Formal argument 6 of type unsigned* in call to recvfrom(int, void*, unsigned, int, sockaddr*, unsigned*) is being passed int*.
>>> "/home/ct232829/hsx/hotspot-comp/7090904/src/os/solaris/vm/os_solaris.cpp", line 6440: Error: Formal argument 6 of type unsigned* in call to recvfrom(int, void*, unsigned, int, sockaddr*, unsigned*) is being passed int*.
>>>
>>> The compiler used was:
>>>
>>> $ CC -V
>>> CC: Sun C++ 5.10 SunOS_sparc 128228-09 2010/06/24
>>> Usage: CC [ options ] files. Use 'CC -flags' for details
>>>
>>> The manpage has the following to say:
>>>
>>> ssize_t recvfrom(int s, void *buf, size_t len, int flags,
>>> struct sockaddr *from, socklen_t *fromlen);
>>>
>>> So the suggested fix would be:
>>>
>>> diff -r e5928e7dab26 src/os/solaris/vm/os_solaris.cpp
>>> --- a/src/os/solaris/vm/os_solaris.cpp
>>> +++ b/src/os/solaris/vm/os_solaris.cpp
>>> @@ -6437,7 +6437,7 @@ int os::recvfrom(int fd, char *buf, int
>>> sockaddr *from, int *fromlen) {
>>> //%%note jvm_r11
>>> INTERRUPTIBLE_RETURN_INT((int)::recvfrom(fd, buf, nBytes,\
>>> - flags, from, fromlen), os::Solaris::clear_interrupted);
>>> + flags, from, (socklen_t*) fromlen), os::Solaris::clear_interrupted);
>>> }
>>>
>>> int os::sendto(int fd, char *buf, int len, int flags,
>>>
>>> -- Chris
>> Chris,
>>
>> That failure mode is covered by the following bug:
>>
>> 7091417 3/4 recvfrom's 6th input should be of type socklen_t
>>
>> Looks like the code review on hotspot-runtime-dev at openjdk.net
>> ran into some issues. Paul H is the current RE so you should
>> talk to him.
> Hmm, right. Seems I've missed that review. I wonder how JPRT is working around this...
>
> -- Chris
>
>> Dan
>>
More information about the hotspot-runtime-dev
mailing list