# Spurious dumpbin crashes (race-conflicts?) in \`file(GET\_RUNTIME\_DEPENDENCIES\`

**URL:** https://discourse.cmake.org/t/spurious-dumpbin-crashes-race-conflicts-in-file-get-runtime-dependencies/6491
**Category:** Usage
**Tags:** os:windows
**Created:** [September 15, 2022, 8:54am UTC](https://discourse.cmake.org/t/spurious-dumpbin-crashes-race-conflicts-in-file-get-runtime-dependencies/6491 "2022-09-15T08:54:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gabyx](https://discourse.cmake.org/user_avatar/discourse.cmake.org/gabyx/32/2107_2.png) [@gabyx](https://discourse.cmake.org/u/gabyx)
#### Post date: [September 15, 2022, 8:54am UTC](https://discourse.cmake.org/t/spurious-dumpbin-crashes-race-conflicts-in-file-get-runtime-dependencies/6491/1 "2022-09-15T08:54:42Z")

</div>

We are using `file(GET_RUNTIME_DEPENDENCIES` as a `POST_BUILD` step in many targets  
on Windows to copy DLLs next to the executable for debugging purposes (also .pdbs etc…). So far this procedure is exactly the same on all platforms as during **install** which **is great**.

The function `file(GET_RUNTIME_DEPENDENCIES` is only supposed to be used in install steps as far as the documentation states.

However, for the POST\_BUILD, we are experiencing some strange dumpbin.exe crashes which  
occur to be related to the speed of the machine, and also after some multiple `cmake --build` invocations the build succeeds.

We would be really interessted why this happens and if it could be potentially be fixed by CMake or if it is really the case that we should not use this function during POST\_BUILD.

Thanks for your input.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [September 16, 2022, 12:55pm UTC](https://discourse.cmake.org/t/spurious-dumpbin-crashes-race-conflicts-in-file-get-runtime-dependencies/6491/2 "2022-09-16T12:55:42Z")

</div>

Can you provide a small example that shows the problem? Or at least provide more details about the error messages and/or symptoms.

It sounds like `dumpbin` itself is crashing…not sure what CMake can do about that.

Cc: @kyle.edwards

---

<div class="post-metadata">

### Author: ![gabyx](https://discourse.cmake.org/user_avatar/discourse.cmake.org/gabyx/32/2107_2.png) [@gabyx](https://discourse.cmake.org/u/gabyx)
#### Post date: [September 16, 2022, 4:21pm UTC](https://discourse.cmake.org/t/spurious-dumpbin-crashes-race-conflicts-in-file-get-runtime-dependencies/6491/3 "2022-09-16T16:21:15Z")

</div>

I think we located the problem, we do also copy after the deps. sweep, and since we have multiple targets setting up this post build it results in a race condition since the deps sweep also looks into the build folder where it will also copy dlls at the end.and multiple of these procedure in paralle is doomed to fail.
