Skip to contentSkip to conversation

status of kernel memory debugging?

DISCUSSION Willem de Bruijn 2 participants 3 messages Jul 30, 2005

lore
Share & tools
lore
#0 lore raw

hi all,

For a project in packet filtering (ffpf.sf.net) I'm in the process of debugging kernel code I wrote. I have the habit of running all userspace code through valgrind, and have setup user-mode-linux to do the same with the kernel.

Reading through some old LKML threads I see that there has been talk of valgrinding a UML image, but the outcome appears inconclusive. Could someone please update me on the status of memory debugging in the kernel, especially regarding valgrind?

Do you have other tools you regularly use, or is is simply a trial-and-error practice? Note that I already export my kernelspace code to userspace for unit-testing where possible. It is only in the ioctl/syscall handlers that this technique fails.

thanks,

Willem de Bruijn

#1 lore raw
Quoted 4 lines · Willem de Bruijn

Reading through some old LKML threads I see that there has been talk of valgrinding a UML image, but the outcome appears inconclusive. Could someone please update me on the status of memory debugging in the kernel, especially regarding valgrind?

UML is still too strange for valgrind, despite progress on both sides (valgrind accepting more strange things and UML becoming less strange).

I tried grinding UML a month or so ago, and its use of clone was a sticking point.

Jeff

#2 lore raw
Quoted 7 lines

UML is still too strange for valgrind, despite progress on both sides (valgrind accepting more strange things and UML becoming less strange).

I tried grinding UML a month or so ago, and its use of clone was a sticking point.

I think I read your remark, yes. Thanks for the update; I hoped some strides had been made in that direction since then. Personally, I know to little about the topic to be of any use.

I guess the best option is then using slab caches per object type, so that I can at least find obvious memory leaks.

On a sidenote, it'll be interesting to see what valgrind reports once (if?) the kernel gets a good grinding.

Willem