Skip to contentSkip to conversation

scripts-decode_stacktracesh-strip-unexpected-cr-from-lines.patch removed from -mm tree

merged mm-nonmm-stable Andrew Morton 1 participant 1 message Dec 29, 2023

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: scripts/decode_stacktrace.sh: strip unexpected CR from lines
has been removed from the -mm tree. Its filename was
scripts-decode_stacktracesh-strip-unexpected-cr-from-lines.patch

This patch was dropped because it was merged into the mm-nonmm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Bjorn Andersson <[email protected]>
Subject: scripts/decode_stacktrace.sh: strip unexpected CR from lines
Date: Mon, 25 Dec 2023 09:40:35 -0800

When the kernel log is acquired over a serial cable it is not uncommon for the log to contain carriage return characters, in addition to the expected line feeds.

When this output is feed into decode_stacktrace.sh, handle_line() fails to strip the trailing ']' off the module name, which results in find_module() not being able to find the referred to kernel module. This is reported to the user as:

WARNING! Modules path isn't set, but is needed to parse this symbol

The solution is to reconfigure the serial port, or to strip the carriage returns from the log, but this isn't obvious from the error reported by the script.

Instead, make decode_stacktrace.sh more user friendly by stripping the trailing carriage return.

---

 scripts/decode_stacktrace.sh |    3 +++
 1 file changed, 3 insertions(+)
scripts/decode_stacktrace.sh renamed from scripts/decode_stacktrace.sh~scripts-decode_stacktracesh-strip-unexpected-cr-from-lines +3 -0
@@ -291,6 +291,9 @@ handle_line() {
 }
 
 while read line; do
+	# Strip unexpected carriage return at end of line
+	line=${line%$'\r'}
+
 	# Let's see if we have an address in the line
 	if [[ $line =~ \[\<([^]]+)\>\] ]] ||
 	   [[ $line =~ [^+\ ]+\+0x[0-9a-f]+/0x[0-9a-f]+ ]]; then

_

Patches currently in -mm which might be from [email protected] are