This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Segmentation Fault: Task died at uprobe probepoint


On Wed, Jun 16, 2010 at 6:53 AM, Frank Ch. Eigler <fche@redhat.com> wrote:
> Gaurav Dhiman <dimanuec@gmail.com> writes:
>
>> [...]
>> I am using kernel 2.6.29, which has the corresponding utrace patch.
>> Can it be the reason that the older version is not compatible with the
>> latest version of systemtap?
>
> It should work. ?I'm surprised that an elfutils version change
> produced anything visibly different. ?Perhaps you could try a fresh
> copy of 0.147 (and build systemtap with --with-elfutils=PATH)?
>
>> Another thing that I forgot to mention in my previous emails is that
>> I am running this kernel and systemtap inside a Xen DomU. Does that
>> make a difference?
>
> We have had some problems in the long-ago past with xen not emulating
> breakpoints inside the guests quite right. ?Would you be in a position
> to try kvm and/or hardware?
>

Well, so I gave the whole thing a shot with KVM on the same machine.
This time I ran with Linux kernel 2.6.34 (with utrace patch applied).
I used systemtap with elfutils 0.147. And it worked (btw the 0.147
version did not work on the Xen DomU kernel)!!

So I believe it might be either a Xen related issue or might have
something to do with the fact that I am using Linux 2.6.34 now. I
might verify the latter by running 2.6.29 inside KVM. For reasons
specific to our setup, we cannot go beyond 2.6.29 for the Xen DomU.

I have also observed, that around 3 hunks of the utrace patch always
fail in tracehook.h. I typically apply them manually in the functions
they are supposed to go into. Is the patch not actively updated, or
these changes are outdated? I have appended my tracehook.h.rej below.

*************** static inline __must_check int tracehook
*** 134,139 ****
  */
 static inline void tracehook_report_syscall_exit(struct pt_regs
*regs, int step)
 {
       if (step && (task_ptrace(current) & PT_PTRACED)) {
               siginfo_t info;
               user_single_step_siginfo(current, regs, &info);
--- 140,148 ----
  */
 static inline void tracehook_report_syscall_exit(struct pt_regs
*regs, int step)
 {
+       if (task_utrace_flags(current) & UTRACE_EVENT(SYSCALL_EXIT))
+               utrace_report_syscall_exit(regs);
+
       if (step && (task_ptrace(current) & PT_PTRACED)) {
               siginfo_t info;
               user_single_step_siginfo(current, regs, &info);
*************** static inline void tracehook_signal_hand
*** 386,391 ****
                                           const struct k_sigaction *ka,
                                           struct pt_regs *regs, int stepping)
 {
       if (stepping && (task_ptrace(current) & PT_PTRACED))
               ptrace_notify(SIGTRAP);
 }
--- 434,441 ----
                                           const struct k_sigaction *ka,
                                           struct pt_regs *regs, int stepping)
 {
+       if (task_utrace_flags(current))
+               utrace_signal_handler(current, stepping);
       if (stepping && (task_ptrace(current) & PT_PTRACED))
               ptrace_notify(SIGTRAP);
 }
*************** static inline int tracehook_get_signal(s
*** 492,497 ****
  */
 static inline int tracehook_notify_jctl(int notify, int why)
 {
       return notify ?: task_ptrace(current) ? why : 0;
 }

--- 551,558 ----
  */
 static inline int tracehook_notify_jctl(int notify, int why)
 {
+       if (task_utrace_flags(current) & UTRACE_EVENT(JCTL))
+               utrace_report_jctl(notify, why);
       return notify ?: task_ptrace(current) ? why : 0;
 }

Thanks,
-Gaurav


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]