[ace-bugs] ACE+SSL: Connection aborts or hangs when sending data from client to server

Ray Allen raymond.allen at systemswithintelligence.com
Mon Nov 18 16:54:06 CST 2019


    ACE VERSION: 6.5.6

    HOST MACHINE and OPERATING SYSTEM:

    Lenovo Flex 2-15 (Intel Core i7-4510U) running Windows 10 Professional build 18362

        If on Windows based OS's, which version of WINSOCK do you
        use?: 2.2

    OpenSSL version is 1.1.1d.

    TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
    COMPILER NAME AND VERSION (AND PATCHLEVEL): [N/A]

    THE $ACE_ROOT/ace/config.h FILE [if you use a link to a platform-
    specific file, simply state which one]:

    #ifndef _FILE_OFFSET_BITS
    #define _FILE_OFFSET_BITS 64
    #endif // _FILE_OFFSET_BITS
    #include "config-win32.h"


    THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE [if you
    use a link to a platform-specific file, simply state which one
    (unless this isn't used in this case, e.g., with Microsoft Visual
    C++)]: [N/A]

    CONTENTS OF $ACE_ROOT/bin/MakeProjectCreator/config/default.features
    (used by MPC when you generate your own makefiles):

    No "default.features" file is used.  The command line passed to MPC is:

    perl bin\mwc.pl -type vc14 -name_modifier "*_vc14ssl" -recurse -features "ssl=1,openssl11=1" -hierarchy

    AREA/CLASS/EXAMPLE AFFECTED:
[What example failed?  What module failed to compile?]

    The problem appears in an application we have written.

    DOES THE PROBLEM AFFECT:
        COMPILATION?
        LINKING?
            On Unix systems, did you run make realclean first?
        EXECUTION?
        OTHER (please specify)?
[Please indicate whether ACE, your application, or both are affected.]

    There are no issues with compilation or linking.  All code has been compiled in Debug (non-optimized) mode.  The problem affects our application when it is executing.

    SYNOPSIS:
[Brief description of the problem]

    Our application establishes a SSL-enabled link between a client and a server.  When the client begins transmission of data to the server, either no data is sent or data transfer begins but hangs shortly afterwards.

    DESCRIPTION:
[Detailed description of problem.  Don't just say "<blah>
doesn't work, here's a fix," explain what your program does
to get to the <blah> state. ]

    Our application uses ACE_SSL_SOCK_Connector on the client and ACE_SSL_SOCK_Acceptor on the server.  ACE_SSL_SOCK_Stream is used for data transfer.  The server is using a self-signed certificate.

    After a connection is established, the client sends some parameters to the server (e.g., direction of data transfer [client->server in this case], name of the destination file, size of the destination file) and then begins sending the data.

    The client reads 64kByte blocks of data from a file into a buffer which is passed to send().  We are using the Reactor, so data is sent on every call to handle_output() until either all data has been sent or the connection is flow controlled.  This follows the method described in the ACE example code.

    If the amount of data to be sent is small (less than the buffer size), then we often observe that no data is sent and the connection is closed by the client.

    If the amount of data to be sent is large (requiring several buffer fills), then we often observe that data transfer continues for a while and then abruptly halts.  There seems to be no way to recover from this (i.e., handle_output() is never called after transfer halts).

    There is another problem that we have been able to fix: In cases where all of the data has been sent and the connection is closed, handle_input() is called on the server side and a call to recv() returns -1 with EWOULDBLOCK as an error -- implying that there is still more data pending receive.  We are able to work around this because we know the amount of data that is expected.  Once we have received everything, we force a shutdown of the connection on the server side.

    Note: We have been using this exact same application (without SSL) for several years now and have had no problems.  It seems that moving to ACE+SSL has broken it.

    REPEAT BY:
[What you did to get the error; include test program or session
transcript if at all possible.  ]

    The failures are repeatable.  Just re-run the application.

    If you want the relevant sections of our application code, please let me know.

    SAMPLE FIX/WORKAROUND:
[If available ]

    None available.



Regards,

[https://west.exch031.serverdata.net/owa/attachment.ashx?id=RgAAAAAy5lYu0mmlRrK4vpOTco4eBwBQDsIpA5ywQLYIcrlyVimzAAAAMMBIAABQDsIpA5ywQLYIcrlyVimzAACpVGInAAAJ&attcnt=1&attid0=BAAAAAAA&attcid0=image001.png%4001D2C349.6710AA20]

Raymond Allen
Senior Firmware Engineer

Systems With Intelligence Inc.
Phone: +1-289-562-0126
Fax: +1-289-562-0152
Email: raymond.allen at SystemsWithIntelligence.com<mailto:mraymond.allen at SystemsWithIntelligence.com>
www.SystemsWithIntelligence.com<http://www.systemswithintelligence.com/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.isis.vanderbilt.edu/pipermail/ace-bugs/attachments/20191118/e495941e/attachment.html>


More information about the ace-bugs mailing list