vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

Extension hangs if a child process causes "cannot execute binary file: Exec format error"

Open zhangguofu opened this issue 7 years ago • 25 comments

VSCode Version: 1.40.1 OS Version: WIN10 10.0.18363.476 Extensions:

  1. Remote-WSL 0.40.3
  2. C/C++ 0.26.1
  3. C++ Intellisense 0.2.2
  4. Include Autocomplete 0.0.4

Steps to Reproduce: open folder in Remote WSL (ubuntu 18.04) open main.cc and it always shows that "Loading document symbols for main.cc ..."

Does this issue occur when all extensions are disabled?: Yes/No when all extensions are disabled, OUTLINE shows that "The active editor cannot provide outline information"

furthermore, when the cursor stays at number 0, it shows "loading...", Find All References for functions gives nothing, 0 outline outline2

zhangguofu avatar Nov 18 '19 09:11 zhangguofu

The easiest way to reproduce this issue is to set the compiler to a none-exist file, like "/usr/bin/g+++", and it could be used to test if your fix works.

zhangguofu avatar Nov 25 '19 01:11 zhangguofu

If you want to install arm-himix200-linux-g++ to exactly reproduce what is happening here, it could be possible. This is a hisilicon addjusted cross-compiler for hisilicon processors, for HI3516DV300 exactly, if you have business with Huawei hisilicon, then they should provide this toolchain. Refer http://www.hisilicon.com/ for more information And I think any other 32bit cross-compilers for ARM could do, so you might want to try gcc-linaro-7.3.1-2018.05-i686_arm-linux-gnueabihf.tar.xz on https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/arm-linux-gnueabihf/

zhangguofu avatar Nov 25 '19 01:11 zhangguofu

@zhangguofu Thanks a lot -- I was able to repro the hang with linked compiler. It looks like we don't handle the "cannot execute binary file: Exec format error" error case properly.

The bug also repros if the C_Cpp.clang_format_path is set the 32-bit binary.

I wasn't able to repro it on my Linux OS but it did with WSL (looks like my Linux OS can run 32-bit binaries).

sean-mcmanus avatar Nov 25 '19 23:11 sean-mcmanus

great, if I run arm-himix200-linux-g++ without the service of binfmt-support being started, I also see the error message "cannot execute binary file: Exec format error".

zhangguofu avatar Nov 26 '19 02:11 zhangguofu

The extension hang should be fixed with https://github.com/microsoft/vscode-cpptools/releases/tag/0.26.3-insiders .

sean-mcmanus avatar Dec 17 '19 03:12 sean-mcmanus