0xDEADBEEF?

While reading a report, I saw where 0xDEADBEEF is used in Linux Kernel to assign a variable, null. TIL that this hexa value is used to assign a variable to null.

Continue reading

#c, #deadbeef, #hexspeak, #memset, #null

Faults in Linux: Not checking for Null before dereferencing

As part of my project, while reading the reports, I came to know about bugs of type which were not checking for null before derefencing.  There were many in the versions 2.4.x and 2.6.x. I was also required to list FPs (false positives) by Coccinelle. This post will be about, what I found for the case of NULL return values are tested before being derferenced or not?

You can view the complete report as a PDF here and as a HTML file here.

Continue reading

#bugs, #c, #coccinelle, #foss-2, #fossopw, #null-return-values

Reading Complicated C Declarations

In this post I’ll be writing about how to easily read the complicated C declarations like

char (*(*x()) []) ()
char (* (*x[3]) ()) [5]
void (*f)(int,void (*)())
int **(*f)(int**,int**(*)(int **,int **));

Continue reading

#c, #c-declarations, #cdecl, #complicated-declaration

Building and Installing a Kernel

This post is about how to install a new kernel from source.

The latest source code for the Linux kernel is kept on kernel.org. You can either download the full source code as a tar ball (not recommended and will take forever to download), or you can check out the code from the read-only git repositories.

Continue reading

#build, #c, #compile, #grub, #howto, #install, #kernel, #linux, #linux-kernel

Debugging Memory Leaks using Valgrind

Valgrind is a tool for memory debugging, memory leak detection, and profiling. It is named after the main entrance to Valhalla.

Valgrind was originally designed to be a free memory debugging tool for Linux on x86, but has since evolved to become a generic framework for creating dynamic analysis tools such as checkers and profilers.

This post is about using Valgrind to debug memory leaks.

Continue reading

#c, #memory-leaks, #valgrind