Opened 4 weeks ago

Closed 4 weeks ago

#28399 closed defect (fixed)

Build is broken on Appveyor CI

Reported by: rl1987 Owned by:
Priority: Very High Milestone: Tor: 0.3.5.x-final
Component: Core Tor/Tor Version: Tor: 0.3.4.1-alpha
Severity: Normal Keywords: tor-ci appveyor windows regression 034-backport 035-backport
Cc: Actual Points:
Parent ID: Points:
Reviewer: nickm Sponsor:

Description

https://ci.appveyor.com/project/torproject/tor/builds/20213306

bash.exe : ../src/lib/tls/tortls_openssl.c: In function 'tor_tls_context_new':
At line:2 char:5
+     & $commandPath $args 2>&1
+     ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (../src/lib/tls/...s_context_new'::String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
../src/lib/tls/tortls_openssl.c:545:35: error: implicit declaration of function 'TLS_method'; did you mean 'DTLS_method'? [-Werror=implicit-function-declaration]
   if (!(result->ctx = SSL_CTX_new(TLS_method())))
                                   ^~~~~~~~~~
                                   DTLS_method
../src/lib/tls/tortls_openssl.c:545:35: error: nested extern declaration of 'TLS_method' [-Werror=nested-externs]
../src/lib/tls/tortls_openssl.c:545:35: error: passing argument 1 of 'SSL_CTX_new' makes pointer from integer without a cast [-Werror=int-conversion]
In file included from ../src/lib/tls/tortls_openssl.c:48:0:
C:/OpenSSL-Win32/include/openssl/ssl.h:2131:10: note: expected 'const SSL_METHOD * {aka const struct ssl_method_st *}' but argument is of type 'int'
 SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
          ^~~~~~~~~~~
../src/lib/tls/tortls_openssl.c:554:3: error: implicit declaration of function 'SSL_CTX_set_security_level'; did you mean 'SSL_CTX_set_verify_depth'? [-Werror=implicit-function-declaration]
   SSL_CTX_set_security_level(result->ctx, 1);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~
   SSL_CTX_set_verify_depth
../src/lib/tls/tortls_openssl.c:554:3: error: nested extern declaration of 'SSL_CTX_set_security_level' [-Werror=nested-externs]
../src/lib/tls/tortls_openssl.c: In function 'prune_v2_cipher_list':
../src/lib/tls/tortls_openssl.c:810:25: error: initialization makes pointer from integer without a cast [-Werror=int-conversion]
   const SSL_METHOD *m = TLS_method();
                         ^~~~~~~~~~
../src/lib/tls/tortls_openssl.c: In function 'tor_tls_client_is_using_v2_ciphers':
../src/lib/tls/tortls_openssl.c:919:13: error: implicit declaration of function 'SSL_get_client_ciphers'; did you mean 'SSL_get_current_cipher'? [-Werror=implicit-function-declaration]
   ciphers = SSL_get_client_ciphers(ssl);
             ^~~~~~~~~~~~~~~~~~~~~~
             SSL_get_current_cipher
../src/lib/tls/tortls_openssl.c:919:13: error: nested extern declaration of 'SSL_get_client_ciphers' [-Werror=nested-externs]
../src/lib/tls/tortls_openssl.c:919:11: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
   ciphers = SSL_get_client_ciphers(ssl);
           ^
../src/lib/tls/tortls_openssl.c: In function 'tor_tls_get_tlssecrets':
../src/lib/tls/tortls_openssl.c:1623:36: error: implicit declaration of function 'SSL_get_server_random'; did you mean 'SSL_get_servername'? [-Werror=implicit-function-declaration]
   const size_t server_random_len = SSL_get_server_random(ssl, NULL, 0);
                                    ^~~~~~~~~~~~~~~~~~~~~
                                    SSL_get_servername
../src/lib/tls/tortls_openssl.c:1623:36: error: nested extern declaration of 'SSL_get_server_random' [-Werror=nested-externs]
../src/lib/tls/tortls_openssl.c:1624:36: error: implicit declaration of function 'SSL_get_client_random'; did you mean 'SSL_get_client_CA_list'? [-Werror=implicit-function-declaration]
   const size_t client_random_len = SSL_get_client_random(ssl, NULL, 0);
                                    ^~~~~~~~~~~~~~~~~~~~~
                                    SSL_get_client_CA_list
../src/lib/tls/tortls_openssl.c:1624:36: error: nested extern declaration of 'SSL_get_client_random' [-Werror=nested-externs]
../src/lib/tls/tortls_openssl.c:1625:33: error: implicit declaration of function 'SSL_SESSION_get_master_key'; did you mean 'SSL_SESSION_get_time'? [-Werror=implicit-function-declaration]
   const size_t master_key_len = SSL_SESSION_get_master_key(session, NULL, 0);
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                 SSL_SESSION_get_time
../src/lib/tls/tortls_openssl.c:1625:33: error: nested extern declaration of 'SSL_SESSION_get_master_key' [-Werror=nested-externs]

Child Tickets

TicketStatusOwnerSummaryComponent
#28454closedteorActually use zstd on AppveyorCore Tor/Tor

Change History (9)

comment:1 Changed 4 weeks ago by nickm

Milestone: Tor: 0.3.5.x-final
Priority: MediumVery High

comment:2 Changed 4 weeks ago by nickm

I fixed a related (?) bug in 46796623f995c5b63d5cfbda1a038d9f6158ec90. Now to investigate the rest.

comment:3 Changed 4 weeks ago by nickm

Hm, something is going on here with the libraries or the headers. The configure script says:

checking for SSL_get_server_random... yes
checking for SSL_get_client_ciphers... yes
checking for SSL_get_client_random... yes

But later the error message is:

../src/lib/tls/tortls_openssl.c:1623:36: error: implicit declaration of function 'SSL_get_server_random'; did you mean 'SSL_get_servername'? [-Werror=implicit-function-declaration]

So the linker is finding a version of OpenSSL that has these functions defined, but the headers don't have them defined.

Looking at the appveyor/pacman logs, it seems that pacman thinks that it is installing OpenSSL 1.0.2p, which does not have these functions. These functions were added in 1.1.0.

So I'd guess that somewhere we're finding a 1.1.0p library when we configure, but finding the headers for 1.0.2p.

I wonder if 1b57bbba02de14a52e161295270052ab7f5bee47 is at issue?

comment:4 Changed 4 weeks ago by teor

I wonder if 1b57bbba02de14a52e161295270052ab7f5bee47 is at issue?

I tried reverting it, and it still gives the same error:
https://ci.appveyor.com/project/teor2345/tor/builds/20314300

The config.log is in a zip file on the artifacts tab.

When configure tests for TLS_method, it says:

configure:10062: checking for TLS_method
configure:10062: i686-w64-mingw32-gcc -o conftest.exe -g -O2 -I/c/OpenSSL-Win32/include  -L/c/OpenSSL-Win32/lib  conftest.c -lssl -lcrypto  >&5
configure:10062: $? = 0
configure:10062: result: yes

But make says:

i686-w64-mingw32-gcc -DHAVE_CONFIG_H -I. -I..  -I../src -I../src/ext -I../src/ext/trunnel -I../src/trunnel -I../src/ext -Isrc/ext -DSHARE_DATADIR="\"/mingw32/share\"" -DLOCALSTATEDIR="\"/mingw32/var\"" -DBINDIR="\"/mingw32/bin\"" -I/c/OpenSSL-Win32/include  -IC:/msys64/mingw32/include   -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector --param ssp-buffer-size=1 -fasynchronous-unwind-tables -Wall -fno-strict-aliasing -Waddress -Warray-bounds -Wdate-time -Wdouble-promotion -Wduplicate-decl-specifier -Wduplicated-cond -Wextra -Wfloat-conversion -Wignored-attributes -Wimplicit-fallthrough -Winit-self -Wlogical-op -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wnormalized=nfkc -Wnull-dereference -Woverlength-strings -Woverride-init -Wshadow -Wshift-count-negative -Wshift-count-overflow -Wshift-negative-value -Wshift-overflow=2 -Wsizeof-array-argument -Wstrict-overflow=1 -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wswitch-bool -Wsync-nand -Wtrampolines -Wunused-but-set-parameter -Wunused-but-set-variable -Wunused-const-variable=2 -Wunused-local-typedefs -Wvariadic-macros -W -Wfloat-equal -Wundef -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wwrite-strings -Wredundant-decls -Wchar-subscripts -Wcomment -Wformat=2 -Wwrite-strings -Wnested-externs -Wbad-function-cast -Wswitch-enum -Waggregate-return -Wpacked -Wunused -Wunused-parameter  -Wold-style-definition -Wmissing-declarations -Werror -MT src/lib/tls/libtor_tls_a-tortls_openssl.o -MD -MP -MF src/lib/tls/.deps/libtor_tls_a-tortls_openssl.Tpo -c -o src/lib/tls/libtor_tls_a-tortls_openssl.o `test -f 'src/lib/tls/tortls_openssl.c' || echo '../'`src/lib/tls/tortls_openssl.c
...
bash.exe : ../src/lib/tls/tortls_openssl.c: In function 'tor_tls_context_new':
At line:2 char:5
+     & $commandPath $args 2>&1
+     ~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (../src/lib/tls/...s_context_new'::String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
../src/lib/tls/tortls_openssl.c:545:35: error: implicit declaration of function 'TLS_method'; did you mean 'DTLS_method'? [-Werror=implicit-function-declaration]
   if (!(result->ctx = SSL_CTX_new(TLS_method())))
                                   ^~~~~~~~~~
                                   DTLS_method
../src/lib/tls/tortls_openssl.c:545:35: error: nested extern declaration of 'TLS_method' [-Werror=nested-externs]

I am working on some fixes in my bug28399 branch.

So far I have discovered:

  • we don't need to install the un-prefixed packages, they are for MSYS2 (like CYGWIN)
  • we aren't installing the mingw-prefixed openssl
  • we aren't finding zstd, maybe the mingw-prefixed pkgconfig will help

comment:5 Changed 4 weeks ago by teor

More discoveries:

Hmm, maybe removing the wrong OpenSSL paths worked:
https://ci.appveyor.com/project/teor2345/tor/builds/20315274

comment:6 Changed 4 weeks ago by teor

Keywords: 034-backport 035-backport added
Status: newneeds_review
Version: Tor: 0.3.4.1-alpha

See my branch bug28399-034.

It fixes the OpenSSL build issue by using the mingw openssl, rather than an external openssl. It also fixes the zstd detection issue from #28454 by passing the zstd config to configure.

Merged to maint-0.3.4 here:
https://github.com/torproject/tor/pull/512

And master here:
https://github.com/torproject/tor/pull/513

comment:7 Changed 4 weeks ago by teor

The maint-0.3.4 pull request actually points to the Appveyor build for the master merge.

For an 0.3.4 build, see:
https://ci.appveyor.com/project/teor2345/tor/builds/20320082

comment:8 Changed 4 weeks ago by nickm

Reviewer: nickm

comment:9 Changed 4 weeks ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Thanks so much for this -- I was totally stuck here!

Merged to 0.3.4 and forward.

Note: See TracTickets for help on using tickets.