Shlomi Fish once wrote a svn-push.c that according to him, will propagate changesets from one (networked) repository to another.
I found no one who actually got it to work so I dove in. Using the minimal-client.c as an example, I added an authentication piece. The authentication now works but seems like the routine crashes in make_reporter(), which is called by svn_ra_dav__do_diff. It also appears that the SVN guys made some wholesale changes in the reporter module – not sure if that is related. Hopefully someone will pay attention to this and comment.
I will post my version of svn-push.c to my public repo soon.
Here’s the svn-push.c that I modified. svn-push.c
bash-2.04$ gdb ./svn-push
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type “show copying” to see the conditions.
There is absolutely no warranty for GDB. Type “show warranty” for details.
This GDB was configured as “sparc-sun-solaris2.8″…Dwarf Error: Cannot handle DW_FORM_strp in DWARF reader.
(gdb) set args -r 757:758 http://src.domain.com/srcrepo/module svn+ssh://svn@dest.domain.com/destrepo/module
(gdb) run
Starting program: svn-push-r 757:758 http://src.domain.com/srcrepo/module svn+ssh://svn@dest.domain.com/destrepo/module
(no debugging symbols found)…(no debugging symbols found)…(no debugging symbols found)…
(no debugging symbols found)…(no debugging symbols found)…(no debugging symbols found)…
Before auth open
After auth open
Before opening src
Before opening dest
svn@dest.domain.com’s password: ****
Before opening commit_editor
Authentication realm: <http://src.domain.com:80> kreaper’s src Repository
Password:
Authentication realm: <http://src.domain.com:80> kreaper’s src Repository
Username: testuser
Password: ****
After commit editor
before do diff
Program received signal SIGSEGV, Segmentation fault.
0×0 in ?? ()
(gdb) where
#0 0×0 in ?? ()
#1 0x7f514558 in make_reporter () from /home/rajeev/svn/lib/libsvn_ra_dav-1.so.0
#2 0x7f514d20 in svn_ra_dav__do_diff () from /home/rajeev/svn/lib/libsvn_ra_dav-1.so.0
#3 0x7f505c98 in compat_do_diff () from /home/rajeev/svn/lib/libsvn_ra_dav-1.so.0
#4 0×11558 in ?? ()
(gdb) bt -3
#2 0x7f514d20 in svn_ra_dav__do_diff () from /home/rajeev/svn/lib/libsvn_ra_dav-1.so.0
#3 0x7f505c98 in compat_do_diff () from /home/rajeev/svn/lib/libsvn_ra_dav-1.so.0
#4 0×11558 in ?? ()
(gdb) bt 5
#0 0×0 in ?? ()
#1 0x7f514558 in make_reporter () from /home/rajeev/svn/lib/libsvn_ra_dav-1.so.0
#2 0x7f514d20 in svn_ra_dav__do_diff () from /home/rajeev/svn/lib/libsvn_ra_dav-1.so.0
#3 0x7f505c98 in compat_do_diff () from /home/rajeev/svn/lib/libsvn_ra_dav-1.so.0
#4 0×11558 in ?? ()
(gdb) trace make_reporter
Tracepoint 1 at 0x7f5143d4
(gdb) info tp
Num Enb Address PassC StepC What
1 y 0x7f5143d4 0 0 <make_reporter+4>
(gdb) disas 0x7f514558
Dump of assembler code for function make_reporter:
0x7f5143d0 <make_reporter>: save %sp, -144, %sp
0x7f5143d4 <make_reporter+4>: sethi %hi(0×32400), %l7
0x7f5143d8 <make_reporter+8>: call 0x7f50d470 <svn_ra_dav__get_file_revs+1096>
0x7f5143dc <make_reporter+12>: add %l7, 0×380, %l7 ! 0×32780
0x7f5143e0 <make_reporter+16>: st %i0, [ %fp + 0x44 ]
0x7f5143e4 <make_reporter+20>: st %i1, [ %fp + 0x48 ]
0x7f5143e8 <make_reporter+24>: st %i2, [ %fp + 0x4c ]
0x7f5143ec <make_reporter+28>: st %i3, [ %fp + 0x50 ]
0x7f5143f0 <make_reporter+32>: st %i4, [ %fp + 0x54 ]
0x7f5143f4 <make_reporter+36>: st %i5, [ %fp + 0x58 ]
0x7f5143f8 <make_reporter+40>: ld [ %fp + 0x44 ], %g1
0x7f5143fc <make_reporter+44>: ld [ %g1 + 8 ], %g1
0x7f514400 <make_reporter+48>: st %g1, [ %fp + -20 ]
0x7f514404 <make_reporter+52>: ld [ %fp + 0x7c ], %o0
0x7f514408 <make_reporter+56>: mov 0×70, %o1
0x7f51440c <make_reporter+60>: call 0x7f5478d0 <checklist.3+3784>
0x7f514410 <make_reporter+64>: nop
0x7f514414 <make_reporter+68>: mov %o0, %g1
0x7f514418 <make_reporter+72>: mov %g1, %o0
0x7f51441c <make_reporter+76>: clr %o1
0x7f514420 <make_reporter+80>: mov 0×70, %o2
0x7f514424 <make_reporter+84>: call 0x7f5479a8 <checklist.3+4000>
0x7f514428 <make_reporter+88>: nop
0x7f51442c <make_reporter+92>: st %o0, [ %fp + -24 ]
0x7f514430 <make_reporter+96>: ld [ %fp + -24 ], %o5
0x7f514434 <make_reporter+100>: ld [ %fp + -20 ], %g1
0x7f514438 <make_reporter+104>: st %g1, [ %o5 ]
0x7f51443c <make_reporter+108>: ld [ %fp + -24 ], %o5
0x7f514440 <make_reporter+112>: ld [ %fp + 0x7c ], %g1
0x7f514444 <make_reporter+116>: st %g1, [ %o5 + 8 ]
0x7f514448 <make_reporter+120>: ld [ %fp + -24 ], %l0
0x7f51444c <make_reporter+124>: ld [ %fp + 0x7c ], %o0
0x7f514450 <make_reporter+128>: clr %o1
0x7f514454 <make_reporter+132>: call 0x7f547ccc <checklist.3+4804>
0x7f514458 <make_reporter+136>: nop
0x7f51445c <make_reporter+140>: st %o0, [ %l0 + 0xc ]
0x7f514460 <make_reporter+144>: ld [ %fp + -24 ], %o5
0x7f514464 <make_reporter+148>: ld [ %fp + 0x68 ], %g1
0x7f514468 <make_reporter+152>: st %g1, [ %o5 + 0x18 ]
0x7f51446c <make_reporter+156>: ld [ %fp + -24 ], %o5
0x7f514470 <make_reporter+160>: ld [ %fp + 0x6c ], %g1
0x7f514474 <make_reporter+164>: st %g1, [ %o5 + 0x1c ]
0x7f514478 <make_reporter+168>: ld [ %fp + -24 ], %o5
0x7f51447c <make_reporter+172>: ld [ %fp + 0x70 ], %g1
0x7f514480 <make_reporter+176>: st %g1, [ %o5 + 0x10 ]
0x7f514484 <make_reporter+180>: ld [ %fp + -24 ], %g1
0x7f514488 <make_reporter+184>: clr [ %g1 + 0x54 ]
0x7f51448c <make_reporter+188>: ld [ %fp + -24 ], %l0
0x7f514490 <make_reporter+192>: sethi %hi(0×400), %g1
0x7f514494 <make_reporter+196>: or %g1, 0x18c, %g1 ! 0x58c
0x7f514498 <make_reporter+200>: ld [ %l7 + %g1 ], %g1
0x7f51449c <make_reporter+204>: mov %g1, %o0
~snip~
waaaaaaaaaaaa
Technorati Tags: subversion, gdb,svn-push












Date: Wed, 04 Jan 2006 23:30:08 +0000
From: Max Bowsher
Content-Type: text/plain; charset=ISO-8859-1
Subject: svn-push segfaulting in make_reporter()
Karamchedu, Rajeev K. wrote:
> Is this a bug ? my svn-push seems to be dying in make_reporter(). See
> details below:
>
> Like a few others, I am trying to get svn-push going as well.
>
> The svn-push.c found in the contrib dir doesn’t do anything. It seg
> faults whenever a http authentication is encountered.
>
> I added some auth routines based on the tools/examples/minimal-client.c
> and atleast got the authentication to work. The code itself is at
>
> http://svn.tigr.org/filedetails.php?repname=tigr&path=%2Frajeev%2Ftrunk%2Fsvn-push.c
>
> Now the logic stops and seg-faults in make_reporter(), which is called
> by svn_ra_do_diff().
> I have documented all this at
> http://rajeev.name/2006/01/02/svn-pushc-crashes-in-make_reporter-3/
>
> but here is the relevant GDB output. It looks like a bug to me in either
> neon or make_reporter. but I am not an active programmer. I just need SVN
> Mirroring to work!
Under these circumstances, I question whether svn-push.c is the right
course to follow – it is more of a toy than an actual tool, as evidenced
by the fact that it makes no attempt whatsoever to copy log messages
(replacing them with “Hello, world!” !!!), authors, or dates.
> gdb) set args -r 757:758 http://src.domain.com/srcrepo/module
> svn+ssh://svn@dest.domain.com/destrepo/module
> (gdb) run
…
> Program received signal SIGSEGV, Segmentation fault.
> 0×0 in ?? ()
> (gdb) where
> #0 0×0 in ?? ()
> #1 0x7f514558 in make_reporter () from
> /home/rajeev/svn/lib/libsvn_ra_dav-1.so.0
You really need to build subversion with debug symbols for gdb
backtraces to give more than a vague idea of the problem location.
It turns out that the problem is that svn-push.c is failing to
initialize the non-optional open_tmp_file ra_callback. This just happens
to work with ra_local, but breaks when using ra_dav.
(I’m about to commit a fix to svn-push.c)
Max.
—–BEGIN PGP SIGNATURE—–
Version: GnuPG v1.4.1 (Cygwin)
iD8DBQFDvFqAfFNSmcDyxYARAkzuAJ4wQm67ffv5+pDCzZoD7lhxbdR6TgCgobYB
wYaFdKQ/Eixr9HYajTNy9Yo=
=6IUz
—–END PGP SIGNATURE—–