Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 8 Apr 2011 19:34:02 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Re: GSoC

On Fri, Apr 08, 2011 at 05:12:06PM +0700, Лайто wrote:
> Hello.
> I'm a student with some knowledges of basic Linux and C programming
> concepts, and I want to join some small open source project to get a
> more of experience. Can I join your project (libc unit tests), if I
> already apply via GSoC with Openwall?

Here's one test that would be worthwhile and hopefully not too hard:

Write a program which loops many times allocating and freeing memory
in random sizes, keeping track of pointers to all the allocated blocks
and their sizes, up to a configurable very large maximum total
allocated amount, or allocation failure, whichever comes first. This
bookkeeping should be kept either in a global array or a single large
malloc-obtained object to avoid having it interact with the test. The
random numbers should use a user-chosen seed and fixed algorithm to
ensure that any abnormal results are reproducible.

Once this first phase finishes allocating memory, the program should
loop over the record of all allocated chunks and test that no chunk
overlaps with any other chunk by comparing their start and end
addresses (based on the saved pointers and sizes). Any overlap would
indicate either an under-allocation bug or memory corruption of some
sort.

I don't expect this to turn up any bugs, but it would be a nice
demonstration of confidence in musl's malloc implementation, which is
completely new and not based on existing sources.

Please don't get caught up in any fancy design for the test program.
It's not code that needs to be reusable or easily integrated with
other programs; it just needs to do its job.

By the way, I hope you'll avoid O(n^2) time in the overlap test.
There's an easy way to do that, and it'll also make it easy for your
program to generate a fragmentation diagram as an added feature. :-)

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.