Skip to contentSkip to conversation

binder: Add invalid handle info in user error log

PATCH Superseded Ramji Jiyani 2 participants 3 messages Aug 2, 2021 Android drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 binder: Add invalid handle info in user error log

In case of a fail transaction to the target node; user error log currently only prints the thread and process id. Add handle info for the reference to the target node in user error log to aid debugging.

---
 drivers/android/binder.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/android/binder.c +2 -2
index bcec598b89f2..d9030cb6b1e4 100644
@@ -2547,8 +2547,8 @@ static void binder_transaction(struct binder_proc *proc,
 						ref->node, &target_proc,
 						&return_error);
 			} else {
-				binder_user_error("%d:%d got transaction to invalid handle\n",
-						  proc->pid, thread->pid);
+				binder_user_error("%d:%d got transaction to invalid handle, %u\n",
+						  proc->pid, thread->pid, tr->target.handle);
 				return_error = BR_FAILED_REPLY;
 			}
 			binder_proc_unlock(proc);
Signature · 1 line
2.32.0.554.ge1b32706d8-goog
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Ramji Jiyani' via kernel-team

In case of a fail transaction to the target node; user error log currently

nit: I'd rephrase this to something like "In the case of a failed transaction, only the thread and process id are logged. Add the handle info..."

Quoted 4 lines

only prints the thread and process id. Add handle info for the reference to the target node in user error log to aid debugging.

Quoted 25 lines
---
 drivers/android/binder.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/android/binder.c +2 -3
index bcec598b89f2..d9030cb6b1e4 100644
@@ -2547,8 +2547,8 @@ static void binder_transaction(struct binder_proc *proc,
                                                ref->node, &target_proc,
                                                &return_error);
                        } else {
-                               binder_user_error("%d:%d got transaction to invalid handle\n",
-                                                 proc->pid, thread->pid);
+                               binder_user_error("%d:%d got transaction to invalid handle, %u\n",
+                                                 proc->pid, thread->pid, tr->target.handle);
                                return_error = BR_FAILED_REPLY;
                        }
                        binder_proc_unlock(proc);
--

2.32.0.554.ge1b32706d8-goog

--
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].

#2 lore raw
Quoted 9 lines · Todd Kjos
Quoted 2 lines · Ramji Jiyani' via kernel-team

In case of a fail transaction to the target node; user error log currently

nit: I'd rephrase this to something like "In the case of a failed transaction, only the thread and process id are logged. Add the handle info..."

Thanks for the review. Submitted v2 with the fix.

Quoted 7 lines
Quoted 5 lines

only prints the thread and process id. Add handle info for the reference to the target node in user error log to aid debugging.

Thanks for the Ack.

Quoted 26 lines
Quoted 26 lines
---
 drivers/android/binder.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/android/binder.c +2 -3
index bcec598b89f2..d9030cb6b1e4 100644
@@ -2547,8 +2547,8 @@ static void binder_transaction(struct binder_proc *proc,
                                                ref->node, &target_proc,
                                                &return_error);
                        } else {
-                               binder_user_error("%d:%d got transaction to invalid handle\n",
-                                                 proc->pid, thread->pid);
+                               binder_user_error("%d:%d got transaction to invalid handle, %u\n",
+                                                 proc->pid, thread->pid, tr->target.handle);
                                return_error = BR_FAILED_REPLY;
                        }
                        binder_proc_unlock(proc);
--

2.32.0.554.ge1b32706d8-goog

--
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].