Skip to contentSkip to conversation

Valgrind meets UML

uml-devel Giovanni Marzot 4 participants 7 messages Oct 23, 2003 – Oct 25, 2003 User-mode Linux (UML)

lore
Share & tools
lore
#3 lore raw
In reply to Giovanni Marzot
Quoted 4 lines · Giovanni Marzot

hmmm...Should I wait until this is done or is there something I can try in the meantime.

Are the old patches even available anywhere?

The old patches have either been merged or won't apply any more. Normally I would say "try the CVS version", but we're in the process of migrating away from SF's CVS - I hope that will be done in the next few days.

J

-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#0 lore raw

Hi,

I see this email below...

Can anyone confirm if the patches to valgrind mentioned below have found there way into the release?

I will be attempting this with 2.4.20-6um.

Any words of wisdom appreciated. Has anyone used this combination succesfully?

I wonder what "teaching valgrind about the false positives" entails.

thanks for any info, GSM

Quoted 8 lines
Quoted 4 lines · [email protected] said:

Is it possible to run 2.4.20-3um (or -4um - I have not got around to updating yet) under valgrind?

Does it need some specific config options to work?

Any recent UML is as valgrindable as the UML mentioned in the post you >saw.

Quoted 8 lines

You need CONFIG_MODE_SKAS, !CONFIG_MODE_TT, and >CONFIG_KERNEL_STACK_ORDER=3.

You also probably need some valgrind patches unless the stuff I and >Jeremy have done have been merged into valgrind CVS.

Once valgrind is working, you need to go through the false positives and teach valgrind about how the kernel deals with memory allocation. This is the point at which I stopped.

-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#2 lore raw
In reply to Jeremy Fitzhardinge

Thank you for the reply.

Quoted 9 lines · Jeremy Fitzhardinge
Quoted 1 line · Giovanni Marzot

Can anyone confirm if the patches to valgrind mentioned below have found there way into the release?

They haven't. They were mostly slimy hacks to see what needed fixing, rather than proper fixes. The good news is that I've been busily incorporating proper fixes and redesigns into Valgrind, so the development version should be capable of running uml unpatched soon.

hmmm...Should I wait until this is done or is there something I can try in the meantime.

Are the old patches even available anywhere?

If you have something you would like me to try out (even if its grungy) I would be happy to give it a whirl.

Quoted 8 lines
Quoted 3 lines

I wonder what "teaching valgrind about the false positives" entails.

Not everything Valgrind reports is an error. You can either generate a suppression rule to tell V not to report it, or you can use annotations in your program to tell V what's really going on.

cool.

-GSM

Quoted 3 lines

J

-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#4 lore raw
In reply to Giovanni Marzot
Quoted 2 lines · [email protected] said:

Any words of wisdom appreciated. Has anyone used this combination succesfully?

I ran out of free time about a year ago when playing with this, but I did have UML and Valgrind playing together.

Quoted 1 line

I wonder what "teaching valgrind about the false positives" entails.

However, I didn't get anything useful out of it. This is because Valgrind knows nothing about the kernel memory allocators. I started describing them, but didn't get too far.

IIRC, you add special macros into the allocators when the status of a region of memory changes. I.e.
a buffer being returned from an allocator is declared readable and
writeable
a buffer being freed is declared unreadable and unwriteable (or maybe
just inaccessible, I forgot)

These macros expand into different sequences of noops which are recognized by Valgrind, which is a cute trick.

You've found the UML config changes needed for Valgrind. If Valgrind itself has the changes that Jeremy and I made, then you should be all set to at least run UML under it.

Jeff

-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#5 lore raw
Quoted 3 lines · Jeff Dike

You've found the UML config changes needed for Valgrind. If Valgrind itself has the changes that Jeremy and I made, then you should be all set to at least run UML under it.

Which alone should trap some stupid mistakes with uninitialized variables, even if the memory allocation/deallocation integration is not set yet so it it not totally fruitless.

It should also allow for the cachegrind mode, which some people might find useful.

Regards
Henrik

-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
In reply to Giovanni Marzot
Quoted 2 lines · Giovanni Marzot

Can anyone confirm if the patches to valgrind mentioned below have found there way into the release?

They haven't. They were mostly slimy hacks to see what needed fixing, rather than proper fixes. The good news is that I've been busily incorporating proper fixes and redesigns into Valgrind, so the development version should be capable of running uml unpatched soon.

Quoted 1 line

I wonder what "teaching valgrind about the false positives" entails.

Not everything Valgrind reports is an error. You can either generate a suppression rule to tell V not to report it, or you can use annotations in your program to tell V what's really going on.

J

-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#6 lore raw
In reply to Henrik Nordstrom
Quoted 3 lines · [email protected] said:

Which alone should trap some stupid mistakes with uninitialized variables, even if the memory allocation/deallocation integration is not set yet so it it not totally fruitless.

In the small amount of testing I did (boot up tomsrtbt and halt it), it didn't find anything real. It found some structures that I was passing into system calls that were incompletely initialized (because it didn't make sense to initialize some fields or because there was a union in it and the code was using one of the smaller arms), and a few similar things.

It's going to require more extensive of UML under valgrind to start finding bugs.

Quoted 2 lines

It should also allow for the cachegrind mode, which some people might find useful.

Cachegrind would be particularly interesting, and cache behavior along a particular code path would be interesting to people, so this wouldn't necessarily need a real workload to be useful.

Jeff

-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel