pkg / sftp

SFTP support for the go.crypto/ssh package
BSD 2-Clause "Simplified" License
1.5k stars 380 forks source link

statfs hangup, regression in commit 861a8ea (Feb 22, 2021, v1.13.0) #466

Closed AkihiroSuda closed 3 years ago

AkihiroSuda commented 3 years ago

https://github.com/lima-vm/sshocker hangs up when it is compiled with commit 861a8ea (Feb 22, 2021, v1.13.0) and later.

Reproduction step:

git clone https://github.com/lima-vm/sshocker.git
cd sshocker
git checkout v0.2.0
go get github.com/pkg/sftp@861a8eaf5c37b4ad5b2f1d0fc61004101bbdcb49
make
make install
mkdir /tmp/foo
sshocker -v /tmp/foo:/home/user/mnt:ro example.com df

(the remote host example.com is Ubuntu 21.04 with sshfs 2.10.0, the local host is macOS 11)

The df command executed on the remote host hangs up because statfs(2) hangs up.

This is a regression in commit 861a8ea (Feb 22, 2021, v1.13.0). The previous commit 1d73fd92d5dd1779f4123b6063d9bbb052600d4f works as expected.

puellanivis commented 3 years ago

Poking around at things, it does not appear that the statfs call is actually locking up. But the call definitely is still locking up, so I’m poking at things now.

puellanivis commented 3 years ago

Found the issue: https://github.com/pkg/sftp/commit/861a8eaf5c37b4ad5b2f1d0fc61004101bbdcb49#diff-cc2782728612ca8e00dada25397c6e9cd54e8952a3ed46e98b114fc4bc5293deL17

I will be pushing a PR soon to address the issue.

puellanivis commented 3 years ago

@AkihiroSuda could you try out this branch: https://github.com/pkg/sftp/pull/467 and see if it resolves the issue? If it does, we’ll merge it and cut a patch release.

AkihiroSuda commented 3 years ago

Yes, #467 works, thank you

puellanivis commented 3 years ago

Closing as resolved in v1.13.3