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

Re: Ruby test failure

From: Kouhei Sutou <kou_at_cozmixng.org>
Date: 2006-03-19 02:38:19 CET

Hi,

In <20060318134345.GA29914@lorenz.farside.org.uk>
  "Re: Ruby test failure" on Sat, 18 Mar 2006 13:43:45 +0000,
  Malcolm Rowe <malcolm-svn-dev@farside.org.uk> wrote:

> So the change you made in r18924 was just to change the 'flags' parameter
> passed to SWIG_ConvertPtr() from non-zero to zero. That parameter is
> explained as follows in the SWIG documentation:
>
> int SWIG_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
>
> Converts a Ruby object obj to a C pointer whose address is ptr (i.e. ptr
> is a pointer to a pointer). The third argument, ty, is a pointer to a
> SWIG type descriptor structure. If ty is not NULL, that type information
> is used to validate type compatibility and other aspects of the type
> conversion. If flags is non-zero, any type errors encountered during
> this validation result in a Ruby TypeError exception being raised;
> if flags is zero, such type errors will cause SWIG_ConvertPtr() to
> return -1 but not raise an exception. If ty is NULL, no type-checking
> is performed.

This document is old for SWIG 1.3.28. For SWIG 1.3.28, if
flags is 1, free function of the Ruby object is removed; if
flags is 0, free function of the Ruby object isn't removed.

> My questions are:
>
> * What guarantee do we have that pool_wrapper is dereferencable at all,
> when we aren't checking the return value of the function that sets it?
> I don't see any guarantee that SWIG_ConvertPtr() ensures that the
> output pointer is set to anything valid on error.

We don't have. We should check returned value.
I added the code in r18951.

> * What problem is this fixing? The log message says "Support SWIG 1.3.28.
> Keep owning pool.", but apart from fixing the Ruby test failures
> (somehow), I don't understand what this change is trying to achieve.

The cause of the problem is that free function of Ruby's
pool object is removed by SWIG_ConvertPtr() of SWIG 1.3.28.
And the free function cleans up a lock in working copy.

I fixed the problem by preventing a free function deletion.

Thanks,

--
kou
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Mar 19 02:38:34 2006

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