Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrapper: failed with: gRPC call failed: Socket closed #474

Closed
manorit2001 opened this issue Aug 3, 2022 · 9 comments
Closed

wrapper: failed with: gRPC call failed: Socket closed #474

manorit2001 opened this issue Aug 3, 2022 · 9 comments

Comments

@manorit2001
Copy link

Describe the bug
bear doesn't run at all and shows this error while trying to run it.

To Reproduce
Not really sure on this part, I have installed bear on ubuntu 22.04 using apt. I even tried compiling from source with the master branch from github but still the same error.

$ bear -- make BUILD_BASE=/home/user/Projects/atf/build CROSS_COMPILE="aarch64-none-linux-gnu-" PLAT=k3 TARGET_BOARD=generic "SPD=opteed" "DEBUG=1" -C atf all               [16:24:09]
wrapper: failed with: gRPC call failed: Socket closed

Expected behavior
Generate compile_commands.json

Environment:

  • OS name: Linux
  • OS version: Ubuntu 22.04
  • OS architecture: x86_64
  • Bear version: 3.0.18, git-master
  • Bear install method: Both compiling from source and apt

Additional context

  • Can you give us a reference to the project that you are running against this tool? [e.g. No if it's a close source project, but in case of an open source project a link to the sources could be nice.]: https://github.com/ARM-software/arm-trusted-firmware
  • What build tools this project is using? [e.g. GNU make wtih configure script]
  • What architecture you are trying to compile for? [e.g. cross compiling]
$ aarch64-none-linux-gnu-gcc --version                                                                                                                                           [16:27:28]
aarch64-none-linux-gnu-gcc (GNU Toolchain for the A-profile Architecture 10.3-2021.07 (arm-10.29)) 10.3.1 20210621
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  • Could you attach build logs? If you can re-run the command which failed (e.g. bear -- make) with extra verbose log switches (e.g. bear --verbose -- make) and send the output of it, that would help a lot.

Before you send...

  • Have you read the README.md file or man bear? Yes
  • Have you looked what other open issues Bear has? Yes
  • Are you sure that the build works without Bear? Yes
@rizsotto
Copy link
Owner

rizsotto commented Aug 4, 2022

Hey @manorit2001, thanks for the report...

Could you check if the #472 workaround can be applied for your case? (Using wrapper mode, create a wrapper file for the cross compiler and write a configuration file.)

I have to say that your error message is very different (socket closed is something to do with networking), but the cross compiler usage is very much alike. Maybe check if the host you are running the compilation has IPv4 address (localhost is fine).

@manorit2001
Copy link
Author

Hey @manorit2001, thanks for the report...

Could you check if the #472 workaround can be applied for your case? (Using wrapper mode, create a wrapper file for the cross compiler and write a configuration file.)

Hi, I have created softlinks as mentioned in that. Although I couldn't figure out how to create the config file but I can see the cross compiler mappings available. I hope it is fine.

[...]
[09:48:38.851594, ic, 12699] sysname: Linux
[09:48:38.851598, ic, 12699] release: 5.15.0-43-generic
[09:48:38.851601, ic, 12699] version: #46-Ubuntu SMP Tue Jul 12 10:30:17 UTC 2022
[09:48:38.851609, ic, 12699] machine: x86_64
[09:48:38.851620, ic, 12699] arguments parsed: {program: /usr/bin/intercept, arguments: [{--: [make, all, SPD=opteed, DEBUG=1]}, {--force-wrapper: []}, {--library: [/usr/$LIB/bear/libexec.so]}, {--output: [compile_commands.events.json]}, {--verbose: []}, {--wrapper: [/usr/lib/x86_64-linux-gnu/bear/wrapper]}, {--wrapper-dir: [/usr/lib/x86_64-linux-gnu/bear/wrapper.d]}]}
[09:48:38.855907, ic, 12699] session initialized with: wrapper_dir: /usr/lib/x86_64-linux-gnu/bear/wrapper.d
[09:48:38.856002, ic, 12699] session initialized with: mapping: [{ "aarch64-none-linux-gnu-addr2line": "/home/user/Downloads/cross-compiler/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-addr2line" }, { "aarch64-none-linux-gnu-ar": "/home/user/Downloads/cross-compiler/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-ar" }, { "aarch64-none-linux-gnu-as": "/home/user/Downloads/cross-compiler/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-as" }, { "aarch64-none-linux-gnu-c++": "/home/user/Downloads/cross-compiler/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-c++" }, { "aarch64-none-linux-gnu-c++filt": "/home/user/Downloads/cross-compiler/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-c++filt" }, { "aarch64-none-linux-gnu-cpp": "/home/user/Downloads/cross-compiler/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-cpp" }, [...]

I have to say that your error message is very different (socket closed is something to do with networking), but the cross compiler usage is very much alike. Maybe check if the host you are running the compilation has IPv4 address (localhost is fine).

Am not sure what you mean by this, though I agree that the error feels very weird for me too. Wasn't expecting some networking error while using bear.

Though I have a ipv4 localhost address, let me know if I am looking at things wrong.

$ ip addr                                                                                                                                                                         [9:48:42]
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever

@manorit2001
Copy link
Author

Though there are some additional logs in verbose mode which might be of interest. Let me know if that helps you figure out the problem.

[09:48:41.040438, wr, 12727, ppid: 12704] gRPC call requested: supervise::Supervisor::Resolve
[09:48:42.102170, wr, 12727, ppid: 12704] gRPC call [Resolve] finished: false
[09:48:42.102585, wr, 12727, ppid: 12704] failed with: gRPC call failed: Socket closed
make: *** [lib/libfdt/libfdt.mk:20: /home/user/Projects/atf/build/fvp/debug/libfdt/fdt.o] Error 1
[09:48:42.104643, ic, 12699] Process wait request: done. [pid: 12704]
[09:48:42.104706, ic, 12699] Running command. [Exited with 2]
[09:48:42.104728, ic, 12699] Stopping gRPC server.
[09:48:42.105028, ic, 12699] succeeded with: 2
[09:48:42.106004, br, 12698] Process wait request: done. [pid: 12699]
[09:48:42.106057, br, 12698] Running intercept finished. [Exited with 2]

@manorit2001
Copy link
Author

I am on an internal VPN btw, do you think that might affect the working of bear in any way?

@rizsotto
Copy link
Owner

rizsotto commented Aug 5, 2022

VPN should not be an issue. It's about to have an IP address...

Can you test Bear on your machine with a non-cross compiling project? I am curious if that's making the issue or not. (I am testing against the zlib project in the CI job. So, that should go well.)

@rizsotto
Copy link
Owner

Any luck @manorit2001 ?

@manorit2001
Copy link
Author

Ah yes, sorry for the late reply. It seems like it was a VPN issue only am not sure how, as soon as I removed all the proxy variables and tried to connect without VPN it got resolved.

I didn't try the other thing you mentioned as it started working for me without VPN.

@zhijie-zhang
Copy link

zhijie-zhang commented Jan 6, 2023

maybe used https_proxy/http_proxy

@q2333gh
Copy link

q2333gh commented Nov 27, 2023

export https_proxy=
export http_proxy=

do this will temporary disable vpn. and bear works well for me !

for example i use :

make clean && bear -- make qemu

it generate compile_commands.json good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants