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

zbus 4.2.0 breaks server-side handshake on FreeBSD #756

Closed
jbeich opened this issue May 1, 2024 · 6 comments · Fixed by #757
Closed

zbus 4.2.0 breaks server-side handshake on FreeBSD #756

jbeich opened this issue May 1, 2024 · 6 comments · Fixed by #757
Labels
bug Something isn't working freebsd FreeBSD and closely related OSs

Comments

@jbeich
Copy link

jbeich commented May 1, 2024

Regressed by edc79a3. Found via dbus2/busd@153fe2b7e0a9.

$ busd &
$ export DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/busd-session
$ basuctl --user
<27>(../src/busctl/busctl.c:154) Failed to list names: Connection reset by peer
$ dbus-send --print-reply --session --type=method_call --dest=org.freedesktop.DBus / org.freedesktop.DBus.Peer.Ping
Failed to open connection to "session" message bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
@zeenix
Copy link
Contributor

zeenix commented May 1, 2024

Thanks so much! I'll have a look soon but I'll need your help to test the fix. I need help to keep FreeBSD working in general.

Can you please check if bus-impl tests in the zbus repo are passing on FreeBSD? Instructions [here] (https://toot.cat/@zeenix/112331722599317038).

@jbeich
Copy link
Author

jbeich commented May 1, 2024

Can you please check if bus-impl tests in the zbus repo are passing on FreeBSD?

A lot fail after zbus 4.1.2 -> 4.2.0 update:

 $ cargo test --jobs=1 --features bus-impl
[...] 
-running 42 tests
+running 43 tests
 test address::tests::connect_nonce_tcp ... ok
 test address::tests::connect_tcp ... ok
 test address::tests::parse_dbus_addresses ... ok
 test address::tests::stringify_dbus_addresses ... ok
-test blocking::connection::tests::unix_p2p ... ok
+test blocking::connection::tests::unix_p2p ... FAILED
 test blocking::proxy::tests::signal ... ok
-test connection::handshake::tests::anonymous_handshake ... ok
-test connection::handshake::tests::handshake ... ok
-test connection::handshake::tests::missing_external_data ... ok
-test connection::handshake::tests::pipelined_handshake ... ok
-test connection::handshake::tests::separate_anonymous_data ... ok
-test connection::handshake::tests::separate_external_data ... ok
+test connection::handshake::tests::anonymous_handshake ... FAILED
+test connection::handshake::tests::handshake ... FAILED
+test connection::handshake::tests::missing_external_data ... FAILED
+test connection::handshake::tests::pipelined_handshake ... FAILED
+test connection::handshake::tests::separate_anonymous_data ... FAILED
+test connection::handshake::tests::separate_external_data ... FAILED
+test connection::p2p_tests::channel_pair ... ok
 test connection::p2p_tests::tcp_p2p ... FAILED
-test connection::p2p_tests::unix_p2p ... ok
-test connection::p2p_tests::unix_p2p_cookie_auth ... ok
+test connection::p2p_tests::unix_p2p ... FAILED
+test connection::p2p_tests::unix_p2p_cookie_auth ... FAILED
 test connection::tests::disconnect_on_drop ... ok
 test fdo::tests::error_from_zerror ... ok
 test fdo::tests::no_object_manager_signals_before_hello ... ok
 test fdo::tests::signal ... ok
 test guid::tests::generate ... ok
 test message::builder::tests::test_raw ... ok
 test message::fields::tests::test ... ok
 test message::header::tests::header ... ok
 test message::tests::test ... ok
 test proxy::builder::tests::builder ... ok
 test proxy::tests::signal ... ok
 test proxy::tests::signal_stream_deadlock ... ok
 test tests::basic_connection ... ok
 test tests::basic_connection_async ... ok
 test tests::fdpass_systemd ... FAILED
 test tests::freedesktop_api ... ok
 test tests::freedesktop_api_async ... ok
 test tests::issue104 ... ok
 test tests::issue173 ... ok
 test tests::issue_121 ... ignored
 test tests::issue_122 ... ok
 test tests::issue_260 ... ok
 test tests::issue_466 ... ignored
 test tests::issue_68 ... ok
 test tests::issue_81 ... ignored
 test tests::msg ... ok
 test tests::uncached_property ... ok
 
 failures:
 
+---- connection::handshake::tests::anonymous_handshake stdout ----
+thread '<unnamed>' panicked at zbus/src/connection/handshake/mod.rs:293:50:
+called `Result::unwrap()` on an `Err` value: Handshake("Unknown command: \0AUTH ANONYMOUS abcd\r\n")
+note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
+thread 'connection::handshake::tests::anonymous_handshake' panicked at zbus/src/connection/handshake/mod.rs:278:5:
+explicit panic
+
+---- connection::handshake::tests::handshake stdout ----
+thread '<unnamed>' panicked at zbus/src/connection/handshake/mod.rs:193:49:
+called `Result::unwrap()` on an `Err` value: Handshake("Unknown command: \0AUTH EXTERNAL 31303031\r\n")
+thread 'connection::handshake::tests::handshake' panicked at zbus/src/connection/handshake/mod.rs:173:5:
+explicit panic
+
+---- blocking::connection::tests::unix_p2p stdout ----
+thread '<unnamed>' panicked at zbus/src/blocking/connection/mod.rs:307:18:
+called `Result::unwrap()` on an `Err` value: Handshake("Unknown command: \0AUTH EXTERNAL 31303031\r\n")
+thread '<unnamed>' panicked at zbus/src/blocking/connection/mod.rs:317:56:
+called `Result::unwrap()` on an `Err` value: InputOutput(Custom { kind: BrokenPipe, error: "failed to read from socket" })
+thread 'blocking::connection::tests::unix_p2p' panicked at zbus/src/blocking/connection/mod.rs:293:5:
+explicit panic
+
+---- connection::handshake::tests::pipelined_handshake stdout ----
+thread '<unnamed>' panicked at zbus/src/connection/handshake/mod.rs:225:63:
+called `Result::unwrap()` on an `Err` value: Handshake("Unknown command: \0AUTH EXTERNAL 31303031\r\n")
+thread 'connection::handshake::tests::pipelined_handshake' panicked at zbus/src/connection/handshake/mod.rs:201:5:
+explicit panic
+
+---- connection::handshake::tests::missing_external_data stdout ----
+thread '<unnamed>' panicked at zbus/src/connection/handshake/mod.rs:274:50:
+called `Result::unwrap()` on an `Err` value: Handshake("Unknown command: \0AUTH EXTERNAL\r\n")
+thread 'connection::handshake::tests::missing_external_data' panicked at zbus/src/connection/handshake/mod.rs:259:5:
+explicit panic
+
+---- connection::handshake::tests::separate_anonymous_data stdout ----
+thread '<unnamed>' panicked at zbus/src/connection/handshake/mod.rs:313:50:
+called `Result::unwrap()` on an `Err` value: Handshake("Unknown command: \0AUTH ANONYMOUS\r\n")
+thread 'connection::handshake::tests::separate_anonymous_data' panicked at zbus/src/connection/handshake/mod.rs:297:5:
+explicit panic
+
+---- connection::handshake::tests::separate_external_data stdout ----
+thread '<unnamed>' panicked at zbus/src/connection/handshake/mod.rs:255:50:
+called `Result::unwrap()` on an `Err` value: Handshake("Unknown command: \0AUTH EXTERNAL\r\n")
+thread 'connection::handshake::tests::separate_external_data' panicked at zbus/src/connection/handshake/mod.rs:231:5:
+explicit panic
+
 ---- connection::p2p_tests::tcp_p2p stdout ----
-thread '<unnamed>' panicked at zbus/src/connection/mod.rs:1495:48:
+thread '<unnamed>' panicked at zbus/src/connection/mod.rs:1450:48:
 called `Result::unwrap()` on an `Err` value: Handshake("Could not send zero byte with credentials")
-note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
-thread 'connection::p2p_tests::tcp_p2p' panicked at zbus/src/connection/mod.rs:1493:5:
+thread 'connection::p2p_tests::tcp_p2p' panicked at zbus/src/connection/mod.rs:1448:5:
 explicit panic
 
+---- connection::p2p_tests::unix_p2p stdout ----
+thread '<unnamed>' panicked at zbus/src/connection/mod.rs:1504:49:
+called `Result::unwrap()` on an `Err` value: Handshake("Unknown command: \0AUTH EXTERNAL 31303031\r\n")
+thread 'connection::p2p_tests::unix_p2p' panicked at zbus/src/connection/mod.rs:1502:5:
+explicit panic
+
+---- connection::p2p_tests::unix_p2p_cookie_auth stdout ----
+thread '<unnamed>' panicked at zbus/src/connection/mod.rs:1635:14:
+called `Result::unwrap()` on an `Err` value: Handshake("Unknown command: \0AUTH EXTERNAL 31303031\r\n")
+thread 'connection::p2p_tests::unix_p2p_cookie_auth' panicked at zbus/src/connection/mod.rs:1597:5:
+explicit panic
+
 ---- tests::fdpass_systemd stdout ----
-thread '<unnamed>' panicked at zbus/src/lib.rs:304:57:
+thread '<unnamed>' panicked at zbus/src/lib.rs:294:57:
 called `Result::unwrap()` on an `Err` value: InputOutput(Os { code: 2, kind: NotFound, message: "No such file or directory" })
-thread 'tests::fdpass_systemd' panicked at zbus/src/lib.rs:299:5:
+thread 'tests::fdpass_systemd' panicked at zbus/src/lib.rs:289:5:
 explicit panic
 
 
 failures:
+    blocking::connection::tests::unix_p2p
+    connection::handshake::tests::anonymous_handshake
+    connection::handshake::tests::handshake
+    connection::handshake::tests::missing_external_data
+    connection::handshake::tests::pipelined_handshake
+    connection::handshake::tests::separate_anonymous_data
+    connection::handshake::tests::separate_external_data
     connection::p2p_tests::tcp_p2p
+    connection::p2p_tests::unix_p2p
+    connection::p2p_tests::unix_p2p_cookie_auth
     tests::fdpass_systemd
 
-test result: FAILED. 37 passed; 2 failed; 3 ignored; 0 measured; 0 filtered out; finished in 0.12s
+test result: FAILED. 29 passed; 11 failed; 3 ignored; 0 measured; 0 filtered out; finished in 0.12s
 
 error: test failed, to rerun pass `-p zbus --lib`

@zeenix
Copy link
Contributor

zeenix commented May 1, 2024

Thanks @jbeich! I think i know the issue and it should be trivial to fix. I'll do that after I'm back at my computer in the evening.

@zeenix zeenix transferred this issue from dbus2/busd May 1, 2024
@zeenix zeenix changed the title 0.3.0 fails to connect to the daemon on FreeBSD zbus 4.2.0 breaks server-side handshake on FreeBSD May 1, 2024
@zeenix zeenix added freebsd FreeBSD and closely related OSs bug Something isn't working labels May 1, 2024
zeenix added a commit to zeenix/zbus that referenced this issue May 1, 2024
@zeenix
Copy link
Contributor

zeenix commented May 1, 2024

@jbeich Could you check for me if #757 really fixes the zbus tests on FreeBSD? You can disabled the systemd test by appending -- --skip fdpass_systemd to the cargo test command. Once you've verified, I can merge and roll out the release.

@jbeich
Copy link
Author

jbeich commented May 1, 2024

I confirm, after applying the fix tests pass like in zbus-4.1.2:

$ cargo test --features bus-impl -- --skip fdpass_systemd
[...]
---- connection::p2p_tests::tcp_p2p stdout ----
thread '<unnamed>' panicked at zbus/src/connection/mod.rs:1450:48:
called `Result::unwrap()` on an `Err` value: Handshake("Could not send zero byte with credentials")
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'connection::p2p_tests::tcp_p2p' panicked at zbus/src/connection/mod.rs:1448:5:
explicit panic


failures:
    connection::p2p_tests::tcp_p2p

test result: FAILED. 38 passed; 1 failed; 3 ignored; 0 measured; 1 filtered out; finished in 0.12s

error: test failed, to rerun pass `-p zbus --lib`

@zeenix
Copy link
Contributor

zeenix commented May 1, 2024

I confirm, after applying the fix tests pass like in zbus-4.1.2

Great, thanks!

thread 'connection::p2p_tests::tcp_p2p' panicked at zbus/src/connection/mod.rs:1448:5:

Oh, I didn't realize that was broken on FreeBSD. I'll try to fix that and hopefully I can ask you again to test. :)

zeenix added a commit to zeenix/zbus that referenced this issue May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working freebsd FreeBSD and closely related OSs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants