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

Re: [WIP] Gracefully handle svn_wc_prop_set4() errors in svn patch

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Tue, 28 Sep 2010 19:18:39 +0100

Daniel Näslund <daniel_at_longitudo.com> writes:

> On Tue, Sep 28, 2010 at 03:45:33PM +0200, Daniel Shahaf wrote:
>> Daniel Näslund wrote on Mon, Sep 27, 2010 at 22:09:26 +0200:
>>
>> err_abort() is called when an error object hadn't been svn_error_clear()'d.
>> (The error creation installed err_abort() as a pool cleanup callback,
>> and clearing the error unregisters the callback.)
>
> Yes, that was how I understood it.

If you run the program gdb, it will catch the abort. If you step up
the stack to err_abort and print err[0] then you will see the file and
line where the error was created. (You may well have worked this out
already).

>> > @@ -2260,14 +2283,23 @@ install_patched_prop_targets(patch_target_t *targe
>> > + err = svn_wc_prop_set4(ctx->wc_ctx, target->local_abspath,
>> > + prop_target->name,
>> > + svn_string_create_from_buf(prop_content,
>> > + iterpool),
>> > + TRUE /* skip_checks */,
>> > + NULL, NULL,
>> > + iterpool);
>> > + if (err)
>> > + {
>> > + prop_target->was_rejected = TRUE;
>> > + prop_target->err = err;
>>
>> Does prop_target->err always get cleared?
>>
>> (The answer is probably "No".)
>
> As I said above, my intention was to clear it in
> send_patch_notification().

You will still have a problem if there is more that one error and the
assignment above overwrites a previous err, the overwritten err will
have leaked.

-- 
Philip
Received on 2010-09-28 20:19:20 CEST

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.