[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #27802 [Core Tor/Tor]: OpenSSL 1.1.0 issue during static link



#27802: OpenSSL 1.1.0 issue during static link
-------------------------------------------------+-------------------------
 Reporter:  cretz                                |          Owner:  (none)
     Type:  defect                               |         Status:  new
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  unspecified
Component:  Core Tor/Tor                         |        Version:
 Severity:  Normal                               |     Resolution:
 Keywords:  static, 029-backport, 032            |  Actual Points:
  -unreached-backport, 033-unreached-backport    |
Parent ID:  #6623                                |         Points:
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------

Comment (by str4d):

 The problem here is that `-lpthread` appears before `-lcrypto`. This is
 caused by a bug in `TOR_SEARCH_LIBRARY` (in `acinclude.m4`) where the
 candidate library flags are appended to `LIBS` instead of prepended. See
 the above patch.

 With this patch applied, I'm running into a subsequent configuration error
 caused by a segfault that is likely related to the fix for #25353.

 {{{
 configure:9701: Now, we'll look for OpenSSL >= 1.0.1
 configure:9722: checking for openssl directory
 configure:9777: gcc -m64 -o conftest -pipe -O1     -static
 -I/path/to/include -I/path/to/include     -L/path/to/lib -L/path/to/lib
 conftest.c -lssl -lcrypto   -lpthread -ldl  >&5
 /path/to/lib/libcrypto.a(b_addr.o): In function `BIO_lookup_ex':
 b_addr.c:(.text+0xc73): warning: Using 'getaddrinfo' in statically linked
 applications requires at runtime the shared libraries from the glibc
 version used for linking
 /path/to/lib/libcrypto.a(b_sock.o): In function `BIO_gethostbyname':
 b_sock.c:(.text+0x69): warning: Using 'gethostbyname' in statically linked
 applications requires at runtime the shared libraries from the glibc
 version used for linking
 configure:9777: $? = 0
 configure:9800: gcc -m64 -c -pipe -O1     -static -I/path/to/include
 -I/path/to/include     conftest.c >&5
 configure:9800: $? = 0
 configure:9893: result: /path/to
 configure:9934: checking whether we need extra options to link openssl
 configure:9988: gcc -m64 -o conftest -pipe -O1     -static
 -I/path/to/include -I/path/to/include     -L/path/to/lib -L/path/to/lib
 conftest.c -lssl -lcrypto   -lpthread -ldl  >&5
 /path/to/lib/libcrypto.a(b_addr.o): In function `BIO_lookup_ex':
 b_addr.c:(.text+0xc73): warning: Using 'getaddrinfo' in statically linked
 applications requires at runtime the shared libraries from the glibc
 version used for linking
 /path/to/lib/libcrypto.a(b_sock.o): In function `BIO_gethostbyname':
 b_sock.c:(.text+0x69): warning: Using 'gethostbyname' in statically linked
 applications requires at runtime the shared libraries from the glibc
 version used for linking
 configure:9988: $? = 0
 configure:9988: ./conftest
 ./configure: line 1962: 11810 Segmentation fault      (core dumped)
 ./conftest$ac_exeext
 configure:9988: $? = 139
 configure: program exited with status 139
 configure: failed program was:
 | /* confdefs.h */
 | #define PACKAGE_NAME "tor"
 | #define PACKAGE_TARNAME "tor"
 | #define PACKAGE_VERSION "0.4.2.1-alpha-dev"
 | #define PACKAGE_STRING "tor 0.4.2.1-alpha-dev"
 | #define PACKAGE_BUGREPORT ""
 | #define PACKAGE_URL ""
 | #define APPROX_RELEASE_DATE "2019-09-17"
 | #define PACKAGE "tor"
 | #define VERSION "0.4.2.1-alpha-dev"
 | #define STDC_HEADERS 1
 | #define HAVE_SYS_TYPES_H 1
 | #define HAVE_SYS_STAT_H 1
 | #define HAVE_STDLIB_H 1
 | #define HAVE_STRING_H 1
 | #define HAVE_MEMORY_H 1
 | #define HAVE_STRINGS_H 1
 | #define HAVE_INTTYPES_H 1
 | #define HAVE_STDINT_H 1
 | #define HAVE_UNISTD_H 1
 | #define __EXTENSIONS__ 1
 | #define _ALL_SOURCE 1
 | #define _GNU_SOURCE 1
 | #define _POSIX_PTHREAD_SEMANTICS 1
 | #define _TANDEM_SOURCE 1
 | #define ENABLE_OPENSSL 1
 | #define ENABLE_ZSTD_ADVANCED_APIS 1
 | #define HAVE_MODULE_DIRAUTH 1
 | #define FLEXIBLE_ARRAY_MEMBER /**/
 | #define HAVE_ACCEPT4 1
 | #define HAVE_BACKTRACE 1
 | #define HAVE_BACKTRACE_SYMBOLS_FD 1
 | #define HAVE_EVENTFD 1
 | #define HAVE_EXPLICIT_BZERO 1
 | #define HAVE_FLOCK 1
 | #define HAVE_FTIME 1
 | #define HAVE_GET_CURRENT_DIR_NAME 1
 | #define HAVE_GETADDRINFO 1
 | #define HAVE_GETDELIM 1
 | #define HAVE_GETIFADDRS 1
 | #define HAVE_GETLINE 1
 | #define HAVE_GETPASS 1
 | #define HAVE_GETRLIMIT 1
 | #define HAVE_GETTIMEOFDAY 1
 | #define HAVE_GMTIME_R 1
 | #define HAVE_GNU_GET_LIBC_VERSION 1
 | #define HAVE_INET_ATON 1
 | #define HAVE_IOCTL 1
 | #define HAVE_LOCALTIME_R 1
 | #define HAVE_MADVISE 1
 | #define HAVE_MEMMEM 1
 | #define HAVE_MMAP 1
 | #define HAVE_PIPE 1
 | #define HAVE_PIPE2 1
 | #define HAVE_PRCTL 1
 | #define HAVE_SIGACTION 1
 | #define HAVE_SOCKETPAIR 1
 | #define HAVE_STATVFS 1
 | #define HAVE_STRNCASECMP 1
 | #define HAVE_STRCASECMP 1
 | #define HAVE_STRNLEN 1
 | #define HAVE_STRPTIME 1
 | #define HAVE_STRTOK_R 1
 | #define HAVE_STRTOULL 1
 | #define HAVE_SYSCONF 1
 | #define HAVE_SYSCTL 1
 | #define HAVE_TRUNCATE 1
 | #define HAVE_UNAME 1
 | #define HAVE_USLEEP 1
 | #define HAVE_VASPRINTF 1
 | #define HAVE_CLOCK_GETTIME 1
 | #define HAVE_GETENTROPY 1
 | #define HAVE_PTHREAD_H 1
 | #define HAVE_PTHREAD_CREATE 1
 | #define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
 | #define HAVE_EVENT2_EVENT_H 1
 | #define HAVE_EVENT2_DNS_H 1
 | #define HAVE_EVENT2_BUFFEREVENT_SSL_H 1
 | /* end confdefs.h.  */
 | struct ssl_cipher_st;
 |      unsigned SSL_CIPHER_get_id(const struct ssl_cipher_st *);
 |      char *getenv(const char *);
 | int
 | main ()
 | {
 |                         if (getenv("THIS_SHOULDNT_BE_SET_X201803"))
 SSL_CIPHER_get_id((void *)0);
 |   ;
 |   return 0;
 | }
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/27802#comment:10>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs