Skip to contentSkip to conversation

i386: Do backtrace fallback too

PATCH Dave Jones 3 participants 7 messages Jul 29, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Dave Jones

author
#1 lore raw
Quoted 11 lines · Linux Kernel

commit c97d20a6c51067a38f53680d9609b4cf2867d077
tree 59867ac01d1b752ba7e520e33f9f84cade6d024e
parent b783fd925cdd56d24d164e5bdcb072f2a67aedf4
author Andi Kleen <[email protected]> Fri, 28 Jul 2006 14:44:57 +0200 committer Linus Torvalds <[email protected]> Sat, 29 Jul 2006 09:28:00 -0700

[PATCH] i386: Do backtrace fallback too

Similar patch to earlier x86-64 patch. When the dwarf2 unwinder fails dump the left over stack with the old unwinder.

Quoted 7 lines

Also some clarifications in the headers.

 arch/i386/kernel/traps.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

Hmm, this breaks the build for me..

arch/i386/kernel/traps.c: In function 'show_trace_log_lvl':
arch/i386/kernel/traps.c:195: error: invalid type argument of '->' arch/i386/kernel/traps.c:198: error: invalid type argument of '->' arch/i386/kernel/traps.c:199: error: invalid type argument of '->' make[1]: *** [arch/i386/kernel/traps.o] Error 1

(The line numbers are different to mainline due to some unrelated patches, they point to the UNW_PC/UNW_SP usages),

Also, shouldn't this..

	print_symbol("DWARF2 unwinder stuck at %s\n",
		UNW_PC(info.regs));

be using %p ?

Dave

Signature · 1 line
http://www.codemonkey.org.uk
#2 lore raw
Quoted 2 lines · Dave Jones
Quoted 1 line · Linux Kernel

commit c97d20a6c51067a38f53680d9609b4cf2867d077

[...]

Quoted 12 lines

Hmm, this breaks the build for me..

arch/i386/kernel/traps.c: In function 'show_trace_log_lvl':
arch/i386/kernel/traps.c:195: error: invalid type argument of '->' arch/i386/kernel/traps.c:198: error: invalid type argument of '->' arch/i386/kernel/traps.c:199: error: invalid type argument of '->' make[1]: *** [arch/i386/kernel/traps.o] Error 1

(The line numbers are different to mainline due to some unrelated patches, they point to the UNW_PC/UNW_SP usages),

Quoted 6 lines

Also, shouldn't this..

	print_symbol("DWARF2 unwinder stuck at %s\n",
		UNW_PC(info.regs));

be using %p ?

It should be UNWP_PC(&info), just like in the functions above. Here's a patch:

arch/i386/kernel/traps.c +3 -3
index 3facc8f..017c015 100644
@@ -190,11 +190,11 @@ static void show_trace_log_lvl(struct ta
 		if (unw_ret > 0 && !arch_unw_user_mode(&info)) {
 #ifdef CONFIG_STACK_UNWIND
 			print_symbol("DWARF2 unwinder stuck at %s\n",
-				     UNW_PC(info.regs));
+				     UNW_PC(&info));
 			if (call_trace == 1) {
 				printk("Leftover inexact backtrace:\n");
-				if (UNW_SP(info.regs))
-					stack = (void *)UNW_SP(info.regs);
+				if (UNW_SP(&info))
+					stack = (void *)UNW_SP(&info);
 			} else if (call_trace > 1)
 				return;
 			else

Erik

Signature · 2 lines
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70 370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The Netherlands
#3 lore raw
In reply to Dave Jones
Quoted 15 lines · Dave Jones
Quoted 14 lines · Linux Kernel

commit c97d20a6c51067a38f53680d9609b4cf2867d077
tree 59867ac01d1b752ba7e520e33f9f84cade6d024e
parent b783fd925cdd56d24d164e5bdcb072f2a67aedf4
author Andi Kleen <[email protected]> Fri, 28 Jul 2006 14:44:57 +0200 committer Linus Torvalds <[email protected]> Sat, 29 Jul 2006 09:28:00 -0700

[PATCH] i386: Do backtrace fallback too

Similar patch to earlier x86-64 patch. When the dwarf2 unwinder fails dump the left over stack with the old unwinder.

Also some clarifications in the headers.

Quoted 7 lines
Quoted 5 lines
 arch/i386/kernel/traps.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

Hmm, this breaks the build for me..

Hmm, it definitely builds here. Ah do you have UNWIND_INFO disabled?

Quoted 4 lines
	print_symbol("DWARF2 unwinder stuck at %s\n",
		UNW_PC(info.regs));

be using %p ?

Yes good catch.

-Andi

author
#4 lore raw
Quoted 7 lines · Andi Kleen
Quoted 4 lines
Quoted 2 lines
 arch/i386/kernel/traps.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

Hmm, this breaks the build for me..

Hmm, it definitely builds here. Ah do you have UNWIND_INFO disabled?

That was with it enabled iirc, I'll double check and do another build later (though you may want to look at Erik Mouw's reply)

Quoted 6 lines
Quoted 4 lines
	print_symbol("DWARF2 unwinder stuck at %s\n",
		UNW_PC(info.regs));

be using %p ?

Yes good catch.

The x86-64 equivalent also has an instance of the same bug.

Dave

Signature · 1 line
http://www.codemonkey.org.uk
#5 lore raw
Quoted 11 lines · Dave Jones
Quoted 7 lines · Andi Kleen
Quoted 4 lines
Quoted 2 lines
 arch/i386/kernel/traps.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

Hmm, this breaks the build for me..

Hmm, it definitely builds here. Ah do you have UNWIND_INFO disabled?

That was with it enabled iirc, I'll double check and do another build later (though you may want to look at Erik Mouw's reply)

Ok I fixed it now. Patch with some other patches will come soon.

-Andi

#6 lore raw
In reply to Dave Jones
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
	print_symbol("DWARF2 unwinder stuck at %s\n",
		UNW_PC(info.regs));

be using %p ?

Yes good catch.

The x86-64 equivalent also has an instance of the same bug.

Actually on double checking the %s is correct because it's print_symbol

-Andi

author
#7 lore raw
Quoted 11 lines · Andi Kleen
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines
	print_symbol("DWARF2 unwinder stuck at %s\n",
		UNW_PC(info.regs));

be using %p ?

Yes good catch.

The x86-64 equivalent also has an instance of the same bug.

Actually on double checking the %s is correct because it's print_symbol

Ah, of course. Somehow I missed that on two separate readings of the code.

Dave

Signature · 1 line
http://www.codemonkey.org.uk