Closed kishore-sn closed 2 months ago
@kishore-sn Are you able to add before and after of TRAP output? (Not all, the problem line is enough)
I updated the before and after output. As you can see, there is not much difference in the output format. But the line numbers are now pointing to the exact location of the address and not the start of the function.
@kishore-sn Are you able to add before and after of TRAP output? (Not all, the problem line is enough)
I updated the before and after output. As you can see, there is not much difference in the output format. But the line numbers are now pointing to the exact location of the address and not the start of the function.
Sorry I don't get the point. Before and After do not show the same content so that I don't know what is changed. Could you let me know line number of the example?
In case of the current crash log, the PC points to leave_critical_section.
[ Current location (PC) of assert ]
- symbol addr : 0x0e019fd0
- function name : leave_critical_section
- file : /root/tizenrt/os/kernel/irq/irq_csection.c:555
So, the call stack must show exactly who called leave critical section.
The first entry in the call stack seems to be wrong in both before and after case.
But for the second line in call stack, the before case shows
0x6068cbc8 0xe0293f9 kernel arm_sigdeliver /root/tizenrt/os/arch/arm/src/armv7-a/arm_sigdeliver.c:71
If we check arm_sigdeliver.c Line 71, it is the start of function sigdeliver. This does not help in debugging.
69
70 #ifndef CONFIG_DISABLE_SIGNALS
71 void arm_sigdeliver(void)
72 {
73 struct tcb_s *rtcb = this_task();
74 uint32_t *regs = rtcb->xcp.saved_regs;
But in the after case, we get /root/tizenrt/os/arch/arm/src/armv7-a/arm_sigdeliver.c:108 (discriminator 1)
Line number 108 points just after the call to leave critical section. So this allows us to track the call stack properly.
103
104 do
105 {
106 leave_critical_section(regs[REG_CPSR]);
107 }
108 while (rtcb->irqcount > 0);
109 #endif /* CONFIG_SMP */
This issue is much more evident in other crash logs, where the actual cause of crash might not be the current PC, but some previous function in the call stack.
Another thing that you can notice is the below line in before and after case:
0x6068cc18 0xe191f95 app1 waitpid /root/tizenrt/os/include/sys/wait.h:319
0x6068cc18 0xe191fa2 common binary waitpi /root/tizenrt/os/syscall/proxies/PROXY_waitpid.c:12
The before case is printing the header file which is meaningless for debugging. We need the actual source file of the api. This is shown in after case.
In case of the current crash log, the PC points to leave_critical_section.
[ Current location (PC) of assert ] - symbol addr : 0x0e019fd0 - function name : leave_critical_section - file : /root/tizenrt/os/kernel/irq/irq_csection.c:555
So, the call stack must show exactly who called leave critical section. The first entry in the call stack seems to be wrong in both before and after case. But for the second line in call stack, the before case shows
0x6068cbc8 0xe0293f9 kernel arm_sigdeliver /root/tizenrt/os/arch/arm/src/armv7-a/arm_sigdeliver.c:71
If we check arm_sigdeliver.c Line 71, it is the start of function sigdeliver. This does not help in debugging.
69 70 #ifndef CONFIG_DISABLE_SIGNALS 71 void arm_sigdeliver(void) 72 { 73 struct tcb_s *rtcb = this_task(); 74 uint32_t *regs = rtcb->xcp.saved_regs;
But in the after case, we get
/root/tizenrt/os/arch/arm/src/armv7-a/arm_sigdeliver.c:108 (discriminator 1)
Line number 108 points just after the call to leave critical section. So this allows us to track the call stack properly.103 104 do 105 { 106 leave_critical_section(regs[REG_CPSR]); 107 } 108 while (rtcb->irqcount > 0); 109 #endif /* CONFIG_SMP */
This issue is much more evident in other crash logs, where the actual cause of crash might not be the current PC, but some previous function in the call stack.
Another thing that you can notice is the below line in before and after case:
0x6068cc18 0xe191f95 app1 waitpid /root/tizenrt/os/include/sys/wait.h:319
0x6068cc18 0xe191fa2 common binary waitpi /root/tizenrt/os/syscall/proxies/PROXY_waitpid.c:12
The before case is printing the header file which is meaningless for debugging. We need the actual source file of the api. This is shown in after case.
@kishore-sn Can we add this in the commit description?
@kishore-sn Can we add this in the commit description?
Done.
The trap tool makes use of nm tool to look up the symbols. However the nm tool does not give exact line number for the given address. So, we change the trap tool to use nm only for symbol name and then get the exact line number using the addr2line tool.
Trap output before change:
Trap output after change: