[Bug runtime/23435] New: stapbpf transport layer can swallow a message before exit()

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug runtime/23435] New: stapbpf transport layer can swallow a message before exit()

albert.aribaud at 3adev dot fr
https://sourceware.org/bugzilla/show_bug.cgi?id=23435

            Bug ID: 23435
           Summary: stapbpf transport layer can swallow a message before
                    exit()
           Product: systemtap
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: runtime
          Assignee: systemtap at sourceware dot org
          Reporter: serhei.public at gmail dot com
  Target Milestone: ---

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.

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug bpf/23435] stapbpf transport layer can swallow a message before exit()

albert.aribaud at 3adev dot fr
https://sourceware.org/bugzilla/show_bug.cgi?id=23435

Serhei Makarov <me at serhei dot io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |me at serhei dot io
          Component|runtime                     |bpf

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug bpf/23435] stapbpf transport layer can swallow a message before exit()

albert.aribaud at 3adev dot fr
In reply to this post by albert.aribaud at 3adev dot fr
https://sourceware.org/bugzilla/show_bug.cgi?id=23435

Serhei Makarov <me at serhei dot io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |22330


Referenced Bugs:

https://sourceware.org/bugzilla/show_bug.cgi?id=22330
[Bug 22330] bpf: generate printf via event tuples, userspace formatting
postprocessing
--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug bpf/23435] stapbpf transport layer can swallow a message before exit()

albert.aribaud at 3adev dot fr
In reply to this post by albert.aribaud at 3adev dot fr
https://sourceware.org/bugzilla/show_bug.cgi?id=23435

--- Comment #1 from Serhei Makarov <serhei.public at gmail dot com> ---
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.

--
You are receiving this mail because:
You are the assignee for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug bpf/23435] stapbpf transport layer can swallow a message before exit()

albert.aribaud at 3adev dot fr
In reply to this post by albert.aribaud at 3adev dot fr
https://sourceware.org/bugzilla/show_bug.cgi?id=23435

Serhei Makarov <me at serhei dot io> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|systemtap at sourceware dot org    |me at serhei dot io

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