Bug 23435 - stapbpf transport layer can swallow a message before exit()
Summary: stapbpf transport layer can swallow a message before exit()
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: bpf (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Serhei Makarov
URL:
Keywords:
Depends on: 22330
Blocks:
  Show dependency treegraph
 
Reported: 2018-07-19 17:05 UTC by Serhei Makarov
Modified: 2019-03-22 20:27 UTC (History)
1 user (show)

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 2018-07-19 17:05:58 UTC
In the following test program:

probe kernel.function("vfs_read") {
  printf("a\n"); printf("b\n"); exit()
}

The stapbpf transport layer will see the following:

0: <tag>a
1: </tag>
2: <tag>b
3: </tag>
4: <tag></tag>

Because exit() sets exit_status before stapbpf reads this data, the empty </tag> on line 1 will trigger the program to exit.

Similarly,

probe kernel.function("vfs_read") {
  printf(""); printf("b\n"); exit()
}

will also swallow the second message.
Comment 1 Serhei Makarov 2018-08-21 21:02:18 UTC
Looks like this issue depends on PR22330. Once we have a proper transport framework, we can implement a proper EXIT message instead of multiplexing onto trace_printk() like this.

I experimented a bit with having exit() send a (much less likely to occur) non-printing character to make the second testcase work properly, but that introduces more problems than it solves.
Comment 2 Serhei Makarov 2019-03-22 20:27:26 UTC
confirmed fix after pr22330