SIGSEGV information on SPARC64
Hello everyone,
I'm working on a project that needs to deal with SIGSEGV on SPARC64. While I could find the faultive address in siginfo_t, it seems there is no way to find the access type(read or write) in it. I tracked the kernel source and found that ther kernel retrieves this information (fault_code) from "flags" field of thread_info, which is stored in register g6. However, I'm not sure if this information has been copied to user space, or sigcontext? I couldn't find any clue when tracking the delivery of signal and the setup of frames. If it is copied, how can I find it so I can use it in my signal handler?
I'm new to Linux kernel on SPARC and have spent a lot of time on this problem. I hope someone could help me here.
Thanks a lot!
Jiaqi
From: "jiaqi zhang" <[email protected]>
Date: Tue, 7 Aug 2007 10:41:18 +1200
Quoted 2 lines
While I could find the faultive address in
siginfo_t, it seems there is no way to find the access type(read or write) in it.
Disassemble the instruction and see if it is a load or a store.
Even if the information is added to siginfo_t, you'll need to make your code work on 10+ years of existing kernels.
Do you mean retrieving the instruction from tpc in sigcontext? Thanks a lot. I'll try it.
Quoted 11 lines · David Miller
From: "jiaqi zhang" <[email protected]>
Date: Tue, 7 Aug 2007 10:41:18 +1200Quoted 2 lines
While I could find the faultive address in
siginfo_t, it seems there is no way to find the access type(read or write) in it.Disassemble the instruction and see if it is a load or a store.
Even if the information is added to
siginfo_t, you'll need to make your code work on 10+ years of existing kernels.
From: "jiaqi zhang" <[email protected]>
Date: Tue, 7 Aug 2007 13:34:22 +1200
Quoted 1 line
Do you mean retrieving the instruction from tpc in sigcontext?
Yep.