vhost-user-bridge: Fix stdbuf and ASAN interaction
cover vhost-user-bridge: Fix stdbuf and ASAN interaction
From: Yodel Eldar <[email protected]>
Hi,
As reported by Marc-André in (1), the functional test of vhost-user-bridge (vubr) encounters a runtime error when vubr is built with ASAN, because the "ASan runtime does not come first in initial library list."
Upon Michael's suggestion, this series converts the DPRINT debug output macro in vubr to use stderr instead of stdout for output. With that change, the functional test no longer needs to invoke stdbuf, so it is removed.
Thanks,
Yodel
(1) https://lore.kernel.org/qemu-devel/[email protected]/
Yodel Eldar (2):
contrib/vhost-user-bridge: Use stderr for debug output tests/functional/x86_64/test_vhost_user_bridge: Eliminate stdbuf usage
contrib/vhost-user-bridge/vhost-user-bridge.c | 2 +- tests/functional/x86_64/test_vhost_user_bridge.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-)
Signature · 1 line
2.55.0
PATCH 1/2 contrib/vhost-user-bridge: Use stderr for debug output
From: Yodel Eldar <[email protected]>
Since vhost-user-bridge is solely used for testing, and logging to stderr ensures proper interleaving of debug output in automated testing, modify the DPRINT macro to write to stderr instead of stdout.
Message ID of relevant thread:
<[email protected]>
--- contrib/vhost-user-bridge/vhost-user-bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/vhost-user-bridge/vhost-user-bridge.c +1 -1
@@ -41,7 +41,7 @@#define DPRINT (...) \ do { \ if (VHOST_USER_BRIDGE_DEBUG) { \ - printf(__VA_ARGS__); \ + fprintf(stderr, __VA_ARGS__); \ } \ } while (0)
Signature · 1 line
2.55.0
PATCH 2/2 tests/functional/x86_64/test_vhost_user_bridge: Eliminate stdbuf usage
In reply to Yodel EldarFrom: Yodel Eldar <[email protected]>
Usage of stdbuf triggers a runtime error when vhost-user-bridge is built with ASAN. Now that vhost-user-bridge writes debug output to stderr, stdbuf is obviated; remove its invocation.
Message ID of relevant thread:
<[email protected]>
--- tests/functional/x86_64/test_vhost_user_bridge.py | 6 ------ 1 file changed, 6 deletions(-)
tests/functional/x86_64/test_vhost_user_bridge.py +0 -6
@@ -76,12 +76,6 @@ def configure_vm(self, ud_socket_path, lport, rport, hostfwd_port, tftpdir): 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") - else: - vubr_args += [stdbuf_path, "-o0", "-e0"] - vubr_args += [vubr_path, "-u", f"{ud_socket_path}", "-l", f"127.0.0.1:{lport}", "-r", f"127.0.0.1:{rport}"]
Signature · 1 line
2.55.0
Quoted 20 lines · Yodel Eldar
From: Yodel Eldar <[email protected]>
Hi,
As reported by Marc-André in (1), the functional test of vhost-user-bridge (vubr) encounters a runtime error when vubr is built with ASAN, because the "ASan runtime does not come first in initial library list."
Upon Michael's suggestion, this series converts the DPRINT debug output macro in vubr to use stderr instead of stdout for output. With that change, the functional test no longer needs to invoke stdbuf, so it is removed.
Thanks,
Yodel
Quoted 8 lines
Yodel Eldar (2):
contrib/vhost-user-bridge: Use stderr for debug output tests/functional/x86_64/test_vhost_user_bridge: Eliminate stdbuf usagecontrib/vhost-user-bridge/vhost-user-bridge.c | 2 +- tests/functional/x86_64/test_vhost_user_bridge.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-)
thanks
Quoted 4 lines
--
2.55.0
Hi,
Quoted 19 lines · Yodel Eldar
From: Yodel Eldar <[email protected]>
Hi,
As reported by Marc-André in (1), the functional test of vhost-user-bridge (vubr) encounters a runtime error when vubr is built with ASAN, because the "ASan runtime does not come first in initial library list."
Upon Michael's suggestion, this series converts the DPRINT debug output macro in vubr to use stderr instead of stdout for output. With that change, the functional test no longer needs to invoke stdbuf, so it is removed.
Thanks,
Yodel
Quoted 8 lines
Yodel Eldar (2):
contrib/vhost-user-bridge: Use stderr for debug output tests/functional/x86_64/test_vhost_user_bridge: Eliminate stdbuf usagecontrib/vhost-user-bridge/vhost-user-bridge.c | 2 +- tests/functional/x86_64/test_vhost_user_bridge.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-)
Ping?
Note: Series is fully reviewed (thanks Marc-André).
Link:
https://lore.kernel.org/qemu-devel/[email protected]/
Thanks,
Yodel
Quoted 33 lines · Yodel Eldar
Hi,
Quoted 19 lines · Yodel Eldar
From: Yodel Eldar <[email protected]>
Hi,
As reported by Marc-André in (1), the functional test of vhost-user-bridge (vubr) encounters a runtime error when vubr is built with ASAN, because the "ASan runtime does not come first in initial library list."
Upon Michael's suggestion, this series converts the DPRINT debug output macro in vubr to use stderr instead of stdout for output. With that change, the functional test no longer needs to invoke stdbuf, so it is removed.
Thanks,
YodelQuoted 8 lines
Yodel Eldar (2):
contrib/vhost-user-bridge: Use stderr for debug output tests/functional/x86_64/test_vhost_user_bridge: Eliminate stdbuf usagecontrib/vhost-user-bridge/vhost-user-bridge.c | 2 +- tests/functional/x86_64/test_vhost_user_bridge.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-)Ping?
Quoted 7 lines
Note: Series is fully reviewed (thanks Marc-André).
Link:
https://lore.kernel.org/qemu-devel/[email protected]/Thanks,
Yodel
Hi!
Review delayed due to lots of holidays. I'll get back on the treadmill beginning of Oct. Sorry.