cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: [PATCH 0/2] runtests.pl: Fix LD_PRELOAD with ASAN libs (updated)

From: Peter Wu <peter_at_lekensteyn.nl>
Date: Fri, 14 Nov 2014 23:25:09 +0100

On Thursday 13 November 2014 15:45:19 Peter Wu wrote:
> Another round of patches around the test suite. This time the patches
> fix tests that run under LD_PRELOAD=libhostname.so and when cURL is
> built with Address Sanitizer (-fsanitize=address).
>
> The first patch ("runtests.pl: simplify command environment handling")
> actually contains three changes:
> - Convert from shell commands to an array of arguments.
> - Implement a subset of IPC::Run as AIX does not have this module.
> - Implement a custom subroutine that splits a shell command into an
> array. This is done because Text::ParseWords is broken and does not
> handle some cases correctly.
>
> The second patch further restricts the scope of environment variables.
>
> Reviews / comments are appreciated!
>
> Kind regards,
> Peter
>
> Peter Wu (2):
> runtests.pl: safer system() calls, fix LD_PRELOAD
> runtests.pl: simplify command environment handling
>
> tests/runtests.pl | 446 +++++++++++++++++++++++++++++++++++-------------------
> 1 file changed, 287 insertions(+), 159 deletions(-)

Some last minute changes to replace IPC::Run and Text::ParseWords
introduced bugs (in runclient and splitcmd respectively). With the third
public revision of the "safer system calls" patch, all tests pass again
as usual.

Due to IPC::Run avoidance, the file grew a bit, but it will properly
handle the documented behavior. Fun fact about the splitcmd changes, the
regex looks simpler but it seems to be a bit faster on parsing commands
compared to Text::ParseWords, this was measured by passing all commands
from the test suite through the subroutine.

These two patches can also be found at
https://github.com/Lekensteyn/curl/compare/997eecd%5E...9a87bdc

Output of `perl -I$srcdir $srcdir/runtests.pl -n -a -k`:
TESTDONE: 794 tests out of 794 reported OK: 100%
TESTDONE: 955 tests were considered during 296 seconds.
TESTINFO: 161 tests were skipped due to these restraints:
TESTINFO: "curl lacks unittest support" 16 times (1300, 1301, 1302, 1303, 1304, 1305, 1306, 1307, 1308 and 7 more)
TESTINFO: "curl lacks large_file support" 3 times (99, 1044, 1063)
TESTINFO: "curl lacks debug support" 76 times (67, 68, 69, 81, 89, 90, 91, 150, 155 and 67 more)
TESTINFO: "failed starting HTTP-pipe server" 4 times (1900, 1901, 1902, 1903)
TESTINFO: "curl lacks TLS-SRP support" 5 times (320, 321, 322, 323, 324)
TESTINFO: "no stunnel" 28 times (300, 301, 302, 303, 304, 305, 306, 307, 308 and 19 more)
TESTINFO: "curl lacks Metalink support" 16 times (2005, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 and 7 more)
TESTINFO: "curl lacks TrackMemory support" 2 times (96, 558)
TESTINFO: "Resolving IPv6 'ip6-localhost' didn't work" 2 times (241, 1083)
TESTINFO: "curl lacks NTLM_WB support" 1 times (1310)
TESTINFO: "configured as DISABLED" 8 times (594, 836, 882, 938, 1209, 1211, 1316, 1512)

Kind regards,
Peter Wu
https://lekensteyn.nl

Received on 2014-11-14