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]

[Bug uprobes/15981] inode-uprobes breaking userspace app


https://sourceware.org/bugzilla/show_bug.cgi?id=15981

--- Comment #1 from David Smith <dsmith at redhat dot com> ---
bz6850.exp was written against a corner case in the original version of uprobes
(the one built on top of utrace). It appears that this corner case also effects
inode-uprobes, since I can reproduce this one with "raw uprobes", taking
systemtap out of the picture.

====
# gcc -g -o bz6850 src/testsuite/systemtap.base/bz6850.c
# ./bz6850 ; ls -l bz6850_pass ; rm -f bz6850_pass
-rw-r--r--. 1 root root 0 Sep 10 16:12 bz6850_pass
# objdump -t ./bz6850 | fgrep .text
0000000000400680 l    d  .text    0000000000000000              .text
00000000004006b0 l     F .text    0000000000000000             
deregister_tm_clones
00000000004006e0 l     F .text    0000000000000000             
register_tm_clones
0000000000400720 l     F .text    0000000000000000             
__do_global_dtors_aux
0000000000400740 l     F .text    0000000000000000              frame_dummy
0000000000400770 l     F .text    0000000000000012              fork2
0000000000400782 l     F .text    0000000000000025              fork1
00000000004007a7 l     F .text    000000000000009a              fork_and_exec2
0000000000400841 l     F .text    0000000000000025              fork_and_exec1
00000000004009d0 g     F .text    0000000000000002              __libc_csu_fini
0000000000400960 g     F .text    0000000000000065              __libc_csu_init
0000000000400680 g     F .text    0000000000000000              _start
0000000000400866 g     F .text    00000000000000ed              main
# echo > /sys/kernel/debug/tracing/uprobe_events
# echo "p:fork2_entry /root/bz6850:0x770" >>
/sys/kernel/debug/tracing/uprobe_events
# echo "r:fork2_exit /root/bz6850:0x770" >>
/sys/kernel/debug/tracing/uprobe_events
# echo "p:fork1_entry /root/bz6850:0x782" >>
/sys/kernel/debug/tracing/uprobe_events
# echo "r:fork1_exit /root/bz6850:0x782" >>
/sys/kernel/debug/tracing/uprobe_events
# echo "p:fork_and_exec2_entry /root/bz6850:0x7a7" >>
/sys/kernel/debug/tracing/uprobe_events
# echo "r:fork_and_exec2_exit /root/bz6850:0x7a7" >>
/sys/kernel/debug/tracing/uprobe_events
# echo "p:fork_and_exec1_entry /root/bz6850:0x841" >>
/sys/kernel/debug/tracing/uprobe_events
# echo "r:fork_and_exec1_exit /root/bz6850:0x841" >>
/sys/kernel/debug/tracing/uprobe_events
# echo "p:main_entry /root/bz6850:0x866" >>
/sys/kernel/debug/tracing/uprobe_events
# echo "r:main_exit /root/bz6850:0x866" >>
/sys/kernel/debug/tracing/uprobe_events
# echo 1 > /sys/kernel/debug/tracing/events/uprobes/enable
# ./bz6850 ; ls -l bz6850_pass ; rm -f bz6850_pass
ls: cannot access bz6850_pass: No such file or directory
# echo 0 > /sys/kernel/debug/tracing/events/uprobes/enable
# cat /sys/kernel/debug/tracing/trace# tracer: nop
#
# entries-in-buffer/entries-written: 17/17   #P:1
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
          bz6850-2012  [000] d... 3459730.171267: main_entry: (0x400866)
          bz6850-2012  [000] d... 3459730.171319: fork_and_exec1_entry:
(0x400841)
          bz6850-2012  [000] d... 3459730.171334: fork_and_exec2_entry:
(0x4007a7)
          bz6850-2012  [000] d... 3459730.171348: fork1_entry: (0x400782)
          bz6850-2012  [000] d... 3459730.171364: fork2_entry: (0x400770)
          bz6850-2012  [000] d... 3459730.171561: fork2_exit: (0x4007a5 <-
0x400770)
          bz6850-2012  [000] d... 3459730.171565: fork1_exit: (0x4007ca <-
0x400782)
          bz6850-2012  [000] d... 3459730.171567: fork_and_exec2_exit:
(0x400864 <- 0x4007a7)
          bz6850-2012  [000] d... 3459730.171569: fork_and_exec1_exit:
(0x40088d <- 0x400841)
# ./bz6850 ; ls -l bz6850_pass ; rm -f bz6850_pass
-rw-r--r--. 1 root root 0 Sep 10 16:09 bz6850_pass
====

So, somehow putting probes in the target executable keep it from writing its
marker file.

-- 
You are receiving this mail because:
You are the assignee for the bug.


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