Google Summer of Code 2022

strace was taking part in the GSoC 2022 as a mentor organization.

About strace project

strace is a diagnostic, debugging and instructional userspace tracer for Linux. It is used to monitor and tamper with interactions between processes and the Linux kernel, which include system calls, signal deliveries, and changes of process state. The operation of strace is made possible by the kernel feature known as ptrace.

strace is one of the longest running open source projects and had been started even before Linux was started.

strace is an important tool for debugging and tracing deployed on all Linux distributions with a small community of active contributors.

While strace is a small project, the strace tool is essential for many developers, system administrators and open source projects. Its maintainers and contributors are experienced developers.

The project organization is simple: the community discusses proposed patches and a few core maintainers eventually accept or reject contributions. All contributions are submitted as git patches to the mailing list, which is the single point of communication, in a mode very similar to the ways of the Linux kernel.

strace release cycle is currently synchronized with the release cycle of the Linux kernel.

Note that we are pretty laid back and cool compared to larger and professional projects like the Linux kernel but our standards are high and the people involved in strace are die hard system coders often contributing to or maintaining major C libraries such as Glibc, Glib or Bionic, contributing to the Linux Kernel and other major free and open source projects.

So we expect that you would be making the efforts to learn our mailing list and patch ways and ask good questions and do your home work for a most productive and efficient participation.

What to do as a prospective student

We want engage with students that are interested in system programming and want to help making strace a better tool. We hope to gain you as a new long term contributor and that you will contribute interesting and new features.

You need to grok C and have an interest in system programming and debugging. The codebase is not huge but the domain is not simple and requires a meticulous attention to many details.

All the communication is going through a single mailing list: https://lists.strace.io/mailman/listinfo/strace-devel

Subscribe to the list, introduce yourself and start the discussion!

Please prefix your email subjects with GSOC.

Please be kind enough to follow these simple guidelines when posting to the list:

1. only send text emails. No HTML
2. do not top post
3. use and abuse the mailing list archive to see how proper discussions are handled
4. be patient, a reply may need a week to come by
5. use git tools to create and submit patches to the list
6. apply to your code the same code style and indentation used overall in strace

Thank you!

https://lists.strace.io/pipermail/strace-devel/2016-March/004704.html

After introducing yourself on the list, you can join our IRC channel, #strace @ oftc. Introducing yourself only on IRC is not enough; the mailing list is the primary means of communication.

Check our list of projects ideas below or submit new ideas to the list for consideration.

It is required that students who want to apply to the strace project for the GSoC 2022 complete a relatively small code-related "microproject" as part of their application. Please refer to our guidelines and suggestions for MicroProjects for more information. Completing a microproject is not only an important way for us to get experience with applicants, but it will also help applicants become familiar with strace's development and submission process.

General proposal requirements

You will need to submit your official proposal via https://summerofcode.withgoogle.com and plain text is the way to go.

Please subscribe to the strace-devel mailing list and post your proposal there too.

We expect your application to be in the range of 1000 words. Anything less than that will probably not contain enough information for us to determine whether you are the right person for the job. Your proposal should contain at least the following information, plus anything you think is relevant:

Beyond your proposal you need obviously to be familiar with C and Git (or willing to learn these two super quick).

List of project ideas for students

Comprehensive test suite

The test suite we have today is far from covering all branches of all parsers yet. According to Codecov, current test coverage is just under 90%, but it tells very little about the actual coverage of various corner cases (checks for type sizes, signedness, handling of pointers to invalid memory, etc). Some trivial bugs(1, 2) that pop from time to time only further confirm this fact.

The goal of this project is to improve the test suite to a level that makes strace more reliable.

On the one hand, it would be educational for any student who is interested in syscall internals because writing syscall parsers and tests for them is the second best way to find out how syscalls work.

On the other hand, a comprehensive test suite is a prerequisite for any major change in strace source code. This test suite project does not have to be a work from scratch, there are already existing tests (e.g. strace/tests, ltp/testcases/kernel/syscalls, and sandbox/tests) that could be used as a starting point.

There are several ideas that may help with significant coverage increase in some parts of the code base:


Expected outcomes: increased test coverage
Skills required/preferred: C, shell, obsessiveness, pedantry
Possible mentors: Eugene Syromyatnikov, Dmitry V. Levin
Expected size of project: 175—350 hours
Difficulty rating: easy to medium

Support for BTF and other BPF decoding improvements

BTF (BPF Type Format) is a binary format (which is mutilated CTF, C Type Format) for describing type information for the data used in various places connected to eBPF. One of such places is eBPF maps, where BTF information for the key and value types may be supplied. The goal of this project is to retrieve the BTF information for the eBPF maps and use it to enhance decoding of keys and values of map elements passed to/from the kernel in map-manipulation-related bpf syscalls.


Expected outcomes: enhanced decoding for the map manipulation sub-calls of the bpf() syscall
Skills required/preferred: C, some eBPF knowledge is preferred
Possible mentors: Eugene Syromyatnikov
Expected size of project: 175 hours
Difficulty rating: medium

Implement an ioctl decoder

ioctl commands is an endless field of strace improvement due to their vast diversity. There are many ioctl commands, decoding for which is not properly (and/or fully) implemented, including several classes of frequently requested commands, such as:

Note that there is a decoder generator now available (generated HDIO_* decoder example), which may help with writing a decoder (but not with tests so far).


Expected outcomes: enhanced decoding of specific category of ioctl commands
Skills required/preferred: C, possibly flex/bison, some ioctl field-specific knowledge is preferred
Possible mentors: Eugene Syromyatnikov
Expected size of project: 175—350 hours
Difficulty rating: easy to medium

The space of improvement with regards to netlink protocol decoding is as vast and endless, as the ioctl one. Possible candidates for improving netlink decoding include:


Expected outcomes: enhanced decoding of specific classes of netlink messages
Skills required/preferred: C, some netlink field-specific knowledge is preferred
Possible mentors: Eugene Syromyatnikov
Expected size of project: 175—350 hours
Difficulty rating: easy

More flexible output to file

There are several disparate github issues that may form a cohesive strace output handling improvement project: an implementation of more flexible (for example, format-string-based, 54) output file name specification (along with some additional rules for output file handling, like renaming/rotating/stopping) may solve the following issues:

As a bonus, the following issues may also be tackled:


Expected outcomes: improved managing of strace's output
Skills required/preferred: C
Possible mentors: Eugene Syromyatnikov
Expected size of project: 175 hours
Difficulty rating: easy to medium

Improve statistics handling

While strace does indeed have some facility that provide some syscall statistics regarding the traced processes, it is still of rather limited use. Some things that can be improved and make its usability on par with other tracing tools:

For this project, design and features of other tracing tools, like lttng and perf, are likely to be considered.


Expected outcomes: enhanced decoding
Skills required/preferred: C, some eBPF knowledge is preferred
Possible mentors: Eugene Syromyatnikov
Expected size of project: 175 hours
Difficulty rating: easy

Implement the features requested on Github

There are several issues present on the github issues page. A couple of them could be enough for a 175-hour long project, depending on the size of the changes required. You'll have to try and estimate how many hours you'll need for each task that you pick. Adding own enhancement ideas to the plan is fine. See also: FeatureRequests

There is an assortment of small enhancements that can be picked from that list, for example:


Expected outcomes: enhanced decoding
Skills required/preferred: C, shell, possibly m4 and awk
Possible mentors: Elvira Khabirova, Eugene Syromyatnikov
Expected size of project: 175 hours
Difficulty rating: medium

Support for alternative tracing backends

There is a long-standing gdbserver backend proposal, that will enable running strace on tracees that are under the control of gdb (that, in turn, acts as a ptrace request multiplexer, enabling simultaneous connection of various tracers and debuggers), but it's still not finished:

The project would require updating the backend to the current strace's state (that has gotten new calls that are supposed to be called on the tracee's side, including some calls inside libdw/libselinux), implementing a reasonable test suite for it, and scratching a set of missing gdb stub calls that are needed to be performed on the tracee's side.


Expected outcomes: new strace tracing backend, based on gdb stub protocol
Skills required/preferred: C, gdb stub protocol knowledge is preferred
Possible mentors: Eugene Syromyatnikov
Expected size of project: 350 hours
Difficulty rating: hard

Other ideas

We are also open to any suggestions not listed on this page.

Some existing ideas are present on a separate page. Note, however, that they may be not adequately sized for a GSoC project or require specific qualifications.

GoogleSummerOfCode2022 (last edited 2023-02-13 15:51:24 by DmitryLevin)