[build2] [bug] Stack buffer overrun with incorrect var name and file grab

Klaim - Joël Lamotte mjklaim at gmail.com
Fri Mar 9 20:28:43 UTC 2018


I tested only on Windows (VS2017 15.6)
You will find my repro case there:
http://klaimsden.net/temp/jlamotte-build2-bugreport-capturefail.zip

In particular, I realized I was using a variable that was not defined in
the buildfile:

    # Both the non-defined variable ("lol") and the file grab are required
to expose the issue.
    kikoo = $lol/**
    target: {cxx}{$kikoo}


Here is the output I observe (see the last line):

PS G:\perso\experiments> .\setup_config_capture_fail.bat

G:\perso\experiments>bpkg --version
bpkg 0.7.0-a.0.22e35bf80cea95dc
libbpkg 0.7.0-a.0.9f695c1d19e55e05
libbutl 0.7.0-a.0.b726efcfd9462255
Copyright (c) 2014-2017 Code Synthesis Ltd
This is free software released under the MIT license.

G:\perso\experiments>b --version
build2 0.7.0-a.0.7409058f9af24d0a
libbutl 0.7.0-a.0.b726efcfd9462255
host x86_64-microsoft-win32-msvc14.1
Copyright (c) 2014-2017 Code Synthesis Ltd
This is free software released under the MIT license.

G:\perso\experiments>mkdir config-capturefail

G:\perso\experiments>pushd config-capturefail

G:\perso\experiments\config-capturefail>bpkg create cxx config.cxx=cl
created new configuration in G:\perso\experiments\config-capturefail\

G:\perso\experiments\config-capturefail>popd

G:\perso\experiments>bpkg build ./capture_fail/ -d ./config-capturefail/
unpacked capture_fail/1.0.0
error: b -q
configure('G:\perso\experiments\capture_fail\'@'./config-capturefail/capture_fail-1.0.0\')
terminated abnormally: stack buffer overrun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.build2.org/archives/users/attachments/20180309/743ba124/attachment.html>


More information about the users mailing list