]> sourceware.org Git - systemtap.git/commit
PR26019 stapbpf: don't continue startup if begin probe already exited
authorSerhei Makarov <smakarov@redhat.com>
Thu, 11 Jun 2020 00:22:06 +0000 (20:22 -0400)
committerSerhei Makarov <smakarov@redhat.com>
Thu, 11 Jun 2020 00:39:23 +0000 (20:39 -0400)
commit1d63e75814978d171c758709356437addee7e687
tree6412e1a55f0129161b3c4b246fd0d3c285eb1706
parentbcf55e8f4805aa9d4740311df60d477e2c6b1fd4
PR26019 stapbpf: don't continue startup if begin probe already exited

if a bpf begin probe sets exit status, the main thread will skip the
pause() call and immediately deallocate global data structures. Then
the perf_event_loop thread will run on the corrupted data and
occasionally fail. Example result is an assertion failure due
count_active_cpus() running on corrupted data.

Could change the main thread to join() instead of detach(), but then
all threads must be modified to listen for exit status including exit
status from begin thread. TODO Consider doing so later.

I think if the begin probe was running, it wasn't correct to start the
perf_event_loop (or PERF_EVENT_IOC_ENABLE, or any of the procfs
threads) in the first place, as those things logically happen after
the begin probe has already exited. Simply clean up and exit.
stapbpf/stapbpf.cxx
This page took 0.026925 seconds and 5 git commands to generate.