openssl: Crash on Windows 11 ARM64 with OpenSSL built in release mode

When OpenSSL is built in release mode for Windows ARM64 (cross-compiling on amd64 host) using MSVC toolchain, the SSL_CTX_new function causes program to crash with “Access violation - code c0000005” error. The crash does not occur when OpenSSL is built in debug mode.

OpenSSL is built using perl Configure no-apps enable-pie no-shared VC-WIN64-ARM command, test program is:

#include <iostream>
#include <openssl/ssl.h>

int main(int argc, char** argv) {
    std::cout << "Entered main\n";
    auto* ctx = SSL_CTX_new(TLS_client_method());
    std::cout << "Created SSL_CTX " << ctx << "\n";
    std::cout << "Exiting main\n";
    return 0;
}

This is what WinDbg shows on crash:

(1940.d00): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
arm64_crash!ssl_cipher_collect_ciphers+0x34:
00007ff7`02d75fbc a903dff6 stp         x22,x23,[sp,#0x38]

Stack trace is:

WARNING: Stack pointer is outside the normal stack bounds. Stack unwinding can be inaccurate.
 # Child-SP          RetAddr               Call Site
00 ffffda56`12eff3a0 00000000`00000000     arm64_crash!ssl_cipher_collect_ciphers+0x34 [F:\projects\openssl-3.4.0\ssl\ssl_ciph.c @ 696] 

OpenSSL version is 3.4.0, MSVC version is “Microsoft ® C/C++ Optimizing Compiler Version 19.42.34435 for ARM64”.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 45 (1 by maintainers)

Commits related to this issue

Most upvoted comments

from source