Philip Martin wrote on Tue, Jan 25, 2011 at 17:02:18 +0000:
> Julian Foad <julian.foad_at_wandisco.com> writes:
> > On Tue, 2011-01-25 at 08:28 -0800, Danny Trebbien wrote:
> >> > I made one tweak: in the test for detecting an error, after detecting
> >> > the error, we need to clear the error, otherwise the test harness
> >> > reports success on the individual test but reports a problem at the end
> >> > of the test run:
> >> >
> >> > PASS: lt-subst_translate-test 1: test svn_subst_translate_string2()
> >> > /home/julianfoad/bin/svn-c-test: line 35: 11406 Aborted
> >> >
> >> > So I added "svn_error_clear(err);" after "SVN_TEST_ASSERT(err->apr_err
> >> > == SVN_ERR_IO_INCONSISTENT_EOL);".
> >> Is the svn_error_t object reused?
> > It's not re-used.
> > Normally, an error ends up being handled by svn_handle_error2() or some
> > such function, which (after printing out the details) destroys the pool
> > that was allocated for it.
> > The problem was that the pool allocated for this particular error was
> > never being handled, and never being destroyed. Somewhere there is some
> > code that detects this at program exit time and throws an assertion
> > failure to warn us programmers of this "leak", because normally an error
> > not being handled indicates a mistake in the program logic (and a
> > leaking of memory).
> If you were not seeing the abort then you were probably building without
> -DSVN_DEBUG; that makes the error leak into just a memory leak without
> an abort.
Typically one uses --enable-maintainer-mode, not -DSVN_DEBUG explicitly.
Received on 2011-01-25 18:52:04 CET