You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2016/04/07 20:24:01 UTC

[Bug 59286] New: Socket binding failures when using APR

https://bz.apache.org/bugzilla/show_bug.cgi?id=59286

            Bug ID: 59286
           Summary: Socket binding failures when using APR
           Product: Tomcat 8
           Version: 8.0.x-trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Connectors
          Assignee: dev@tomcat.apache.org
          Reporter: csutherl@redhat.com

Created attachment 33737
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33737&action=edit
Exception stack trace

When using APR for a connector and trying to bind to an ipv6 address (other
than lo ::1 or all ::), the connector fails to initialize with a "[22] Invalid
argument" exception. I'm using the default server.xml with the address
attribute added on the Connectors to reproduce. I noticed that the error is
coming up from the Socket.bind() call, but I wanted to open this with the
AprEndpoint in mind because it isn't crashing in the natives. Also note that I
am using OpenJDK 8u77 for my testing.

This only occurs with APR (NIO/NIO2 seem OK). I'm testing with APR 1.5.2 and
OpenSSL 1.0.2g:

07-Apr-2016 12:02:28.415 INFO [main]
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based
Apache Tomcat Native library 1.2.6 using APR version 1.5.2.
07-Apr-2016 12:02:28.415 INFO [main]
org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities:
IPv6 [true], sendfile [true], accept filters [false], random [true].
07-Apr-2016 12:02:28.417 INFO [main]
org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL
successfully initialized (OpenSSL 1.0.2g-fips  1 Mar 2016)

I put a breakpoint on the bind call, but the working (lo) bind and the
non-working one look pretty much identical. I am not familiar with
network/socket programming, so it's pretty foreign to me.

This does occur on tomcat-trunk as well.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 59286] Socket binding failures when using APR

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59286

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WORKSFORME

--- Comment #4 from Mark Thomas <ma...@apache.org> ---
I've just tested this with the latest 9.0.x and Tomcat Native 1.2.x and all
works as expected although I'll note that I had to use telnet for testing as
the browser was doing odd things with the IPv6 address.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 59286] Socket binding failures when using APR

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59286

--- Comment #3 from Coty Sutherland <cs...@redhat.com> ---
Sorry for all the movement on this one...Moving to tcnative instead of APR.
I've finally isolated the issue down to being a problem with link-local IPv6
and found a bugzilla (https://bz.apache.org/bugzilla/show_bug.cgi?id=52717)
that already tried to address the problem a few years ago. I guess that makes
this a duplicate and the other should be reopened, but I'll leave that up to
you guys.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 59286] Socket binding failures when using APR

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59286

Coty Sutherland <cs...@redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|bugs@apr.apache.org         |dev@tomcat.apache.org
          Component|APR                         |Library
            Version|1.5.2                       |1.2.5
            Product|APR                         |Tomcat Native

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 59286] Socket binding failures when using APR

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=59286

Coty Sutherland <cs...@redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Product|Tomcat 8                    |APR
          Component|Connectors                  |APR
            Version|8.0.x-trunk                 |1.5.2
   Target Milestone|----                        |---
           Assignee|dev@tomcat.apache.org       |bugs@apr.apache.org

--- Comment #1 from Coty Sutherland <cs...@redhat.com> ---
It looks like this affects httpd as well. That and the fact that the
Socket.bind() returns the 22 status is cause enough to start looking into APR
instead of Tomcat's AprEndpoint I think.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org