Hi

On Mon, Sep 7, 2026 at 4:03 PM Michael S. Tsirkin <[email protected]> wrote:
>
> does not look like this patch skips any tests?
>

true, I will update the commit title

> On Sun, Sep 06, 2026 at 12:53:34PM +0400, Marc-André Lureau wrote:
> > Running vhost-user-bridge built with ASAN with stdbuf dies:
> > ==2431898==ASan runtime does not come first in initial library list; you
> > should either link runtime to your application or manually preload it
> > with LD_PRELOAD.
>
> so it dies but why? judging by below because of stdbuf?
>
> pls describe the fix not just the problem.

Running vhost-user-bridge built with ASAN with stdbuf dies:
==2431898==ASan runtime does not come first in initial library

The fix skip using stdbuf when the binary is built with ASAN, since it
seems optional anyway

>
> > Signed-off-by: Marc-André Lureau <[email protected]>
> > ---
> >  tests/functional/x86_64/test_vhost_user_bridge.py | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> >
> > diff --git a/tests/functional/x86_64/test_vhost_user_bridge.py 
> > b/tests/functional/x86_64/test_vhost_user_bridge.py
> > index c36c62542053..5fedf61c5e72 100755
> > --- a/tests/functional/x86_64/test_vhost_user_bridge.py
> > +++ b/tests/functional/x86_64/test_vhost_user_bridge.py
> > @@ -73,12 +73,25 @@ def configure_vm(self, ud_socket_path, lport, rport, 
> > hostfwd_port, tftpdir):
> >              "-netdev",   "hubport,id=hub1,hubid=0,netdev=user0"
> >          )
> >
> > +    @staticmethod
> > +    def _is_asan_linked(binary_path):
> > +        try:
> > +            output = subprocess.check_output(
> > +                ["ldd", binary_path], stderr=subprocess.DEVNULL, text=True)
> > +            return "libasan" in output
>
>
> this is quite a hack

yeah

>
> > +        except (subprocess.CalledProcessError, FileNotFoundError):
> > +            return False
> > +
> >      def assemble_vubr_args(self, vubr_path, ud_socket_path, lport, rport):
> >          vubr_args = []
> >
> >          if (stdbuf_path := which("stdbuf")) is None:
> >              self.log.info("Could not find stdbuf: vhost-user-bridge "
> >                            "log lines may appear out of order")
> > +        elif self._is_asan_linked(vubr_path):
> > +            self.log.info("vhost-user-bridge is ASan-linked: skipping "
> > +                          "stdbuf to avoid LD_PRELOAD conflict, "
> > +                          "log lines may appear out of order")
> >          else:
> >              vubr_args += [stdbuf_path, "-o0", "-e0"]
> >
>
>
> maybe just avoid stdbuf completely.
> i don't remember why we use it, but it looks like merely to
> disable buffering for stdout?
>
> If so:
>
> setvbuf(stdout, NULL, _IONBF, 0);
>
> will do just that with no asan issues.
>

That requires modifying vhost-user-bridge, not sure that's what we want.

thanks

Reply via email to