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

SWIG svn.client.log5 and invalid revision range array

From: Blair Zajac <blair_at_orcaware.com>
Date: Fri, 25 Sep 2009 09:58:22 -0700

Trying to write a Python script that uses svn.client.log5() with 1.6.5, it
appears that the SWIG wrapper doesn't handle the new apr_array_header_t
*revsion_ranges argument. I am able to use log4() successfully.

Looking at the generated binding code, the first apr_array_header_t *targets
argument is handled by:

     arg1 = (apr_array_header_t *) svn_swig_py_strings_to_array(obj0,
       _global_pool);

but the apr_array_header_t *revsion_ranges is handled by:

     arg3 = (apr_array_header_t *)svn_swig_MustGetPtr(obj2,
SWIGTYPE_p_apr_array_header_t, svn_argnum_obj2);

The values in the apr_array_header_t * that svn_client_log5 receives refer to
invalid memory addresses.

(gdb) bt
#0 svn_client_log5 (targets=0x1955d7f8, peg_revision=0x1949e6c0,
     revision_ranges=0x1949e6c0, limit=0, discover_changed_paths=1,
     strict_node_history=0, include_merged_revisions=0, revprops=0x0,
     real_receiver=0x2b206dce4a80 <svn_swig_py_log_entry_receiver>,
     real_receiver_baton=0x2b207178c758, ctx=0x194aa9b8, pool=0x1955d778)
     at subversion/libsvn_client/log.c:307
#1 0x00002b206daa41d3 in _wrap_svn_client_log5 (self=<value optimized out>,
     args=<value optimized out>)
     at subversion/bindings/swig/python/svn_client.c:10322

(gdb) p *revision_ranges
$7 = {pool = 0x1, elt_size = 10, nelts = 0, nalloc = 0,
   elts = 0xc11 <Address 0xc11 out of bounds>}

Is there a straightforward fix for this? I'm not familiar with SWIG and how to
tell it to handle this.

Regards,
Blair

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2400326
Received on 2009-09-25 18:58:42 CEST

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.