From: Alice Ryhl <aliceryhl@google.com>
To: Jann Horn <jannh@google.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Arve Hjønnevåg" <arve@android.com>,
"Todd Kjos" <tkjos@android.com>,
"Christian Brauner" <christian@brauner.io>,
"Carlos Llamas" <cmllamas@google.com>,
"kernel list" <linux-kernel@vger.kernel.org>
Subject: Re: rust binder: many pr_warn!() / pr_err!() with missing newlines
Date: Fri, 13 Feb 2026 08:25:03 +0000 [thread overview]
Message-ID: <aY7f3_N3RtNl57QZ@google.com> (raw)
In-Reply-To: <CAG48ez0kv+B_mbHj1fq=k2u1dyCHzr4HNd9HChgidca80ds4mQ@mail.gmail.com>
On Thu, Feb 12, 2026 at 11:30:01PM +0100, Jann Horn wrote:
> Hi!
>
> I've noticed that in many of the rust files under
> drivers/android/binder/, there are pr_warn!() and pr_err!() statements
> that lack the terminating newline, wrongly indicating that the log
> lines are supposed to be followed by continuations:
>
> $ git grep 'pr_.*("' drivers/android/ | grep -v '\\n"'
> drivers/android/binder.c: pr_info_ratelimited("%pV", &vaf);
> drivers/android/binder.c: pr_info_ratelimited("%pV", &vaf);
> drivers/android/binder/allocation.rs:
> pr_warn!("Failed to clear data on free: {:?}", e);
> drivers/android/binder/context.rs:
> pr_err!("Context::register_process called on the wrong context.");
> drivers/android/binder/context.rs:
> pr_err!("Context::deregister_process called on the wrong context.");
> drivers/android/binder/context.rs:
> pr_warn!("BINDER_SET_CONTEXT_MGR already set");
> drivers/android/binder/node.rs: pr_err!("inc_ref_done
> called when no active inc_refs");
> drivers/android/binder/node.rs: pr_err!("Failure:
> refcount underflow!");
> drivers/android/binder/page_range.rs: pr_err!("set_page
> called when there is already a page");
> drivers/android/binder/page_range.rs: pr_debug!("Failed to
> register with vma: invalid vma->vm_mm");
> drivers/android/binder/page_range.rs: pr_debug!("Failed to
> register with vma: size zero");
> drivers/android/binder/page_range.rs: pr_debug!("Failed to
> register with vma: already registered");
> drivers/android/binder/page_range.rs:
> pr_warn!("Error in use_page_slow: {:?}", err);
> drivers/android/binder/page_range.rs: pr_warn!("Page is null!");
> drivers/android/binder/process.rs: pr_warn!("Notification
> added to `delivered_deaths` twice.");
> drivers/android/binder/process.rs:
> pr_err!("get_current_thread was called from the wrong process.");
> drivers/android/binder/process.rs: pr_err!("Cannot
> create two threads with the same id.");
> drivers/android/binder/process.rs:
> pr_err!("Detected mismatch between handle_is_present and by_handle");
> drivers/android/binder/process.rs: pr_warn!("use_range
> failure {:?}", err);
> drivers/android/binder/process.rs:
> pr_err!("outstanding_txns underflow");
> drivers/android/binder/process.rs: pr_err!("Same thread
> registered with `ready_threads` twice.");
> drivers/android/binder/range_alloc/tree.rs:
> pr_warn!("ENOSPC from range_alloc.reserve_new - size: {}", size);
> drivers/android/binder/rust_binder_main.rs: pr_warn!("Loaded
> Rust Binder.");
> drivers/android/binder/thread.rs: pr_warn!("Thread reply
> work is already in use.");
> drivers/android/binder/thread.rs: pr_warn!("Thread return
> work is already in use.");
> drivers/android/binder/thread.rs:
> pr_err!("UserSlice::read_all returned wrong length in
> BINDER_TYPE_FDA");
> drivers/android/binder/thread.rs: pr_warn!("Failed
> copying into alloc: {:?}", err);
> drivers/android/binder/thread.rs:
> pr_warn!("Failed copying ptr into alloc: {:?}", err);
> drivers/android/binder/thread.rs: pr_warn!("Failed
> skipping {} from reader: {:?}", fixup_len, err);
> drivers/android/binder/thread.rs: pr_warn!("Failed
> copying remainder into alloc: {:?}", err);
> drivers/android/binder/thread.rs: pr_warn!("Failed
> to get security ctx for id {}: {:?}", secid, err);
> drivers/android/binder/thread.rs: pr_warn!("Got
> transaction with invalid offset.");
> drivers/android/binder/thread.rs:
> pr_warn!("Error while translating object.");
> drivers/android/binder/thread.rs: pr_warn!("Failure in
> apply_sg: {:?}", err);
> drivers/android/binder/thread.rs: pr_warn!("Failed to
> write security context: {:?}", err);
> drivers/android/binder/thread.rs: pr_warn!("got new
> transaction with bad transaction stack");
> drivers/android/binder/thread.rs: pr_warn!("Transaction
> stack changed during transaction!");
> drivers/android/binder/thread.rs: pr_warn!("Failure
> when writing BR_NOOP at beginning of buffer.");
> drivers/android/binder/thread.rs:
> pr_warn!("Failure in work getter: {:?}", err);
> drivers/android/binder/transaction.rs:
> pr_warn!("Failure in copy_transaction_data: {:?}", err);
> drivers/android/binder/transaction.rs: pr_warn!("Oneway
> transaction should not be in a transaction stack.");
> drivers/android/binder/transaction.rs:
> pr_warn!("Failure in copy_transaction_data: {:?}", err);
> drivers/android/binder/transaction.rs: pr_err!("Failed
> to submit oneway transaction to node.");
>
> My understanding is that in practice, this likely mostly has the
> effect that these lines will be printed with an unintended delay.
Yes, that sounds right.
> I'm not going to send a patch for this, I think the binder maintainers
> probably have a better idea of how/when to fix that in a way that
> won't lead to ugly merge conflicts somewhere.
Thanks for reporting this. I think all that needs to happen is a patch
fixing them, and we backport it whereever is required.
Alice
prev parent reply other threads:[~2026-02-13 8:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-12 22:30 rust binder: many pr_warn!() / pr_err!() with missing newlines Jann Horn
2026-02-13 8:25 ` Alice Ryhl [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aY7f3_N3RtNl57QZ@google.com \
--to=aliceryhl@google.com \
--cc=arve@android.com \
--cc=christian@brauner.io \
--cc=cmllamas@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=jannh@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tkjos@android.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.