Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20120817210637.GU27715@brightrain.aerifal.cx>
Date: Fri, 17 Aug 2012 17:06:37 -0400
From: Rich Felker <dalias@...ifal.cx>
To: musl@...ts.openwall.com
Subject: Powerful new tool for unit tests

Hi all,

I'm attaching a tool I developed last night for use in unit tests,
which led to the detection and fixing of the latest strtod bug. It
provides a function huge_alloc which creates a huge buffer filled with
a given pad byte, but for which all but the first and last few pages
are shared mappings of a common backing. This makes it possible to
test string functions on buffers gigabytes or even terabytes in length
without the need to have that much physical storage available, and
without the minutes or hours of page fault thrashing to instantiate
that much memory.

There are a few issues I'd still like to fix; mainly the allocation
ends up being unpredictably larger than n (due mainly to laziness on
my part), meaning there's no way for the caller to free the mapping.
Anyway, since I may not get around to improving it right away, I'm
going ahead and sharing it with the list as a potential basis for
developing and performing further tests.

Rich

View attachment "huge.c" of type "text/plain" (1108 bytes)

View attachment "test_huge_strtod.c" of type "text/plain" (253 bytes)

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.