"Re: Ruby test failure" on Sat, 18 Mar 2006 13:43:45 +0000,
Malcolm Rowe <email@example.com> 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.
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Sun Mar 19 02:38:34 2006