You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Charles Duffy <ch...@dyfis.net> on 2007/12/02 20:01:17 UTC

ctypes -- segfault running example.py on a 64-bit system

svn_cmdline_setup_auth_baton() is being called with an invalid parameter 
in the cfg value. Since the lower 32 bits are null, I'm thinking it's 
probably not a huge jump to guess that this is an issue with the ctypes 
bindings not being 64-bit-clean.

Built against svn 1.4.4 (r25188); the ctypes code is at r27622.

Incidentally, I'm trying to use the ctypes bindings because last time I 
checked, it wasn't possible to drive an editor over the diff between two 
revisions through either the RA layer's SWIG-based Python bindings or pysvn.

===

(gdb) run example.py
Starting program: /usr/bin/python example.py
Repos UUID:  11ca8fda-3ff4-4ee1-9e0b-c010089aedf4
Committed revision 1
Committed revision 2
Committed revision 3

Program received signal SIGSEGV, Segmentation fault.
find_option (cfg=0x7fff00000000, section=0x2afabb28d158 "auth", 
option=0x2afabb28d16b "store-passwords", sectionp=0x7ffff337bb50) at 
subversion/libsvn_subr/config.c:366
366       svn_stringbuf_set(cfg->tmp_key, section);
(gdb) bt
#0  find_option (cfg=0x7fff00000000, section=0x2afabb28d158 "auth", 
option=0x2afabb28d16b "store-passwords", sectionp=0x7ffff337bb50) at 
subversion/libsvn_subr/config.c:366
#1  0x00002afabb275d19 in svn_config_get (cfg=0x7fff00000000, 
valuep=0x7ffff337bb88, section=0x2afabb28d158 "auth", 
option=0x2afabb28d16b "store-passwords", default_value=0x0) at 
subversion/libsvn_subr/config.c:537
#2  0x00002afabb275f06 in svn_config_get_bool (cfg=0x7fff00000000, 
valuep=0x7ffff337bbe4, section=0x2afabb28d16b "store-passwords", 
option=0x7ffff337bb50 "Hâ–’", default_value=1) at 
subversion/libsvn_subr/config.c:615
#3  0x00002afabb274960 in svn_cmdline_setup_auth_baton (ab=0xd32848, 
non_interactive=1, auth_username=0x2afab7847134 "joecommitter", 
auth_password=0x0, config_dir=0x0, no_auth_cache=1, cfg=0x7fff00000000, 
cancel_func=0,
     cancel_baton=0x0, pool=0xaee508) at 
subversion/libsvn_subr/cmdline.c:438
#4  0x00002afab8897e80 in ffi_call_unix64 () at 
/usr/src/debug/dev-lang/python-2.5.1-r2/Python-2.5.1/Modules/_ctypes/libffi/src/x86/unix64.S:73

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: ctypes -- segfault running example.py on a 64-bit system

Posted by David James <ja...@cs.toronto.edu>.
Hi Charles,

> #3  0x00002afabb274960 in svn_cmdline_setup_auth_baton (ab=0xd32848,
> non_interactive=1, auth_username=0x2afab7847134 "joecommitter",
> auth_password=0x0, config_dir=0x0, no_auth_cache=1, cfg=0x7fff00000000,
> cancel_func=0,
>      cancel_baton=0x0, pool=0xaee508) at

Where is svn_cmdline_setup_auth_baton getting that value of "cfg"? The
only caller of svn_cmdline_setup_auth_baton in the csvn bindings is in
csvn/auth.py, and it passes in 'NULL' for cfg (which evaluates to
"None").

Try the following patch:

Index: csvn/auth.py
===================================================================
--- csvn/auth.py        (revision 28191)
+++ csvn/auth.py        (working copy)
@@ -58,6 +58,6 @@
         # Setup the auth baton using the default options from the
         # command-line client
         svn_cmdline_setup_auth_baton(auth_baton, TRUE,
-            self._username, self._password, NULL, TRUE, NULL,
+            self._username, self._password, NULL, TRUE,
POINTER(svn_config_t)(),
             svn_cancel_func_t(), NULL, self.pool)


I hope that there is no difference between None and a NULL pointer,
because I usually assume that they are the same.

Cheers,

David

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org