You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Daniel Shahaf <d....@daniel.shahaf.name> on 2015/09/02 17:35:04 UTC

Re: How to call SVN's fs.change_rev_prop2 from Python / SWIG - passing old_value_p as a double pointer?

[ Summary for dev@: calling svn_fs_change_rev_prop() from Python works;
calling svn_fs_change_rev_prop2() with old_value_p=None changes the
property and then segfaults. ]

Mark Ziesemer wrote on Wed, Sep 02, 2015 at 00:01:40 +0000:
> I'm trying to call fs.change_rev_prop2 (https://goo.gl/6b6TG5) from Python /
> SWIG - and apparently can't figure out how to pass old_value_p as what I'm
> assuming needs to be a double pointer from Python.
> 

In short, I don't think that's currently possible; I think the bindings
will need to be patched for this to work.  The 'const svn_string_t
*const *old_value_p' parameter of svn_fs_change_rev_prop2() will need to
be wrapped correctly.  (Currently it is wrapped incorrectly: passing
None to it segfaults although NULL is a valid value.)

How should that parameter be presented to Python code?  In particular,
how should Python code that passes a "pointer to a NULL pointer" as the
argument look like?

(Moving the thread to dev@.  I'll reply separately on users@ with a few
notes about your code.)

Cheers,

Daniel


Re: How to call SVN's fs.change_rev_prop2 from Python / SWIG - passing old_value_p as a double pointer?

Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
Daniel Shahaf wrote on Wed, Sep 02, 2015 at 15:35:04 +0000:
> [ Summary for dev@: calling svn_fs_change_rev_prop() from Python works;
> calling svn_fs_change_rev_prop2() with old_value_p=None changes the
> property and then segfaults. ]

I've plugged the segfault in r1700966.

I don't see a particular need to backport it, since the only way to
trigger the segfault is by writing new code that will always trigger
the segfault when tested, and old code (using the deprecated APIs)
works.