[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[BUG] Resource consumption problem in clients/cmdline/prompt.c::prompt().

From: David Wilson <dw_at_botanicus.net>
Date: 2005-01-15 00:41:33 CET

Good evening folks,

At around midnight on the 13th of January, my nightly svn cronjob
spiralled out of control and brought my host's FreeBSD machine to a near
halt. On further exploration, it turns out that my SSL certificate
expired on that day (https://china.botanicus.net/).

Cron starts processes with stdin connected to /dev/null, or some
equivalent that causes 0-byte reads.

Poking through the Subversion sources, I found a while loop in
clients/cmdline/prompt.c::prompt() that repeats until the platform
specific EOL is detected.

That loop calls prompt.c::wait_for_input(), which calls apr_poll(),
which uses `pool' that was passed to prompt(). The problem appears to
appear in the tests that follow line 114:

    114: status = apr_file_getc (&c, fp);

I don't yet understand enough about APR/svn to determine what is going
wrong, but I assume apr_file_getc() is returning success and setting
'&c' to a NUL character, or returning a status value that is not
accounted for.

To reproduce:

    1) Start a terminal with /usr/bin/top running (or something that can
    see svn processes' resource usage).

    2) In another terminal, execute:
        $ svn co https://china.botanicus.net/svn/cdr_mysql < /dev/null

I suppose anything that calls prompt() will trigger the bug, but this
particular command line will do it. Well, at least until I renew my SSL
certificate. :)

Thanks,

David.

-- 
Implementations are always preferred over rhetoric.
    -- Robert Brewer on comp.lang.python
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jan 15 00:42:40 2005

This is an archived mail posted to the Subversion Dev mailing list.