You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Trent Fisher <tr...@oracle.com> on 2014/04/28 19:19:03 UTC

Bogus HOME causes segfault

I know this probably falls into the "Doctor, it hurts when I do this" 
category, but I found a probable bug in Subversion 1.8.5 where an 
invalid HOME directory results in a segfault.  For example:

$ HOME=/dev/null svn --version
svn: warning: W000020: Can't open file '/dev/null/.subversion/servers': 
Not a directory
Segmentation fault (core dumped)

This does not happen with versions 1.7.8 or 1.6.16 (the other two I had 
handy).  On those, it gives me the same warning, but does not segfault.  
I have yet to try 1.8.8 as I don't have it installed anywhere yet.  This 
also happens with an unreadable directory (i.e. /root), but it does not 
happen if given a nonexistent directory (i.e. "/foo/bar")

Why do I care?  The php script with repos-web does an svn log, and the 
HOME environment variable ends up containing "/root" which is not 
readable to the repository owner.  I have implemented a workaround, but 
it seems to me that a segfault is never a good answer, even if I am 
doing something stupid :)

++thanks,
trent...

Re: Bogus HOME causes segfault

Posted by Philip Martin <ph...@wandisco.com>.
Trent Fisher <tr...@oracle.com> writes:

> $ HOME=/dev/null svn --version
> svn: warning: W000020: Can't open file '/dev/null/.subversion/servers': Not a directory
> Segmentation fault (core dumped)

Thanks for the report. Fixed with http://svn.apache.org/r1590751

-- 
Philip Martin | Subversion Committer
WANdisco // *Non-Stop Data*

Re: Bogus HOME causes segfault

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Apr 28, 2014, at 12:19, Trent Fisher wrote:

> $ HOME=/dev/null svn --version
> svn: warning: W000020: Can't open file '/dev/null/.subversion/servers': Not a directory
> Segmentation fault (core dumped)

Yup, I see that too, on OS X.


Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libapr-1.0.dylib              	0x0000000104af0f4d find_entry + 31
1   libapr-1.0.dylib              	0x0000000104af0f18 apr_hash_get + 15
2   svn                           	0x00000001045b8990 sub_main + 4874
3   svn                           	0x00000001045b766d main + 81
4   libdyld.dylib                 	0x00007fff8cd245fd start + 1


$ port installed apr apr-util subversion
The following ports are currently installed:
  apr @1.5.0_0+universal (active)
  apr-util @1.5.3_0+universal (active)
  subversion @1.8.8_0+mod_dav_svn+tools+universal (active)


$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.9.2
BuildVersion:	13C64