public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* rust binder: many pr_warn!() / pr_err!() with missing newlines
@ 2026-02-12 22:30 Jann Horn
  2026-02-13  8:25 ` Alice Ryhl
  0 siblings, 1 reply; 2+ messages in thread
From: Jann Horn @ 2026-02-12 22:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Arve Hjønnevåg, Todd Kjos,
	Christian Brauner, Carlos Llamas, Alice Ryhl
  Cc: kernel list

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.

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-02-13  8:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox