Opened 3 months ago

Closed 3 months ago

#27460 closed defect (fixed)

Appveyor: --disable-gcc-hardening

Reported by: teor Owned by: teor
Priority: Medium Milestone: Tor: 0.3.4.x-final
Component: Core Tor/Tor Version: Tor: 0.3.4.1-alpha
Severity: Normal Keywords: 035-must, 034-must, 034-backport
Cc: mikeperry Actual Points:
Parent ID: #27389 Points:
Reviewer: Sponsor:

Description

--disable-gcc-hardening gets us further, but there are still more errors.

Child Tickets

TicketStatusOwnerSummaryComponent
#27432closedteorAppveyor: all compiled x86_64 executables crashCore Tor/Tor

Change History (6)

comment:1 Changed 3 months ago by teor

Status: assignedneeds_revision

My branch appveyor-disable-gcc-hardening has the code, but no changes file.

The CI gets as far as #27461:

comment:2 Changed 3 months ago by teor

I'd like to expand the matrix so we build:

  • old compiler (gcc 7.3.0 ?), enable gcc hardening
  • new compiler (gcc 8.2.0), disable gcc hardening

I'm not sure if it's worth building and allowing failures for:

  • new compiler (gcc 8.2.0), enable gcc hardening

comment:3 Changed 3 months ago by nickm

I think this solution is probably right for 0.3.4, but maybe in 0.3.5 we should change the implementation of gcc-hardening so that it does an AC_TRY_RUN() to see whether it can use these compiler flags safely. That could be another ticket, though.

comment:4 in reply to:  3 Changed 3 months ago by teor

Replying to nickm:

I think this solution is probably right for 0.3.4

Please see my branch bug27460-034 on ​https://github.com/teor2345/tor.git

The CI for 0.3.4 is here, but it will fail Appveyor until all the children of #27389 are merged:

The passing CI for all the #27389 fixes on 0.3.4 is here:

but maybe in 0.3.5 we should change the implementation of gcc-hardening so that it does an AC_TRY_RUN() to see whether it can use these compiler flags safely. That could be another ticket, though.

Arguably, this is a bug in autoconf: if the "checking size of" process crashes, then configure should error, not continue with a size of 0. But we're unlikely to get that fixed, because the documented behaviour is:

AC_CHECK_SIZEOF (type-or-expr, [unused], [includes = ‘AC_INCLUDES_DEFAULT’])

Define SIZEOF_type-or-expr (see Standard Symbols) to be the size in bytes of type-or-expr, which may be either a type or an expression returning a value that has a size. If the expression ‘sizeof (type-or-expr)’ is invalid, the result is 0. ...

https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Generic-Compiler-Characteristics.html

Which isn't precisely "The result is 0 if the program crashes.", but it's close enough.

I opened #27530 for AC_TRY_RUN, and #27468 for checking the latest versions of gcc and clang in our CI.

comment:5 Changed 3 months ago by teor

Status: needs_revisionneeds_review

comment:6 Changed 3 months ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Merged to 0.3.4 and forward

Note: See TracTickets for help on using tickets.