Boost logo

Boost-Build :

Subject: Re: [Boost-build] Embedded ARM GNU 8.2.1 Archive Fail on Lib Target
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2019-02-13 01:12:09


AMDG

On 2/12/19 3:47 PM, codex653 via Boost-build wrote:
> <snip>
> gcc.archive
> ..\..\..\Thor\lib\stm32hal_f7\bin\gcc-8.2.1\debug\ThorMCU-STM32F767\link-static\libHAL_DRIVER.a
> Executing using a command file and the shell:
> ..\..\..\Thor\lib\stm32hal_f7\bin\gcc-8.2.1\debug\ThorMCU-STM32F767\link-static\libHAL_DRIVER.a

Okay. I think I've identified the problem.
It appears to be a use-after-free error in
the engine. The bug appears when all of the following are true:
- SHELL is % (meaning to execute directly, without
  going through cmd.exe)
- The command cannot be executed directly (In this case
  because it requires two separate subprocesses, ar and ranlib),
  which results in falling back to the cmd.exe.
- The action is declared as piecemeal, and
- The action needs to be split into multiple commands to
  avoid overflowing the command line.

The shell is replaced and the original freed at
execnt.c:283 but then make1.c:1196 attempts to
reuse the dead shell using a different pointer.

The optimization was introduced in
d1748e252e4b16d0f90a062d288395aee22634e4 (19 Jun 2012)

The refactoring that caused the bug was:
d23202eeff93d4d9d82102ac1cd8623a847631d6 (25 Jun 2012)

In Christ,
Steven Watanabe


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk