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 2013/06/21 20:25:24 UTC

crash showing log in 1.8.0

Hi,

Another one from the crash reports:

in libsvn_client\log.c, line 715, function run_ra_get_log():

matching_segment = bsearch(&younger_rev, log_segments->elts,
                            log_segments->nelts, log_segments->elt_size,
                            compare_rev_to_segment);
SVN_ERR_ASSERT(*matching_segment);


The crash report indicates that 'matching_segment' is NULL, as 'bsearch' 
can return according to the docs.

First problem: the SVN_ERR_ASSERT() is wrong since it tries to access 
the returned pointer instead of checking the pointer itself:

SVN_ERR_ASSERT(matching_segment);

would be the correct way to do this.

The other problem is that the pointer actually is NULL and therefore the 
assertion (if it was coded properly) would have triggered. Instead I now 
get crash reports for this.
https://www.crash-server.com/Problem.aspx?ClientID=tsvn&ProblemID=26730


Stefan

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

Re: crash showing log in 1.8.0

Posted by Stefan Fuhrmann <st...@wandisco.com>.
On Mon, Jun 24, 2013 at 6:23 PM, Stefan Fuhrmann <
stefan.fuhrmann@wandisco.com> wrote:

> On Mon, Jun 24, 2013 at 6:17 PM, Paul Burba <pt...@gmail.com> wrote:
>
>> On Fri, Jun 21, 2013 at 2:25 PM, Stefan Küng <to...@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > Another one from the crash reports:
>> >
>> > in libsvn_client\log.c, line 715, function run_ra_get_log():
>> >
>> > matching_segment = bsearch(&younger_rev, log_segments->elts,
>> >                            log_segments->nelts, log_segments->elt_size,
>> >                            compare_rev_to_segment);
>> > SVN_ERR_ASSERT(*matching_segment);
>>
>> I tried to create a test for this, but I can't.
>
>
> Don't know how to get there but last week I got
> the NULL result when log_segments had a single
> entry with end < start. Maybe, that helps.
>

(temporarily got into that situation by a coding error of mine)

-- Stefan^2.

Re: crash showing log in 1.8.0

Posted by Paul Burba <pt...@gmail.com>.
On Mon, Jun 24, 2013 at 12:23 PM, Stefan Fuhrmann
<st...@wandisco.com> wrote:
> On Mon, Jun 24, 2013 at 6:17 PM, Paul Burba <pt...@gmail.com> wrote:
>>
>> On Fri, Jun 21, 2013 at 2:25 PM, Stefan Küng <to...@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > Another one from the crash reports:
>> >
>> > in libsvn_client\log.c, line 715, function run_ra_get_log():
>> >
>> > matching_segment = bsearch(&younger_rev, log_segments->elts,
>> >                            log_segments->nelts, log_segments->elt_size,
>> >                            compare_rev_to_segment);
>> > SVN_ERR_ASSERT(*matching_segment);
>>
>> I tried to create a test for this, but I can't.
>
>
> Don't know how to get there but last week I got
> the NULL result when log_segments had a single
> entry with end < start. Maybe, that helps.

I'm away from Subversion stuffs for this afternoon, but will check
that out.  Thanks!

--
Paul T. Burba
CollabNet, Inc. -- www.collab.net -- Enterprise Cloud Development
Skype: ptburba

Re: crash showing log in 1.8.0

Posted by Stefan Fuhrmann <st...@wandisco.com>.
On Mon, Jun 24, 2013 at 6:17 PM, Paul Burba <pt...@gmail.com> wrote:

> On Fri, Jun 21, 2013 at 2:25 PM, Stefan Küng <to...@gmail.com>
> wrote:
> > Hi,
> >
> > Another one from the crash reports:
> >
> > in libsvn_client\log.c, line 715, function run_ra_get_log():
> >
> > matching_segment = bsearch(&younger_rev, log_segments->elts,
> >                            log_segments->nelts, log_segments->elt_size,
> >                            compare_rev_to_segment);
> > SVN_ERR_ASSERT(*matching_segment);
>
> I tried to create a test for this, but I can't.


Don't know how to get there but last week I got
the NULL result when log_segments had a single
entry with end < start. Maybe, that helps.

-- Stefan^2.

Re: crash showing log in 1.8.0

Posted by Paul Burba <pt...@gmail.com>.
On Fri, Jun 21, 2013 at 2:25 PM, Stefan Küng <to...@gmail.com> wrote:
> Hi,
>
> Another one from the crash reports:
>
> in libsvn_client\log.c, line 715, function run_ra_get_log():
>
> matching_segment = bsearch(&younger_rev, log_segments->elts,
>                            log_segments->nelts, log_segments->elt_size,
>                            compare_rev_to_segment);
> SVN_ERR_ASSERT(*matching_segment);

I tried to create a test for this, but I can't.  So while I'm still
stumped how the only caller of run_ra_get_log could ever provide
LOG_SEGMENTS which doesn't represent the history of PATHS from the
oldest to youngest revs in REVISION_RANGES (including empty gaps!),
clearly this is happening.  Fixed in r1496110. I'll nominate for
backport to 1.8.1.

--
Paul T. Burba
CollabNet, Inc. -- www.collab.net -- Enterprise Cloud Development
Skype: ptburba

P.S. Stefan - per my earlier private request, I'd still like full
access to the crash reports server.  I'd still like to be able to
reproduce this.

> The crash report indicates that 'matching_segment' is NULL, as 'bsearch' can
> return according to the docs.
>
> First problem: the SVN_ERR_ASSERT() is wrong since it tries to access the
> returned pointer instead of checking the pointer itself:
>
> SVN_ERR_ASSERT(matching_segment);
>
> would be the correct way to do this.
>
> The other problem is that the pointer actually is NULL and therefore the
> assertion (if it was coded properly) would have triggered. Instead I now get
> crash reports for this.
> https://www.crash-server.com/Problem.aspx?ClientID=tsvn&ProblemID=26730
>
>
> Stefan
>
> --
>        ___
>   oo  // \\      "De Chelonian Mobile"
>  (_,\/ \_/ \     TortoiseSVN
>    \ \_/_\_/>    The coolest interface to (Sub)version control
>    /_/   \_\     http://tortoisesvn.net