hbons / SparkleShare

Share and collaborate by syncing with any Git repository instantly. Linux, macOS, and Windows.
https://sparkleshare.org
Other
4.88k stars 579 forks source link

Segfault with "Could not find [..] /.git/info/size" or "history_size" #1842

Closed Ppjet6 closed 6 years ago

Ppjet6 commented 6 years ago

Running Archlinux and SparkleShare built from source, (master, f9c60cbd3).

What happened:

18:42:34 Git | repo | Failed to parse /home/user/SparkleShare/server/repo/.git/info/size: Could not find file "/home/user/SparkleShare/server/repo/.git/info/size"   at System.IO.FileStream.
.ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0019e] in <7ba6043a0ffb47c2b3b3a171ba27d349>:0

  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy,
 System.Boolean useLongPath, System.Boolean checkHost) [0x00000] in <7ba6043a0ffb47c2b3b3a171ba27d349>:0
  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize, System.Boolean checkHost) [0x00067] in <7ba6043a0ffb47c2b3b3a171ba27d349>:0
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize) [0x00000] in <7ba6043a0ffb47c2b3b3a171ba27d349>:0
  at System.IO.StreamReader..ctor (System.String path, System.Boolean detectEncodingFromByteOrderMarks) [0x0000d] in <7ba6043a0ffb47c2b3b3a171ba27d349>:0
  at System.IO.StreamReader..ctor (System.String path) [0x00000] in <7ba6043a0ffb47c2b3b3a171ba27d349>:0
  at (wrapper remoting-invoke-with-check) System.IO.StreamReader..ctor(string)
  at System.IO.File.ReadAllText (System.String path) [0x00000] in <7ba6043a0ffb47c2b3b3a171ba27d349>:0 
  at Sparkles.Git.GitRepository.get_Size () [0x0001d] in <553e46f2f9704cbf8bd452ecc7bba727>:0

18:42:34 Git | repo | Failed to parse /home/user/SparkleShare/server/repo/.git/info/history_size: Could not find file "/home/user/SparkleShare/server/repo/.git/info/history_size"   at Syste
m.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x0019e] in <7ba6043a0ffb47c2b3b
3a171ba27d349>:0                                                                                       
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy,
 System.Boolean useLongPath, System.Boolean checkHost) [0x00000] in <7ba6043a0ffb47c2b3b3a171ba27d349>:0
  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize, System.Boolean checkHost) [0x00067] in <7ba6043a0ffb47c2b3b3a171ba27d349>:0
  at System.IO.StreamReader..ctor (System.String path, System.Text.Encoding encoding, System.Boolean detectEncodingFromByteOrderMarks, System.Int32 bufferSize) [0x00000] in <7ba6043a0ffb47c2b3b3a171ba27d349>:0
  at System.IO.StreamReader..ctor (System.String path, System.Boolean detectEncodingFromByteOrderMarks) [0x0000d] in <7ba6043a0ffb47c2b3b3a171ba27d349>:0
  at System.IO.StreamReader..ctor (System.String path) [0x00000] in <7ba6043a0ffb47c2b3b3a171ba27d349>:0
  at (wrapper remoting-invoke-with-check) System.IO.StreamReader..ctor(string)                         
  at System.IO.File.ReadAllText (System.String path) [0x00000] in <7ba6043a0ffb47c2b3b3a171ba27d349>:0
  at Sparkles.Git.GitRepository.get_HistorySize () [0x0001d] in <553e46f2f9704cbf8bd452ecc7bba727>:0   

What I expected to happen:

No error, or some kind of error message, without segfault.

This happens when:

  1. Setup repository via sparkleshare. (Sync Remote Project > Own Server > Add).
  2. This happens just after cloning the repo
hbons commented 6 years ago

Did it actually crash or does it keep running?

rob-hills commented 6 years ago

This looks suspiciously like the problem I am having on my Ubuntu 18.04 system. @Ppjet6 does the path /home/user/SparkleShare/server/repo/ actually exist on your client computer? I suspect not. I assume that "server" is your host machine (the "address" part of the "Add project" dialog), yes?

Ppjet6 commented 6 years ago

On 2018/05/10, Hylke Bons wrote:

Did it actually crash or does it keep running?

I get the tracebacks but it seems to continue running, yes.

On 2018/05/10, Rob Hills wrote:

does the path /home/user/SparkleShare/server/repo/ actually exist on your client computer? I suspect not.

The folders are here. The files being looked up in .git are not here.

-- Maxime “pep” Buquet

hbons commented 6 years ago

This is fixed by https://github.com/hbons/SparkleShare/commit/4e0dff6956c7c78858c3929650554cb302c29634. It wasn't actually harmful, just some overly verbose errors.