You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Stefan Küng <to...@gmail.com> on 2011/11/03 20:40:26 UTC

segfault when applying patch

Hi,

A few crash dumps sent for TSVN 1.7 show a segfault when applying a patch.

in libsvn_client/patch.c, line 2703:

target_info = APR_ARRAY_IDX(targets_info, i, patch_target_info_t *);
parent = svn_dirent_dirname(target_info->local_abspath, iterpool);

the target_info->local_abspath is NULL, so svn_dirent_dirname() then 
segfaults.

I haven't figured out why target_info->local_abspath is NULL though, but 
maybe you have an idea?

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net

Re: segfault when applying patch

Posted by Philip Martin <ph...@wandisco.com>.
Philip Martin <ph...@wandisco.com> writes:

> What you need is a patch file that has modifies two targets.  One part
> of the patch gets applied and deletes a file, another part of the patch
> gets skipped, because the path is outside the working copy say.  The
> skipped target has local_abspath NULL and delete_empty_dirs will crash.

I've raised http://subversion.tigris.org/issues/show_bug.cgi?id=4049

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com

Re: segfault when applying patch

Posted by Philip Martin <ph...@wandisco.com>.
Stefan Küng <to...@gmail.com> writes:

> A few crash dumps sent for TSVN 1.7 show a segfault when applying a patch.
>
> in libsvn_client/patch.c, line 2703:
>
> target_info = APR_ARRAY_IDX(targets_info, i, patch_target_info_t *);
> parent = svn_dirent_dirname(target_info->local_abspath, iterpool);
>
> the target_info->local_abspath is NULL, so svn_dirent_dirname() then
> segfaults.
>
> I haven't figured out why target_info->local_abspath is NULL though,
> but maybe you have an idea?

What you need is a patch file that has modifies two targets.  One part
of the patch gets applied and deletes a file, another part of the patch
gets skipped, because the path is outside the working copy say.  The
skipped target has local_abspath NULL and delete_empty_dirs will crash.

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com