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

Re: Segfault in ruby tests

From: David James <james82_at_gmail.com>
Date: Sat, 21 Feb 2009 09:06:34 -0800

On Wed, Feb 18, 2009 at 1:39 PM, Joe Swatosh <joe.swatosh_at_gmail.com> wrote:
>>>
>>> I'm thinking 1 is quickest and has a precedent. 2 and 3 might be over my head.
>>>
>>
>
> Hyrum,
>
> This passes locally, but of course it was passing locally without it.
> Could you please give it a try to see if it helps?
>

Hi Joe,

I haven't tested the patch, but it looks good in theory. One comment
(see below):

> -/* FIXME: This typemap doesn't work, because svn_txdelta_apply saves
> - * away this local pointer to be used later. When the pointer
> - * is finally used, we get memory corruption / segfaults.
> +/*
> + * Skip the md5sum
> + * FIXME: Wrap the md5sum
> */
> -%apply unsigned char digest[ANY] { unsigned char *result_digest };
> +%typemap(in, numinputs=0) unsigned char *result_digest
> + ($*1_type temp[APR_MD5_DIGESTSIZE]) "$1 = NULL;";
> #endif

I don't think the variable "temp" is needed here anymore. This comment
also applies to the Python version (I added this unused variable
accidentally in r21423).

Anyway, if the test suite passes with your change, I say it is a good
idea to commit it, because it fixes a known memory corruption bug.

Cheers,

David

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1204000
Received on 2009-02-21 18:06:58 CET

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.