OpenSSL 1.1.1b exceptions in CRYPO_malloc for Windows Mobile 6.5 (ARM), POCKET PC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I attempting to build OpenSSL 1.1.1b static libraries for our app on Windows Mobile 6.5 (ARM) targeting the POCKET PC SDK using Visual Studio 2005 for use with gSoap.  I know this stuff is ancient, but...

I can build and run OpenSSL 1.0.2 so it isn't a crisis until perhaps after end of year, but it would be nice to be up-to-date and support TLS 1.3.

I've followed the instructions graciously posted by Souju TANAKA, https://qiita.com/souju/items/94117c024862f57459c3#fn3, but I'm getting exceptions in CRYPO_malloc when initializing. gSoap hence OpenSSL is normally running in a thread.  I' tried initializing in both main thread and sync thread via gSoap initialized OpenSSL.

    #if OPENSSL_VERSION_NUMBER < 0x10100000L
        SSL_library_init();
    #else
        uint64_t  opts = 0;
        OPENSSL_init_ssl( opts, NULL);
    #endif

Exception details:
Note the exception is NOT on the first CRYPO_malloc call.
Data Abort: Thread=8d9d8688 Proc=807a3b10 '<app-name>.exe'
AKY=00008001 PC=03f6b630(coredll.dll+0x00022630) RA=21ac80c8(ppp.dll+0x000180c8) BVA=221b8130 FSR=00000005 First-chance exception at 0x03f6b630 in <app-name>.exe: 0xC0000005: Access violation reading location 0x001b8130.
Stack:
     0x03f6b630
     0x03f6b758
     0x03f6b968
     0x03f6ada0
     0x03f99388
     0x03f993b8
>    <app-name>.exe!CRYPTO_malloc(unsigned int num = 96, const char* file = 0x00c66c20, int line = 51) Line: 222, Byte Offsets: 0xa4    C      <app-name>.exe!CRYPTO_zalloc(unsigned int num = 96, const char* file = 0x00c66c20, int line = 51) Line: 230, Byte Offsets: 0x20    C      <app-name>.exe!OPENSSL_LH_new(unsigned long int (const void*)* h = 0x00666d14, int (const void*, const void*)* c = 0x00666c18) Line: 51, Byte Offsets: 0x20    C      <app-name>.exe!lh_OBJ_NAME_new(unsigned long int (obj_name_st*)* hfn = 0x00666d14, int (obj_name_st*, obj_name_st*)* cfn = 0x00666c18) Line: 12, Byte Offsets: 0x1c    C
     <app-name>.exe!o_names_init(void) Line: 70, Byte Offsets: 0x1c    C
     <app-name>.exe!o_names_init_ossl_(void) Line: 67, Byte Offsets: 0x0c    C      <app-name>.exe!CRYPTO_THREAD_run_once(long int* once = 0x00dae0f0, void (void)* init = 0x006667e4) Line: 93, Byte Offsets: 0x68    C
     <app-name>.exe!OBJ_NAME_init(void) Line: 78, Byte Offsets: 0x14    C
     <app-name>.exe!OBJ_NAME_add(const char* name = 0x00c58e80, int type = 2, const char* data = 0x00c7944c) Line: 213, Byte Offsets: 0x1c    C      <app-name>.exe!EVP_add_cipher(evp_cipher_st* c = 0x00c7944c) Line: 25, Byte Offsets: 0x48    C      <app-name>.exe!openssl_add_all_ciphers_int(void) Line: 22, Byte Offsets: 0x18    C      <app-name>.exe!ossl_init_add_all_ciphers(void) Line: 255, Byte Offsets: 0x0c    C      <app-name>.exe!ossl_init_add_all_ciphers_ossl_(void) Line: 242, Byte Offsets: 0x0c    C      <app-name>.exe!CRYPTO_THREAD_run_once(long int* once = 0x00dae12c, void (void)* init = 0x00668610) Line: 93, Byte Offsets: 0x68    C      <app-name>.exe!OPENSSL_init_crypto(unsigned __int64 opts = 76, ossl_init_settings_st* settings = 0x00000000) Line: 678, Byte Offsets: 0x324    C      <app-name>.exe!OPENSSL_init_ssl(unsigned __int64 opts = 76, ossl_init_settings_st* settings = 0x00000000) Line: 205, Byte Offsets: 0xb8    C
    calling function in main thread.

    Note: Break on exception in CRYPTO_malloc file=(0x00c66c20) "crypto\lhash\lhash.c"    and line : 51

If you've any ideas on what to check/try please let me know.

Config file run:
perl.exe Configure no-idea no-mdc2 no-rc5 no-ssl3 no-weak-ssl-ciphers no-async no-engine VC-CE

I've tried to match the compiler and linker flags, including the threading flag to main apps /MDd setting Also I've no idea why configure would add the OPENSSL_PIC preprocessor flag so I replaced it with OPENSSL_SYS_WINCE, (Didn't work with OPENSSL_PIC set either) I also removed the L_ENDIAN flag since that wasn't used in our main build(Didn't work with L_ENDIAN set either).

---  Manual changes to makefile  ---
- CFLAGS=/W3 /wd4090 /nologo /O1i
+ CFLAGS=/W3 /wd4090 /nologo /Od  /Os -D_MSC_VER=1200 /DEBUG
...
- CNF_CPPFLAGS=-D_WIN32_WCE=420 -DUNDER_CE=420 -DWCE_PLATFORM_POCKET_PC_2003___ -DARM -D_ARM_ -DARMV4 -D"OPENSSL_SYS_WIN32" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -D"NDEBUG" -I"\$(WCECOMPAT)/include" + CNF_CPPFLAGS=-D_WIN32_WCE=420 -DUNDER_CE=420 -DWCE_PLATFORM_POCKET_PC_2003___ /DEBUG -DARM -D_ARM_ -DARMV4 -D"OPENSSL_SYS_WINCE" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS"  -I"$(WCECOMPAT)/include"
...
- CNF_CFLAGS=/GF /Gy  /MD
+ CNF_CFLAGS=/GF /Gy  /MDd /DEBUG /Od
...
- LIB_CPPFLAGS=-D_WIN32_WCE=420 -DUNDER_CE=420 -DWCE_PLATFORM_POCKET_PC_2003___ -DARM -D_ARM_ -DARMV4 -D"L_ENDIAN" -D"NO_CHMOD" -D"OPENSSL_SMALL_FOOTPRINT" -D"OPENSSL_PIC" -D"OPENSSLDIR=\"C:\\Program Files\\Common Files\\SSL\"" -D"ENGINESDIR=\"C:\\Program Files\\OpenSSL\\lib\\engines-1_1\"" $(CNF_CPPFLAGS) $(CPPFLAGS) + LIB_CPPFLAGS=-D_WIN32_WCE=420 -DUNDER_CE=420 -DWCE_PLATFORM_POCKET_PC_2003___ -DARM -D_ARM_ -DARMV4 -D"NO_CHMOD" -D"OPENSSL_SMALL_FOOTPRINT" -D"OPENSSL_SYS_WINCE" -D"OPENSSLDIR=\"C:\\Program Files\\Common Files\\SSL\"" -D"ENGINESDIR=\"C:\\Program Files\\OpenSSL\\lib\\engines-1_1\"" $(CNF_CPPFLAGS) $(CPPFLAGS)
...
- CPPFLAGS_Q=-D_WIN32_WCE=420 -DUNDER_CE=420 -DWCE_PLATFORM_POCKET_PC_2003___ -DARM -D_ARM_ -DARMV4 -D"L_ENDIAN" -D"NO_CHMOD" -D"OPENSSL_SMALL_FOOTPRINT" -D"OPENSSL_PIC" + CPPFLAGS_Q=-D_WIN32_WCE=420 -DUNDER_CE=420 -DWCE_PLATFORM_POCKET_PC_2003___ -DARM -D_ARM_ -DARMV4 -D"NO_CHMOD" -D"OPENSSL_SMALL_FOOTPRINT" -D"OPENSSL_SYS_WINCE"
...
- CNF_LDFLAGS=/subsystem:windowsce,4.20 /machine:ARM
+ CNF_LDFLAGS=/subsystem:windowsce,4.20 /machine:ARM /LARGEADDRESSAWARE /ARMPADCODE

--- Visual Studio 2005 Compiler command line copy for main application(Uses wxWidgets 2.8.3 and gSoap
Od /Os
/I "C:\third_party\wxwidgets-2.8.3\include"
/I "C:\third_party\Boost\boost_1_33_1"
... other includes
/D "DEBUG" /D "_DEBUG" /D "_WIN32_WCE=0x420" /D "UNDER_CE=0x420" /D "WIN32_PLATFORM_PSPC" /D "WINCE" /D "_WINDOWS" /D "ARM" /D "_ARM_" /D "__WXWINCE__" /D "__WXDEBUG__" /D "wxNO_EXCEPTIONS" /D "wxNO_RTTI" /D "JS_EXPORT_API=1" /D "USE_JS_PARSER=1" /D "_UNICODE" /D "UNICODE"
/FD /EHsc /MDd /Gy /fp:fast /GR- /Yc"wx/wxprec.h"
/Fp"Pocket PC 2003 (ARMV4)\debug/<app-name>.pch" /Fo"Pocket PC 2003 (ARMV4)\debug/" /Fd"Pocket PC 2003 (ARMV4)\debug/<app-name>.pdb" /FR"Pocket PC 2003 (ARMV4)\debug/"
/W4 /nologo /c /Zi /TP



---  OpenSSL 1.1.1b CC command snip
        cl  /Zi /Fdossl_static.pdb /GF /Gy  /MDd /DEBUG /Od /W3 /wd4090 /nologo /Od  /Os -D_MSC_VER=1200 /DEBUG /I "." /I "include" -D_WIN32_WCE=420 -DUNDER_CE=420 -DWCE_PLATFORM_POCKET_PC_2003___ -DARM -D_ARM_ -DARMV4 -D"NO_CHMOD" -D"OPENSSL_SMALL_FOOTPRINT" -D"OPENSSL_SYS_WINCE" -D"OPENSSLDIR=\"C:\\Program Files\\Common Files\\SSL\"" -D"ENGINESDIR=\"C:\\Program Files\\OpenSSL\\lib\\engines-1_1\"" -D_WIN32_WCE=420 -DUNDER_CE=420 -DWCE_PLATFORM_POCKET_PC_2003___ /DEBUG -DARM -D_ARM_ -DARMV4 -D"OPENSSL_SYS_WINCE" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -I""C:\third_party\wcecompat-master"/include"  /Zs /showIncludes "ssl\t1_trce.c" 2>&1 > ssl\t1_trce.d         cl  /Zi /Fdossl_static.pdb /GF /Gy  /MDd /DEBUG /Od /W3 /wd4090 /nologo /Od  /Os -D_MSC_VER=1200 /DEBUG /I "." /I "include" -D_WIN32_WCE=420 -DUNDER_CE=420 -DWCE_PLATFORM_POCKET_PC_2003___ -DARM -D_ARM_ -DARMV4 -D"NO_CHMOD" -D"OPENSSL_SMALL_FOOTPRINT" -D"OPENSSL_SYS_WINCE" -D"OPENSSLDIR=\"C:\\Program Files\\Common Files\\SSL\"" -D"ENGINESDIR=\"C:\\Program Files\\OpenSSL\\lib\\engines-1_1\"" -D_WIN32_WCE=420 -DUNDER_CE=420 -DWCE_PLATFORM_POCKET_PC_2003___ /DEBUG -DARM -D_ARM_ -DARMV4 -D"OPENSSL_SYS_WINCE" -D"WIN32_LEAN_AND_MEAN" -D"UNICODE" -D"_UNICODE" -D"_CRT_SECURE_NO_DEPRECATE" -D"_WINSOCK_DEPRECATED_NO_WARNINGS" -I""C:\third_party\wcecompat-master"/include"  -c /Fossl\tls13_enc.obj "ssl\tls13_enc.c"
tls13_enc.c
include\internal/refcount.h(111) : warning C4028: formal parameter 1 different from declaration



Thanks
Jim




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux