apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 56654] apr_skiplist sometimes corrupts
Date Sat, 21 Jun 2014 11:58:17 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=56654

--- Comment #6 from Eric Covener <covener@gmail.com> ---
(In reply to Eric Covener from comment #5)
> Just out of context in the diff it's clear we pcalloc/calloc new memory so
> +1.
> 
> I did just now look at the original (non-apr) skiplist, which always does
> malloc inline and either does memset or memcpy right after. We don't seem to
> have that memcpy equivalent path (I can't tell why) so it seems like we're
> never doing a throwaway memset+memcpy.  
> 
> Will commit shortly

Did you try your testcase w/ this #if 0 un-ifdeffed out?

static apr_skiplistnode *insert_compare(apr_skiplist *sl, void *data,
                                        apr_skiplist_compare comp, int replace)
{
    apr_skiplistnode *m, *p, *tmp, *ret = NULL, **stack;
    int nh = 1, ch, stacki;
    if (!sl->top) {
        sl->height = 1;
        sl->topend = sl->bottomend = sl->top = sl->bottom =
            (apr_skiplistnode *)apr_skiplist_alloc(sl,
sizeof(apr_skiplistnode));
#if 0
        sl->top->next = (apr_skiplistnode *)NULL;
        sl->top->data = (apr_skiplistnode *)NULL;
        sl->top->prev = (apr_skiplistnode *)NULL;
        sl->top->up = (apr_skiplistnode *)NULL;
        sl->top->down = (apr_skiplistnode *)NULL;
        sl->top->nextindex = (apr_skiplistnode *)NULL;
        sl->top->previndex = (apr_skiplistnode *)NULL;
#endif
        sl->top->sl = sl;
    }

I wonder if there is even any point in skipping a memset call though.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message