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

Re: Merging Ctypes Python Branch

From: Eric Gillespie <epg_at_pretzelnet.org>
Date: 2007-08-31 02:23:10 CEST

remoterepos.RemoteRepositoryTestCase segfaults for me:

#0 0xf7e2d868 in skip_uri_scheme (path=0x1 <Address 0x1 out of bounds>)
    at subversion/libsvn_subr/path.c:791
#1 0xf7e2d90f in svn_path_is_url (path=0x1 <Address 0x1 out of bounds>)
    at subversion/libsvn_subr/path.c:813
#2 0xf7e2debf in svn_path_get_absolute (pabsolute=0xffff9b64,
    relative=0x1 <Address 0x1 out of bounds>, pool=0x8462970)
    at subversion/libsvn_subr/path.c:1093
#3 0xf7c74144 in svn_client_import3 (commit_info_p=0xf7ad7c68,
    path=0xf7ae773c "/tmp/newfile.txt",
    url=0xf7ae4734 "file:///tmp/svn_test_repos", nonrecursive=0, no_ignore=1,
    ignore_unknown_node_types=0, ctx=0x84669b8, pool=0x8462970)
    at subversion/libsvn_client/commit.c:693
#4 0xf7c745f6 in svn_client_import2 (commit_info_p=0xf7ad7c68,
    path=0xf7ae773c "/tmp/newfile.txt",
    url=0xf7ae4734 "file:///tmp/svn_test_repos", nonrecursive=0, no_ignore=1,
    ctx=0x84669b8, pool=0x8462970) at subversion/libsvn_client/commit.c:820
#5 0xf7f31423 in ffi_call_SYSV () from /usr/lib/libffi.so.4
#6 0xf7f31282 in ffi_call () from /usr/lib/libffi.so.4
#7 0xf7f560c0 in _call_function_pointer (flags=4097,
    pProc=0xf7c745c0 <svn_client_import2>, avalues=0xffff9ce0,
    atypes=0xffff9cc0, restype=0xf7f61ce4, resmem=0xffff9d00, argcount=7)
    at source/callproc.c:665
#8 0xf7f56874 in _CallProc (pProc=0xf7c745c0 <svn_client_import2>,
    argtuple=0xf7ae425c, flags=4097, argtypes=0xf7be88b4, restype=0xf7f22bc4,
    checker=0x0) at source/callproc.c:988
#9 0xf7f52368 in CFuncPtr_call (self=0xf7c036ac, inargs=0xf7ae425c, kwds=0x0)
    at source/_ctypes.c:3357

path is bogus (0x1), which comes from svn_client_import2:

      SVN_ERR(svn_client__get_log_msg(&log_msg, &tmp_file, commit_items,
                                      ctx, pool));
      if (! log_msg)
        return SVN_NO_ERROR;
      if (tmp_file)
        {
          const char *abs_path;
          SVN_ERR(svn_path_get_absolute(&abs_path, tmp_file, pool));
          apr_hash_set(excludes, abs_path, APR_HASH_KEY_STRING, (void *)1);
        }
    }

So, I looked at RemoteRepository._log_func_wrapper, which I think
is bogus:

    def _log_func_wrapper(log_msg, tmp_file, commit_items, baton, pool):
        self = cast(baton, py_object).value
        if self._log_func:
            [log, file] = self._log_func(_types.Array(String, commit_items))
            
            if log:
                log_msg = pointer(c_char_p(log))
            else:
                log_msg = NULL
                
            if file:
                tmp_file = pointer(c_char_p(file))
            else:
                tmp_file = NULL

This changes what the local variables log_msg and tmp_file point
to, but does *not* modify anything the parent passed in.
svn_client_import2 thus ends up with whatever value was on the
stack when tmp_file is allocated.

-- 
Eric Gillespie <*> epg@pretzelnet.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Aug 31 02:20:15 2007

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.