Opened 5 weeks ago

Closed 4 weeks ago

#27781 closed defect (fixed)

FTBFS on older arm

Reported by: weasel Owned by:
Priority: Medium Milestone: Tor: 0.3.5.x-final
Component: Core Tor/Tor Version: Tor: 0.3.5.1-alpha
Severity: Blocker Keywords: 034-backport, tor-arm
Cc: Actual Points:
Parent ID: Points:
Reviewer: dgoulet Sponsor:

Description

0.3.5.1-alpha failed to build on arm64/armhf/armel jessie, stretch (only arm64), trusty, xenial, and artful.

Looking at some of the logs, this comes up repeatedly:

src/lib/libtor-crypt-ops.a(src_lib_libtor_crypt_ops_a-aes_openssl.o): In function `aes_set_iv':
./build/../src/lib/crypt_ops/aes_openssl.c:399: undefined reference to `get_uint32'
./build/../src/lib/crypt_ops/aes_openssl.c:400: undefined reference to `get_uint32'
./build/../src/lib/crypt_ops/aes_openssl.c:401: undefined reference to `get_uint32'

https://jenkins.torproject.org/view/packages%20-%20debian/job/tor-debian-release-binaries-arm/44/

Cheers,

Child Tickets

Change History (11)

comment:1 Changed 5 weeks ago by nickm

Milestone: Tor: 0.3.5.x-final

What compiler version is this?

In 0.3.5, we turned those functions into inline functions in the bytes.h header, since they're used all over and they're great inlining candidates.

I wonder if this is one of those things where old compilers have problems with inline functions and linking them when it decides not to inline them.

comment:2 Changed 5 weeks ago by weasel

I don't know for certain, but I'd guess the stretch build uses 6.3, the jessie build 4.9.

comment:3 Changed 5 weeks ago by nickm

Oh, or maybe this is a big-endian issue. The AES-CTR code is slightly different on big-endian systems.

comment:4 Changed 5 weeks ago by weasel

According to https://wiki.debian.org/ArchitectureSpecificsMemo, all the arms are LE

comment:5 Changed 5 weeks ago by weasel

also maybe related:

15:00:32 ../src/lib/crypt_ops/aes_openssl.c: In function 'aes_cipher_free_':
15:00:32 ../src/lib/crypt_ops/aes_openssl.c:338:3: warning: implicit declaration of function 'memwipe'; did you mean 'mempcpy'? [-Wimplicit-function-declaration]
15:00:32    memwipe(cipher, 0, sizeof(aes_cnt_cipher_t));
15:00:32    ^~~~~~~
15:00:32    mempcpy
15:00:32 ../src/lib/crypt_ops/aes_openssl.c:338:3: warning: nested extern declaration of 'memwipe' [-Wnested-externs]
15:00:32 ../src/lib/crypt_ops/aes_openssl.c: In function 'aes_set_iv':
15:00:32 ../src/lib/crypt_ops/aes_openssl.c:399:22: warning: implicit declaration of function 'ntohl'; did you mean 'atoll'? [-Wimplicit-function-declaration]
15:00:32    cipher->counter3 = ntohl(get_uint32(iv));
15:00:32                       ^~~~~
15:00:32                       atoll
15:00:32 ../src/lib/crypt_ops/aes_openssl.c:399:22: warning: nested extern declaration of 'ntohl' [-Wnested-externs]
15:00:32 ../src/lib/crypt_ops/aes_openssl.c:399:28: warning: implicit declaration of function 'get_uint32'; did you mean 'getline'? [-Wimplicit-function-declaration]
15:00:32    cipher->counter3 = ntohl(get_uint32(iv));
15:00:32                             ^~~~~~~~~~
15:00:32                             getline
15:00:32 ../src/lib/crypt_ops/aes_openssl.c:399:28: warning: nested extern declaration of 'get_uint32' [-Wnested-externs]

from https://jenkins.torproject.org/view/packages%20-%20debian/job/tor-debian-release-binaries-arm/44/ARCHITECTURE=arm64,SUITE=artful/consoleFull

comment:6 Changed 5 weeks ago by nickm

Ah. This is happening only on Arm with openssl < 1.1, because on that platform we don't #define USE_EVP_AES_CTR

comment:7 Changed 5 weeks ago by nickm

Status: newneeds_review

See branch bug27781, bugfix on https://github.com/torproject/tor/pull/357

comment:8 Changed 4 weeks ago by nickm

Keywords: 034-backport added

This may need a partial backport to 0.3.4; see #27812

comment:9 Changed 4 weeks ago by traumschule

Keywords: tor-arm added

group doc/arm issues
(using tor-arm to avoid mixing with apparmor keyword, maybe there's a better alternative)

comment:10 Changed 4 weeks ago by dgoulet

Reviewer: dgoulet
Status: needs_reviewmerge_ready

I can't really validate compilation on ARM but the fixes lgtm.

comment:11 Changed 4 weeks ago by nickm

Resolution: fixed
Status: merge_readyclosed

Partially backported with f57d8722e04336031e06633cfc493b04d0c16f90; main fix merged to master.

Note: See TracTickets for help on using tickets.