svn-all-fast-export / svn2git

:octopus: A fast-import based converter for an svn repo to git repos
GNU General Public License v3.0
261 stars 100 forks source link

SYSCALL_ABORT triggered by broken pipe (invalid reader) #112

Open flip111 opened 4 years ago

flip111 commented 4 years ago

Here path is declared https://github.com/svn-all-fast-export/svn2git/blob/master/src/svn.cpp#L709 (supposingly intialized with null, looking at what gdb tells me).

Here it would have been changed if it wasn't null in the first place https://github.com/svn-all-fast-export/svn2git/blob/master/src/svn.cpp#L467-L471

Here it gets used https://github.com/svn-all-fast-export/svn2git/blob/master/src/svn.cpp#L874

Not sure if the path can be set somewhere between line 709 and 874 .. but in my case this doesn't happen and svn-all-fast-export crashes.

This is my rule file

create repository schreikasten
  description "This plugin enables a shoutbox widget, integrated with Wordpress look n' feel, using ajax to add comments and filtering comments with Akismet as spam filter."
end repository

match /trunk/
  repository schreikasten
  branch master
end match

match /tags/([^/]+)/
  repository schreikasten
  branch refs/tags/\1
end match

rsvndump compile from source (today)

# dependencies
sudo apt install libapr1-dev libaprutil1-dev libsvn-dev
# compile, install & delete source
git clone https://github.com/jgehring/rsvndump
cd rsvndump
./autogen.sh
./configure --prefix=$HOME/.local
make -j8
make install
cd ..
rm -rf rsvndump

These are the commands to create the repository

svnadmin create schreikasten
/usr/bin/time sh -c 'rsvndump https://plugins.svn.wordpress.org/schreikasten | svnadmin load schreikasten/'

Command line options

/home/flip111/tmp/svn2git/svn-all-fast-export --rules /home/flip111/tmp/rules.txt --add-metadata-notes --stats --empty-dirs /home/flip111/tmp/schreikasten

Backtrace

Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007f5beacbf899 in __GI_abort () at abort.c:79
#2  0x00007f5beb11aa99 in QMessageLogger::fatal(char const*, ...) const () from /lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x000055c86f1ceabc in QIODevice_write (baton=0x55c86f530180, 
    data=0x7f5be727d028 "msgid \"\"\nmsgstr \"\"\n\"Project-Id-Version: sk\\n\"\n\"Report-Msgid-Bugs-To: \\n\"\n\"POT-Creation-Date: 2009-11-25 11:02-0500\\n\"\n\"PO-Revision-Date: \\n\"\n\"Last-Translator: Juan Sebastián Echeverry <sebaxtian@gawa"..., len=0x7ffcff8a3900) at svn.cpp:239
#4  0x00007f5beb63023b in svn_stream_copy3 () from /lib/x86_64-linux-gnu/libsvn_subr-1.so.1
#5  0x000055c86f1cf096 in dumpBlob (txn=0x55c86f533030, fs_root=0x7f5beb700128, pathname=0x55c86f52c758 "/trunk/lang/sk.po", finalPathName=..., pool=0x7f5beb6fe028) at svn.cpp:299
#6  0x000055c86f1d38a0 in SvnRevision::exportInternal (this=0x7ffcff8a3e40, key=0x55c86f52c758 "/trunk/lang/sk.po", change=0x7f5be7291998, path_from=0x0, rev_from=-1, current=..., rule=..., 
    matchRules=...) at svn.cpp:874
#7  0x000055c86f1d1934 in SvnRevision::exportDispatch (this=0x7ffcff8a3e40, key=0x55c86f52c758 "/trunk/lang/sk.po", change=0x7f5be7291998, path_from=0x0, rev_from=-1, changes=0x7f5beb6fe0a0, 
    current=..., rule=..., matchRules=..., pool=0x7f5beb702028) at svn.cpp:687
#8  0x000055c86f1d0f9a in SvnRevision::exportEntry (this=0x7ffcff8a3e40, key=0x55c86f52c758 "/trunk/lang/sk.po", change=0x7f5be7291998, changes=0x7f5beb6fe0a0) at svn.cpp:637
#9  0x000055c86f1cfd83 in SvnRevision::prepareTransactions (this=0x7ffcff8a3e40) at svn.cpp:506
#10 0x000055c86f1cf471 in SvnPrivate::exportRevision (this=0x55c86f51cd60, revnum=2) at svn.cpp:414
#11 0x000055c86f1ce2cf in Svn::exportRevision (this=0x7ffcff8a3f28, revnum=2) at svn.cpp:154
#12 0x000055c86f1ddc4d in main (argc=7, argv=0x7ffcff8a40f8) at main.cpp:288

For reference i used qmake CONFIG+=debug to get debug symbols.

Vampire commented 4 years ago

I didn't look into the actual issue, but your assumptions are a bit off I think.

Here path is declared https://github.com/svn-all-fast-export/svn2git/blob/master/src/svn.cpp#L709 (supposingly intialized with null, looking at what gdb tells me).

Correct

Here it would have been changed if it wasn't null in the first place https://github.com/svn-all-fast-export/svn2git/blob/master/src/svn.cpp#L467-L471

This is not correct I think. The call in 710 is splitPathName(..., &path);, so a pointer to the path variable is given to the method. In 467 with if (path_p) { it is checked that the pointer is not null, not what it points to. And in 470 with *path_p = the variable the pointer points to is set, so after the method call in 710 returns, path is set.

Vampire commented 4 years ago

Your problem is, that you try to export the SVN repo in /home/flip111/tmp/schreikasten into the Git repo /home/flip111/tmp/schreikasten which is the same directory. As the directory already exists, svn2git assumes it is the Git directory (it supports incremental running) and does not create it. stderr tells you Failed to write to process: Error writing to process log-schreikasten tells you fatal: Not a git repository (or any of the parent directories): .git The latter is the message from git process that is started by svn2git to receive the generated dump stream. The former is from svn2git as it cannot write to the process as it wasn't able to start. Rename schreikasten to schreikasten.svn or whatever and use it as input, then your conversion will work properly.

Btw. just in case you didn't know, SVN has its own remote dump tool shipped called svnrdump.