Build fails when run with build-wrapper-linux-x86-64 v8.9

Hi,
We are facing build failures when executed build with build-wrapper-linux-x86-64 it fails with below,

terminate called after throwing an instance of 'std::out_of_range'
what():  vector::_M_range_check: __n (which is 7) >= this->size() (which is 7)
build-wrapper: read signature: Connection reset by peer
/var/jenkins/workspace/Sonar/Run_Sonar_DownStream@tmp/durable-ba75c405/script.sh: line 1:    46 Aborted                 (core dumped) build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir sq_build_output ./sonar_build.sh

where as without using the build-wrapper-linux-x86-64 build pass successfully.
Any idea on what is causing these failures ?

Environment:
build-wrapper-linux-x86-64, version 8.9
Build is running in Docker container of CentsOS 7.9.2009

Version of build-wrapper is v6.20

build-wrapper: read signature: Connection reset by peer
Aborted (core dumped)
[root@c0ecdde3a1c8 workspace]#
[root@c0ecdde3a1c8 workspace]# build-wrapper: connect to /tmp/build-wrapper-socket.ErVCC0: Connection refused
build-wrapper: connect to /tmp/build-wrapper-socket.ErVCC0: Connection refused
build-wrapper: connect to /tmp/build-wrapper-socket.ErVCC0: Connection refused
build-wrapper: connect to /tmp/build-wrapper-socket.ErVCC0: Connection refused

This part of the full exception

Hi @rgaduputi,

Can you share the build-wrapper .log file and the entire output of the script with and without build-wrapper? I can send you a private message to share them privately if they contain sensitive information.

Thanks,

Hi @Abbas_Sabra,
Sure. Please send me a private message, I will share the files.

Hi @rgaduputi,

Thanks for the log. It is the first time I see such an issue.

I see that it is failing on the zip stage. Can you try to wrap only the build command only (in your case the make commands) instead of the entire process?
Also, have you tried to run it on another OS?

Thanks,

Hi @Abbas_Sabra ,
The stage is the rpm creation one and not zip.
Also I am wrapping the make commands only (with in make we have the rpm creation logic).
No I have not tried running on different OS, I will try it out.

Thanks.

Hello @rgaduputi,

Can you also try to narrow the scope of what you are wrapping to exclude the rpm creation logic? It might be that the rpm creation logic is doing chroot which makes the sockets inaccessible for build-wrapper.

Thanks,

Hi @Abbas_Sabra ,
Yes, once rpm creation logic is excluded, build is succeeded. Now build only contains compilation.
But now we get build-wrapper-dump.json as empty because of that the sonar scanner fails.

Thanks.