threads / discuss / 12235

Interrupted git-svn dcommit, now I get segmentation faults

Subject: Interrupted git-svn dcommit, now I get segmentation faults

## tl;dr

6 messages between Feb 21, 2008 and Mar 5, 2008.

replies: 5people: 2as markdown or json

Chris Ball· Feb 21, 2008, 06:49 UTC · lore
Hi,

I mistakenly interrupted a git-svn dcommit, and now whenever I run git-svn dcommit I get a segmentation fault, but the commit is successful. I have just switched from Subversion to Git, so I'm not sure what to do (and probably using Git in a clumsy way).

How I caused the problem:
$ git commit -m "msg" path/to/file
Created commit bee0414: msg
 1 files changed, 6 insertions(+), 0 deletions(-)
$ git-svn dcommit
Committing to https://svn/repository ...
	M	path/to/file
Committed r8041
# ** Interruption with ctrl-c happened right at this point **

git diff still showed the change on my machine, so I ran git-svn dcommit again:

$ git-svn dcommit Committing to https://svn/repository ... Merge conflict during commit: Your file or directory 'path/to/file' is probably out-of-date: The version resource does not correspond to the resource within the transaction. Either the requested version resource is out of date (needs to be updated), or the requested version resource is newer than the transaction root (restart the commit). at /usr/bin/git-svn line 420

Checking the SVN repository itself, I found the commit was actually successful (in that it appears as normal in the SVN respository). I deleted my copy of the file, ran 'git-svn rebase', and then used 'git checkout path/to/file. This gave me seemingly the correct version (i.e. with the updates).

This would all be ok, except that now, whenever I git-svn dcommit anything, this happens:

$ git-svn dcommit
Committing to https://svn/repository ...
	M	path/to/different/file
Committed r8044
Segmentation fault
The commit is successful (i.e. appears in the SVN repository).

Can anyone suggest what I should do? I still have a full transcript of the session in case that will help.

I'm using Ubuntu 6.06 LTS. My versions of git, git-svn, and svn (all from Ubuntu packages):

$ git --version git version 1.5.3.6 $ git-svn --version git-svn version 1.5.3.6 (svn 1.3.2)

Thanks very much for any help,
Chris
Sam Vilain· Feb 21, 2008, 19:27 UTC · re: Chris Ball · lore

Re: Interrupted git-svn dcommit, now I get segmentation faults

Chris Ball wrote:
Show 5 quoted lines
> Hi,
> 
> I mistakenly interrupted a git-svn dcommit, and now whenever I run
> git-svn dcommit I get a segmentation fault, but the commit is
> successful. I have just switched from Subversion to Git, so I'm not
 [...]
Show 11 quoted lines
> git diff still showed the change on my machine, so I ran git-svn dcommit
> again:
> 
> $ git-svn dcommit
> Committing to https://svn/repository ...
> Merge conflict during commit: Your file or directory 'path/to/file' is
> probably out-of-date: The version resource does not correspond to the
> resource within the transaction.  Either the requested version
> resource is out of date (needs to be updated), or the requested
> version resource is newer than the transaction root (restart the
> commit). at /usr/bin/git-svn line 420

If you get stuff like that you can move the git-svn state out of the way, and re-run git-svn fetch; it will rebuild the metadata.

 $ mv .git/svn .git/svn.bad
 $ git-svn fetch
Not a fix I know, but might work for you ;)
Sam.
C. E. Ball· Feb 22, 2008, 09:13 UTC · re: Sam Vilain · lore

Re: Interrupted git-svn dcommit, now I get segmentation faults

Show 7 quoted lines
>  If you get stuff like that you can move the git-svn state out of the
>  way, and re-run git-svn fetch; it will rebuild the metadata.
>
>   $ mv .git/svn .git/svn.bad
>   $ git-svn fetch
>
>  Not a fix I know, but might work for you ;)
Thank you very much, that did work for me!
Chris
C. E. Ball· Feb 22, 2008, 09:20 UTC · re: C. E. Ball · lore

Re: Interrupted git-svn dcommit, now I get segmentation faults

On Fri, Feb 22, 2008 at 5:13 PM, C. E. Ball <ceball@users.sourceforge.net> wrote:

Show 9 quoted lines
> >  If you get stuff like that you can move the git-svn state out of the
>  >  way, and re-run git-svn fetch; it will rebuild the metadata.
>  >
>  >   $ mv .git/svn .git/svn.bad
>  >   $ git-svn fetch
>  >
>  >  Not a fix I know, but might work for you ;)
>
>  Thank you very much, that did work for me!

Please ignore my previous email - I was in the wrong place on my filesystem! Sorry about that.

After following your suggestion on my broken repository, I still get the same error (a segmentation fault just after the commit is successfully sent to svn) when I 'git-svn dommit'.

Any other suggestions?

Thanks, Chris

Sam Vilain· Feb 23, 2008, 03:18 UTC · re: C. E. Ball · lore

Re: Interrupted git-svn dcommit, now I get segmentation faults

C. E. Ball wrote:
Show 20 quoted lines
> On Fri, Feb 22, 2008 at 5:13 PM, C. E. Ball
> <ceball@users.sourceforge.net> wrote:
>>>  If you get stuff like that you can move the git-svn state out of the
>>  >  way, and re-run git-svn fetch; it will rebuild the metadata.
>>  >
>>  >   $ mv .git/svn .git/svn.bad
>>  >   $ git-svn fetch
>>  >
>>  >  Not a fix I know, but might work for you ;)
>>
>>  Thank you very much, that did work for me!
> 
> Please ignore my previous email - I was in the wrong place on my
> filesystem! Sorry about that.
> 
> After following your suggestion on my broken repository, I still get
> the same error (a segmentation fault just after the commit is
> successfully sent to svn) when I 'git-svn dommit'.
> 
> Any other suggestions?

Well this is where the fun starts. Make sure you're on a new version of git - latest stable or built from "master" if possible. Start perl (or even debugperl if you have one built with debug symbols) with gdb, and get it to run git-svn and use "bt" to get a backtrace when you get the fault.

  $ gdb /usr/bin/debugperl
  ...
  > run ~/bin/git-svn dcommit
  ...
  --- SEGV ---
  > bt

That's the default place to start looking for clues. Otherwise it's a pretty much open-ended problem ... you would have to figure out (perhaps using the perl debugger, perhaps using test cases) what triggers it, what's not passing the correct thing to the SVN API, whether it's a version-specific SVN bug, etc. It's certainly not very common which makes me suspect the SVN::Core bindings and/or the stack beneath that part of it. The SVN API is ... fragile, and the codebase is bulky and poorly thought out. So, you get weird behaviour like the exception handler has to die() or you get a segfault, etc.

If that seems too daunting, perhaps just respond with the versions of everything you are using (eg perl -MSVN::Core -le 'print $SVN::Core::VERSION', git --version etc) find out if it's specific to the repository you're committing to, or (if you can) your system, etc, and perhaps someone else will have a better clue.

Good luck, Sam.

C. E. Ball· Mar 5, 2008, 09:00 UTC · re: Sam Vilain · lore

Re: Interrupted git-svn dcommit, now I get segmentation faults

On Sat, Feb 23, 2008 at 11:18 AM, Sam Vilain <sam@vilain.net> wrote:
Show 51 quoted lines
>
> C. E. Ball wrote:
>  > On Fri, Feb 22, 2008 at 5:13 PM, C. E. Ball
>  > <ceball@users.sourceforge.net> wrote:
>  >>>  If you get stuff like that you can move the git-svn state out of the
>  >>  >  way, and re-run git-svn fetch; it will rebuild the metadata.
>  >>  >
>  >>  >   $ mv .git/svn .git/svn.bad
>  >>  >   $ git-svn fetch
>  >>  >
>  >>  >  Not a fix I know, but might work for you ;)
>  >>
>  >>  Thank you very much, that did work for me!
>  >
>  > Please ignore my previous email - I was in the wrong place on my
>  > filesystem! Sorry about that.
>  >
>  > After following your suggestion on my broken repository, I still get
>  > the same error (a segmentation fault just after the commit is
>  > successfully sent to svn) when I 'git-svn dommit'.
>  >
>  > Any other suggestions?
>
>  Well this is where the fun starts.  Make sure you're on a new version of
>  git - latest stable or built from "master" if possible.  Start perl (or
>  even debugperl if you have one built with debug symbols) with gdb, and
>  get it to run git-svn and use "bt" to get a backtrace when you get the
>  fault.
>
>   $ gdb /usr/bin/debugperl
>   ...
>   > run ~/bin/git-svn dcommit
>   ...
>   --- SEGV ---
>   > bt
>
>  That's the default place to start looking for clues.  Otherwise it's a
>  pretty much open-ended problem ... you would have to figure out (perhaps
>  using the perl debugger, perhaps using test cases) what triggers it,
>  what's not passing the correct thing to the SVN API, whether it's a
>  version-specific SVN bug, etc.  It's certainly not very common which
>  makes me suspect the SVN::Core bindings and/or the stack beneath that
>  part of it.  The SVN API is ... fragile, and the codebase is bulky and
>  poorly thought out.  So, you get weird behaviour like the exception
>  handler has to die() or you get a segfault, etc.
>
>  If that seems too daunting, perhaps just respond with the versions of
>  everything you are using (eg perl -MSVN::Core -le 'print
>  $SVN::Core::VERSION', git --version etc) find out if it's specific to
>  the repository you're committing to, or (if you can) your system, etc,
>  and perhaps someone else will have a better clue.

Thanks very much for taking the time to help with this. After beginning to follow your suggestions, I decided it was too difficult for me to debug the problem, so I started again with a new repository!

I have no problems at all now. I've been using git (and git-svn) for about two weeks now, and I'm really impressed. Previously I had tried to work with this particular svn repository using bzr and its svn plugin, but found it to be too slow (maybe because of some large binary files, but I'm not sure). Apart from being fast, git also doesn't seem to get in my way when I'm working.

Chris

← back to recent threads