Bug 163650
Summary: | Kernel update broke java.net.socket? | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Greg Swallow <gswallow> |
Component: | kernel | Assignee: | Dave Jones <davej> |
Status: | CLOSED ERRATA | QA Contact: | Brian Brock <bbrock> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3 | CC: | boris, j, noa, pfrields, vnasardinov, wtogami |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i386 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2005-09-05 03:56:42 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Greg Swallow
2005-07-19 20:50:45 UTC
I am also seeing this. Kernel 2.6.12-1.1372_FC3 with Sun's 1.4.2_03 JDK is unable to open sockets. Dropping back to kernel 2.6.11-1.35_FC3 and they work fine. I have tried disabling SELinux enforcing - this made no difference. Here is an strace extract showing the calls immediately prior to the exception being thrown. The exception seems to be due to incorrect params to the "connect" call. I'm not sure how to get to the bottom of this - any advise welcome. Is the http connection using IPv6 where it should be using IPv4? socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3 connect(3, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("203.63.53.112")}, 16) = 0 getsockname(3, {sa_family=AF_INET, sin_port=htons(32777), sin_addr=inet_addr("192.168.1.100")}, [16]) = 0 close(3) = 0 stat64("/usr/local/jdk1.4.2_08-sun/jre/lib/i386/libnet.so", {st_mode=S_IFREG|0775, st_size=67964, ...}) = 0 socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = 3 listen(3, 1) = 0 getsockname(3, {sa_family=AF_INET6, sin6_port=htons(32774), inet_pton(AF_INET6, "::", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0}, [28]) = 0 socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = 4 connect(4, {sa_family=AF_INET6, sin6_port=htons(32774), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=3213364936}, 24) = -1 EINVAL (Invalid argument) close(3) = 0 close(4) = 0 socket(PF_INET6, SOCK_STREAM, IPPROTO_IP) = 3 connect(3, {sa_family=AF_INET6, sin6_port=htons(80), inet_pton(AF_INET6, "::ffff:203.63.53.112", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=3213364936}, 24) = -1 EINVAL (Invalid argument) close(3) = 0 write(1, "Web page I/O problem: http://mir"..., 73Web page I/O problem: http://mirror.bom.gov.au/products/IDR023.loop.shtml) = 73 write(1, "\n", 1 ) = 1 write(1, "Exception: java.net.SocketExcept"..., 88Exception: java.net.SocketException: Invalid argument or cannot assign requested address) = 88 write(1, "\n", 1 ) = 1 Just discovered this appears to be a duplicate of https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=163006 I've got the same problem. kernel-2.6.11-1.35_FC3 works, but kernel-2.6.12-1.1372_FC3 not. Example: log4j can't send emails via SMTP log4j:ERROR Error occured while sending e-mail notification. javax.mail.SendFailedException: Sending failed; nested exception is: class javax.mail.MessagingException: Could not connect to SMTP host: mail, port: 25; nested exception is: java.net.SocketException: Invalid argument or cannot assign requested address at javax.mail.Transport.send0(Transport.java:218) at javax.mail.Transport.send(Transport.java:80) at org.apache.log4j.net.SMTPAppender.sendBuffer(Unknown Source) at org.apache.log4j.net.SMTPAppender.append(Unknown Source) at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:221) at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:57) at org.apache.log4j.Category.callAppenders(Category.java:187) at org.apache.log4j.Category.forcedLog(Category.java:372) at org.apache.log4j.Category.error(Category.java:303) Noa Resare filed a bug with Sun. See bug 163006, comment #4. It's a bug in Sun's JVM. In comment #2, Ben Stringer writes: | connect(4, {sa_family=AF_INET6, sin6_port=htons(32774), | inet_pton(AF_INET6, "::1", &sin6_addr), sin6_flowinfo=0, | sin6_scope_id=3213364936}, 24) = -1 EINVAL Note that the value of the "addrlen" parameter to "connect" is 24 in the above call. It should be 28, because sizeof(struct sockaddr_in6) is 28. *** Bug 163006 has been marked as a duplicate of this bug. *** I've bugged Sun with this once more. The "incident review ID" is 488634. I suppose that I'll get an answer in a few weeks. The workaround that they mention is using -Djava.net.preferIPv4Stack=true, which fixes my problems. This bug mirrors bug 164165 in FC4. It has been fixed in CVS. It should also be fixed in the latest kernel in updates-testing The latest FC3 kernel, 2.6.12-1.1376_FC3, fixes this problem for me - thanks! |