Bug 26109 - bug when begin probe exits quickly
Summary: bug when begin probe exits quickly
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: bpf (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-10 23:32 UTC by Serhei Makarov
Modified: 2020-06-11 00:41 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Serhei Makarov 2020-06-10 23:32:05 UTC
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.

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.
Comment 1 Serhei Makarov 2020-06-11 00:41:20 UTC
fixed 1d63e758149
Comment 2 Serhei Makarov 2020-06-11 00:41:32 UTC
really