Skip to content

Conversation

dbouras
Copy link
Contributor

@dbouras dbouras commented Nov 19, 2023

Under MacOS (Darwin 23.1, arm64), building with Boost 1.81.0, localproxytest test-cases 'Test source mode" and 'Test source mode with client token' fail due to a bus error when calling connection->socket_.shutdown in tcp_adapter_proxy::tcp_socket_error. The exact same issue is triggered in localproxy, when a connection that's been setup through the tunnel, is subsequently closed (e.g. using SSH to login to the remote end and then logging out).

In addition, OpenSSL is not linked statically when both shared and dynamic libs are available.

Motivation

Without this fix, localproxy is still usable but requires restarting under MacOS whenever a connection through the secure tunnel is closed -- this complicates things further since tunnel credentials must be rotated when the connection drops after localproxy crashes with a bus error.

Modifications

Change summary

  • One-line fix for preventing localproxy bus error crashes
  • Forced static linking with OpenSSL libraries

Testing

Is your change tested? If not, please justify the reason.
Please list your testing steps and test results.

  • The fix allows localproxytest to pass all tests successfully (see attached output)
    test_output.zip

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Under MacOS (Darwin 23.1, arm64), building with Boost 1.81.0, localproxytest test-cases 'Test source mode" and 'Test source mode with client token' fail due to a bus error when calling connection->socket_.shutdown in tcp_adapter_proxy::tcp_socket_error. The exact same issue is triggered in localproxy, when a connection that's been setup through the tunnel, is subsequently closed (e.g. using SSH to login to the remote end and then logging out).
Update CMakeLists.txt to force linking with static versions of the OpenSSL libraries (libssl and libcrypto) when both static and share-object libs are available, in fashion similar to that used for Protobuf and Boost.
@dbouras dbouras changed the title Fix bus error from boost socket.shutdown in tcp_socket_error() Fix bus error from boost socket.shutdown in tcp_socket_error() and link statically to OpenSSL Nov 20, 2023
Copy link
Contributor

@RogerZhongAWS RogerZhongAWS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine for the most part, will merge for now but will need to see if statically linking openssl provides any added value

@RogerZhongAWS RogerZhongAWS merged commit 2df9b59 into aws-samples:main Jun 27, 2024
@dbouras dbouras deleted the patch-1 branch June 28, 2024 02:58
RogerZhongAWS added a commit that referenced this pull request Jul 30, 2024
…) and link statically to OpenSSL (#145)"

This reverts commit 2df9b59.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants