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

"svn add" crashes in case of missing magic.mgc

From: Thorsten Schöning <tschoening_at_am-soft.de>
Date: Mon, 8 Jul 2019 17:51:20 +0200

Hi all,

I recently set up a new Synology NAs and tried to version some custom
scripts. While some SVN client was already available and checking out
an empty directory worked as expected, adding some file to the working
copy didn't. There wasn't any error by default, it seemed that adding
was successful, but it wasn't, instead the working copy was locked.

> svn add dasikomp_buero_hm
> svn st

> L .
> ? @eaDir
> ? dasikomp_buero_hm

Explicitly asking for the last error showed the problem:

> svn add %f && echo $@
> sh: line 1: 20166 Aborted (core dumped) svn add "test.txt"

Making strace available[1] lead to the root cause being the file
magic.mgc not found in usual places:

> strace svn add %f
> stat("/root/.magic.mgc", 0x7fff5f129370) = -1 ENOENT (No such file or directory)
> stat("/root/.magic", 0x7fff5f129370) = -1 ENOENT (No such file or directory)
> access("/opt/share/misc/magic.mime.mgc", R_OK) = -1 ENOENT (No such file or directory)
> open("/opt/share/misc/magic.mgc", O_RDONLY) = -1 ENOENT (No such file or directory)
> rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
> tgkill(21192, 21192, SIGABRT) = 0
> --- SIGABRT {si_signo=SIGABRT, si_code=SI_TKILL, si_pid=21192, si_uid=0} ---

Instead, the file was placed in the following path, which is a symlink
only as well:

> /usr/share/file/misc/magic.mgc -> /var/packages/DiagnosisTool/target/usr/share/file/misc/magic.mgc

The link target is part of DiagnosisTools, which is interesting
because that's exactly what has been installed using [1] to make
strace available. Without that package I didn't find any other
suitable file on the NAS.

Some things coming into my mind:

1. Should "svn add" really crash silently?
2. Should the symlink be recognized and tried like the other pathes?
3. Is path handling even something SVN cares about on it's own vs.
   libmagic or else?

The installed SVN-client:

> svn, version 1.9.7 (r1800392)
> compiled Jan 11 2018, 08:42:15 on x86_64-openwrt-linux-gnu

Is that worth filing a bug or fixed or known or ...? Thanks!

[1]: https://www.synology-wiki.de/index.php/Synogear:_weitere_Tools

Mit freundlichen Grüßen,

Thorsten Schöning

Thorsten Schöning       E-Mail: Thorsten.Schoening_at_AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/
Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04
AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow
Received on 2019-07-08 17:51:32 CEST

This is an archived mail posted to the Subversion Dev mailing list.