<div dir="ltr"><div>I tested only on Windows (VS2017 15.6)</div>You will find my repro case there: 

<br class="gmail-Apple-interchange-newline"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><a href="http://klaimsden.net/temp/jlamotte-build2-bugreport-capturefail.zip">http://klaimsden.net/temp/jlamotte-build2-bugreport-capturefail.zip</a></span>

<div><br></div><div>In particular, I realized I was using a variable that was not defined in the buildfile:</div><div><br></div><div><div>    # Both the non-defined variable ("lol") and the file grab are required to expose the issue.</div><div>    kikoo = $lol/**</div><div>    target: {cxx}{$kikoo}</div></div><div><br></div><div><br></div><div>Here is the output I observe (see the last line):</div><div><br></div><div><div>PS G:\perso\experiments> .\setup_config_capture_fail.bat</div><div><br></div><div>G:\perso\experiments>bpkg --version</div><div>bpkg 0.7.0-a.0.22e35bf80cea95dc</div><div>libbpkg 0.7.0-a.0.9f695c1d19e55e05</div><div>libbutl 0.7.0-a.0.b726efcfd9462255</div><div>Copyright (c) 2014-2017 Code Synthesis Ltd</div><div>This is free software released under the MIT license.</div><div><br></div><div>G:\perso\experiments>b --version</div><div>build2 0.7.0-a.0.7409058f9af24d0a</div><div>libbutl 0.7.0-a.0.b726efcfd9462255</div><div>host x86_64-microsoft-win32-msvc14.1</div><div>Copyright (c) 2014-2017 Code Synthesis Ltd</div><div>This is free software released under the MIT license.</div><div><br></div><div>G:\perso\experiments>mkdir config-capturefail</div><div><br></div><div>G:\perso\experiments>pushd config-capturefail</div><div><br></div><div>G:\perso\experiments\config-capturefail>bpkg create cxx config.cxx=cl</div><div>created new configuration in G:\perso\experiments\config-capturefail\</div><div><br></div><div>G:\perso\experiments\config-capturefail>popd</div><div><br></div><div>G:\perso\experiments>bpkg build ./capture_fail/ -d ./config-capturefail/</div><div>unpacked capture_fail/1.0.0</div><div>error: b -q configure('G:\perso\experiments\capture_fail\'@'./config-capturefail/capture_fail-1.0.0\') terminated abnormally: stack buffer overrun</div></div><div><br></div><div><br></div></div>