Project

General

Profile

TasksTasksSGSNMsgbAnnotation » History » Version 2

Anonymous, 02/19/2016 10:47 PM

1 1
2
== SGSN msgb annotation to fix memory leaks and avoid double free ==
3
4
||Mentor ||Holger Freyther||
5
||Skills ||C  ||
6
||Length ||10 days  ||
7
8
=== Goal ===
9
The msgb ownership in the SGSN is not well defined. This leads to memory leaks but also to double frees. One approach would be to add reference counting to the msgb object but the preferred option right now is to properly define ownership and enforce this. The work is mostly analytic work. One should start with all  methods deleting the msgb (leaves/edges). Then find all possible paths that lead to these method and do it recursively. Linus Torvalds 'sparse' compiler can be patched to generate such information. The next step should be to introduce annotations that define what happens to the msgb when this message is called and then modify sparse to know this annotation and verify it among the paths.
10
11 2
== Issue ==
12
Ticket #55 is an example of this kind of problem.
13
14 1
== Approach ==
15
 * Code review assisted with sparse
16
 * Tooling support to avoid this kind of error in the future
17
18
== Learning experience ==
19
 * Sparse and static analysis
20
 * Refactoring of a meaningful amount of code
Add picture from clipboard (Maximum size: 48.8 MB)