Skip to contentSkip to conversation

double fault ...

DISCUSSION Gerd Knorr 3 participants 6 messages May 2, 2005

lore
Share & tools
lore

Gerd Knorr

author
#0 lore raw

... happens with panics when compiled with debugging. panic() calls debugger_trap_immediate(), which triggers do_int3, which calls panic(), which recurses until the stack is full => bang!

cheers,

Gerd

Signature · 1 line
#define printk(args...) fprintf(stderr, ## args)
#1 lore raw
Quoted 4 lines · Gerd Knorr

... happens with panics when compiled with debugging. panic() calls debugger_trap_immediate(), which triggers do_int3, which calls panic(), which recurses until the stack is full => bang!

You compile with crash_debug=y? The intention is that do_int3() will execute DEBUGGER_trap_fatal() before panic(), so you should enter the gdb stub rather than infinitely loop. How is that not occurring?

-- Keir

author
#2 lore raw
Quoted 9 lines · Keir Fraser
Quoted 4 lines · Gerd Knorr

... happens with panics when compiled with debugging. panic() calls debugger_trap_immediate(), which triggers do_int3, which calls panic(), which recurses until the stack is full => bang!

You compile with crash_debug=y?

Yes. Mostly to get a xen binary without optimization and with full debug info, so I can easily lookup stuff using

	"objdump -dS xen-syms | less +/<addr>".
Quoted 3 lines

The intention is that do_int3() will execute DEBUGGER_trap_fatal() before panic(), so you should enter the gdb stub rather than infinitely loop. How is that not occurring?

I don't actually have a debugger attached, so DEBUGGER_trap_fatal aka __trap_to_cdb() instantly returns.

Gerd

Signature · 1 line
#define printk(args...) fprintf(stderr, ## args)
#3 lore raw

It shouldn't matter - you can attach the debugger after crash.

-Kip

Quoted 25 lines · Gerd Knorr
Quoted 9 lines · Keir Fraser
Quoted 4 lines · Gerd Knorr

... happens with panics when compiled with debugging. panic() calls debugger_trap_immediate(), which triggers do_int3, which calls panic(), which recurses until the stack is full => bang!

You compile with crash_debug=y?

Yes. Mostly to get a xen binary without optimization and with full debug info, so I can easily lookup stuff using

	"objdump -dS xen-syms | less +/<addr>".
Quoted 3 lines

The intention is that do_int3() will execute DEBUGGER_trap_fatal() before panic(), so you should enter the gdb stub rather than infinitely loop. How is that not occurring?

I don't actually have a debugger attached, so DEBUGGER_trap_fatal aka __trap_to_cdb() instantly returns.

Gerd

Signature · 3 lines
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
#4 lore raw
In reply to Gerd Knorr
Quoted 6 lines
Quoted 2 lines

You compile with crash_debug=y?

Yes. Mostly to get a xen binary without optimization and with full debug info, so I can easily lookup stuff using

	"objdump -dS xen-syms | less +/<addr>".

Probably 'debug=y' should also cause -g compilation. I'll add that in.

I presume you do 'optimize=n' to turn off things like -O3?

Quoted 6 lines
Quoted 3 lines

The intention is that do_int3() will execute DEBUGGER_trap_fatal() before panic(), so you should enter the gdb stub rather than infinitely loop. How is that not occurring?

I don't actually have a debugger attached, so DEBUGGER_trap_fatal aka __trap_to_cdb() instantly returns.

I see. I'll check in a fix.

Thanks!

-- Keir

author
#5 lore raw
Quoted 8 lines · Keir Fraser
Quoted 6 lines
Quoted 2 lines

You compile with crash_debug=y?

Yes. Mostly to get a xen binary without optimization and with full debug info, so I can easily lookup stuff using

	"objdump -dS xen-syms | less +/<addr>".

Probably 'debug=y' should also cause -g compilation. I'll add that in.

Thanks.

Quoted 1 line

I presume you do 'optimize=n' to turn off things like -O3?

Yes, "make debug=y crash_debug=y optimize=n" is the command line.

Gerd

Signature · 1 line
#define printk(args...) fprintf(stderr, ## args)