Hi,
I am trying to debug an L4 task that double pagefaults before reaching the main function. How should one use the debugger to run a task so it can be debugged without having to break into the debugger later? The backtrace doesn't seem very useful because it looks like a stack overflow due to infinite recursion.
Here is the loader output:
exec | testtask: Loading exec | testtask: Has no dynamic info exec | testtask: Saved 50936 bytes of symbols exec | testtask: "libloader.s.so" not in library list loader | testtask: Starting sigma0-style application exec | testtask: Packed 37981 bytes of symbols exec | testtask: Packed 60324 bytes of lines loader | testtask,#11: Entry at 00009c7c => 01600000 loader | testtask,#11: Started loader | testtask,#11: Double PF (w) at 0c776bec eip 016290bf (11.00)
Here is the backtrace:
backtrace (thread 11.00, fp=01629068, pc=016290bf): #1 016290bf : capdigits + 0x12 #2 01604a4f : printchar + 0xcf /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:71 #3 01604c56 : LOG_fputs + 0x26 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:148 #4 01604dca : outs + 0x2a /home/derick/DROPS/l4/pkg/log/lib/src/logliblinux.c:22 #5 01604970 : flush + 0x20 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:47 #6 01604a4f : printchar + 0xcf /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:71 #7 01604c56 : LOG_fputs + 0x26 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:148 #8 01604dca : outs + 0x2a /home/derick/DROPS/l4/pkg/log/lib/src/logliblinux.c:22 #9 01604970 : flush + 0x20 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:47 #10 01604a4f : printchar + 0xcf /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:71 #11 01604c56 : LOG_fputs + 0x26 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:148 #12 01604dca : outs + 0x2a /home/derick/DROPS/l4/pkg/log/lib/src/logliblinux.c:22 #13 01604970 : flush + 0x20 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:47 #14 01604a4f : printchar + 0xcf /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:71 #15 01604c56 : LOG_fputs + 0x26 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:148 #16 01604dca : outs + 0x2a /home/derick/DROPS/l4/pkg/log/lib/src/logliblinux.c:22 #17 01604970 : flush + 0x20 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:47 #18 01604a4f : printchar + 0xcf /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:71 #19 01604c56 : LOG_fputs + 0x26 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:148 #20 01604dca : outs + 0x2a /home/derick/DROPS/l4/pkg/log/lib/src/logliblinux.c:22 #21 01604970 : flush + 0x20 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:47 #22 01604a4f : printchar + 0xcf /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:71 #23 01604c56 : LOG_fputs + 0x26 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:148 #24 01604dca : outs + 0x2a /home/derick/DROPS/l4/pkg/log/lib/src/logliblinux.c:22 #25 01604970 : flush + 0x20 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:47 #26 01604a4f : printchar + 0xcf /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:71 #27 01604c56 : LOG_fputs + 0x26 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:148 #28 01604dca : outs + 0x2a /home/derick/DROPS/l4/pkg/log/lib/src/logliblinux.c:22 #29 01604970 : flush + 0x20 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:47 #30 01604a4f : printchar + 0xcf /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:71 #31 01604c56 : LOG_fputs + 0x26 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:148 #32 01604dca : outs + 0x2a /home/derick/DROPS/l4/pkg/log/lib/src/logliblinux.c:22 #33 01604970 : flush + 0x20 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:47 #34 01604a4f : printchar + 0xcf /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:71 #35 01604c56 : LOG_fputs + 0x26 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:148 #36 01604dca : outs + 0x2a /home/derick/DROPS/l4/pkg/log/lib/src/logliblinux.c:22 #37 01604970 : flush + 0x20 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:47 #38 01604a4f : printchar + 0xcf /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:71 #39 01604c56 : LOG_fputs + 0x26 /home/derick/DROPS/l4/pkg/log/lib/src/log_printf.c:148
--kernel-bt-follows-- (don't trust w/o frame pointer!!) #1 f0005950 #2 f0004c7e #3 f0009e01 #4 f0009e01 #5 f00053ee #6 f0009a65 #7 f000b3fa #8 f00049ce #9 f000b767 #10 f00086e3 #11 f0004084 #12 f0006931 #13 f00253a2
Thanks in advance, Derick
On 6/2/05, Derick Swanepoel dswanepoel@gmail.com wrote:
Hi,
I am trying to debug an L4 task that double pagefaults before reaching the main function. How should one use the debugger to run a task so it can be debugged without having to break into the debugger later? The backtrace doesn't seem very useful because it looks like a stack overflow due to infinite recursion.
Nevermind, I was using the l4env_freebsd mode and it causes the program to be linked against libloglinux while I needed liblog.
Derick
Hi Derick,
On Thursday 02 June 2005 10:23, Derick Swanepoel wrote:
I am trying to debug an L4 task that double pagefaults before reaching the main function. How should one use the debugger to run a task so it can be debugged without having to break into the debugger later? The backtrace doesn't seem very useful because it looks like a stack overflow due to infinite recursion.
Why useless? What if it _is_ a recursion? Before continue to search, disassemble the binary and look which function is called from outs() (file log/lib/src/logliblinux.c). Start disassembling around 0x01604db0.
Frank
On 6/2/05, Frank Mehnert fm3@os.inf.tu-dresden.de wrote:
Hi Derick,
On Thursday 02 June 2005 10:23, Derick Swanepoel wrote:
I am trying to debug an L4 task that double pagefaults before reaching the main function. How should one use the debugger to run a task so it can be debugged without having to break into the debugger later? The backtrace doesn't seem very useful because it looks like a stack overflow due to infinite recursion.
Why useless? What if it _is_ a recursion? Before continue to search, disassemble the binary and look which function is called from outs() (file log/lib/src/logliblinux.c). Start disassembling around 0x01604db0.
Frank
I didn't think the backtrace would be much use because the stack would've been corrupted due to the infinite recursion. But since I was linking to the wrong logging library it's not a problem anymore. Thanks for the debugging tip, though.
Derick
l4-hackers@os.inf.tu-dresden.de