Code Monkey home page Code Monkey logo

Comments (22)

hanwen avatar hanwen commented on August 12, 2024

Thanks for the report. I need more information

  • Which go-mtpfs version are you using? Can you reproduce this with the latest version? (it should be very easy to compile on debian. See https://github.com/hanwen/go-mtpfs/blob/master/README)
  • Is the problem related to file size/file content? What happens if you try other large files? Is there a threshold that makes it fail? What was the original file size? What if you try different content (eg. /dev/random output?)
  • Do you have enough space on the device? Do you have enough free space on /tmp ?
  • What version of android does your tablet run exactly?
  • What command do you run to copy the files?

from go-mtpfs.

Raulvo avatar Raulvo commented on August 12, 2024

I'm using the latest version from your GIT repository, that's the one used
by the following PPA: https://launchpad.net/~webupd8team/+archive/unstable
The libmtp versión is 1.1.5.

I have also tested compiling go-mtpfs from GIT and has the exact same
behaviour. It can't copy those files.

  • Is the problem related to file size/file content? What happens if you
    try other large files? Is there a threshold that makes it fail? What was
    the original file size? What if you try different content (eg. /dev/random
    output?)

I have tried with another file with a size of 4,42 GiB and couldn't either
finalize the copy. But I have found that the problem might be related to
file size, see below.

  • Do you have enough space on the device? Do you have enough free space
    on /tmp ?

Yes, I have enough space both on the device and the /tmp directory.

  • What version of android does your tablet run exactly?

The tablet runs the stock Android ROM, versión 4.2.1

  • What command do you run to copy the files?

I have used both cp from the command line and the Nautilus file manager.

go-mtpfs returns the following error when I try to mount: Error: Unable to
open ~/.mtpz-data for reading.

And the rest of the output:
Android device detected, assigning default bug flags

2013/01/15 18:58:49 storage ID 65537: Almacenamiento interno
2013/01/15 18:58:49 backing data /tmp/go-mtpfs305997652
2013/01/15 18:58:49 starting FUSE unknown
2013/01/15 19:01:28 fetched ".cntrsa1", 40 bytes in 10 ms. 0.0 MB/s

I've tested with two files, one 4,7 GB in size and the other 2,4 GB.
After finishing the copying of a file go-mtpfs added the following output:

2013/01/15 19:03:27 sending file "(HDG) Dredd 2012 (BDRip 720p x264

VOenSUBes AC3Eng).mkv" to device: 4748222391 bytes.
2013/01/15 19:03:53 sent 4748222391 bytes in 26024 ms. 182.5 MB/s
2013/01/15 19:04:11 fetched "(HDG) Dredd 2012 (BDRip 720p x264 VOenSUBes
AC3Eng).mkv", 4748222391 bytes in 16260 ms. 292.0 MB/s

Still, the real copied data is 400 MB instead the 4,7 GB. Copying a file of
2,4 GiB results works without any problems. When Nautilus has finished the
copying, it gets frozen for some seconds while on the terminal go-mtpfs
shows this message:

2013/01/15 19:06:50 sending file "El Hobbit DVDScreener Castellano MIC
jfcm92 PT.avi" to device: 2379599872 bytes.

And when Nautilus unfreezes go-mtpfs outputs the following:

2013/01/15 19:08:45 sent 2379599872 bytes in 115019 ms. 20.7 MB/s
2013/01/15 19:09:17 Unimplemented opcode INTERRUPT

With this file size it has fully copied it without problems.

Copying with cp -a both files after deletion returns the following output:

2013/01/15 19:10:05 Unimplemented opcode POLL

2013/01/15 19:26:18 sending file "(HDG) Dredd 2012 (BDRip 720p x264
VOenSUBes AC3Eng).mkv" to device: 4748222391 bytes.
2013/01/15 19:26:19 can't convert error type: PTP Layer error 2009:
LIBMTP_Delete_Object(): could not delete object.
Error 2009: PTP: Invalid Object Handle
2013/01/15 19:28:40 sending file "El Hobbit DVDScreener Castellano MIC
jfcm92 PT.avi" to device: 2379599872 bytes.
2013/01/15 19:28:42 can't convert error type: PTP Layer error 2009:
LIBMTP_Delete_Object(): could not delete object.
Error 2009: PTP: Invalid Object Handle

For whatever reason after deleting the files on the tablet and trying to
copy again without remounting, cp returned an Input/Output error while
closing the file, that's why the PTP layer error surfaces.

cp: cerrando «nexu10mount/Almacenamiento interno/Movies/./El Hobbit
DVDScreener Castellano MIC jfcm92 PT.avi»: Error de entrada/salida

So all in all, it seems that files larger than 4GB are not supported and
go-mtpfs/libmtp has some quirks but if I remount I can copy again the files.

I hope this is enough information.

from go-mtpfs.

hanwen avatar hanwen commented on August 12, 2024

the problem seems to be in libmtp

http://libmtp.git.sourceforge.net/git/gitweb.cgi?p=libmtp/libmtp;a=blob;f=src/ptp.h;h=0cc7440d4e0efeee4d0059980da960a010a19c25;hb=HEAD#l2301

this is sending files by defining a uint32 filesize. In effect, only (data%4G) bytes are sent, which explains why you are seeing speeds that are way too fast:

4748222391 bytes in 16260 ms. 292.0 MB/s

normal transfers are at about ~10mb/s.

I'll take this up with the libmtp maintainers.

from go-mtpfs.

Raulvo avatar Raulvo commented on August 12, 2024

Ok, thank you for your attention. http://www.libreoffice.org/

from go-mtpfs.

hanwen avatar hanwen commented on August 12, 2024

I have a patch for libmtp that should make this work. I just need a few days to get it signed off at work.

from go-mtpfs.

hanwen avatar hanwen commented on August 12, 2024

See https://github.com/hanwen/go-mtpfs/blob/master/mtp-64bit.patch

from go-mtpfs.

virtualdj avatar virtualdj commented on August 12, 2024

Hi, sorry for the banal question, but how do I apply that patch?
I download the libmtp-1.1.5.tar.gz file from SourceForge and it builds correctly. Then I apply the patch in this way:

root@debian:~/mtp/libmtp-1.1.5# patch -p1 < /tmp/go/src/github.com/hanwen/go-mtpfs/mtp-64bit.patch
patching file src/libmtp.c
patching file src/libopenusb1-glue.c
patching file src/libusb-glue.c
patching file src/libusb1-glue.c
patching file src/ptp.c
patching file src/ptp.h

After a make clean, configure and make I get this error:

ptp.c:383:19: error: unknown type name 'uint64'
ptp.c: In function 'ptp_generic_no_data':

Maybe this is a typo (?), so I apply:

root@debian:~/mtp/libmtp-1.1.5# sed -i "383s/uint64/uint64_t/" src/ptp.c

And eventually I get this new error:

libusb1-glue.c:1185:1: error: conflicting types for 'ptp_usb_senddata'
In file included from libusb-glue.h:33:0,
                 from libusb1-glue.c:34:
ptp.h:2194:10: note: previous declaration of 'ptp_usb_senddata' was here
libusb1-glue.c: In function 'ptp_usb_senddata':
libusb1-glue.c:1195:2: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint64_t' [-Wformat]
make[2]: *** [libmtp_la-libusb1-glue.lo] Error 1

My GCC is version 4.7.1 (Debian 4.7.1-8).
Can you explain exactly how can I apply the patch? Thanks!

from go-mtpfs.

hanwen avatar hanwen commented on August 12, 2024

On Sun, Jan 20, 2013 at 5:30 PM, virtualdj [email protected] wrote:

Hi, sorry for the banal question, but how do I apply that patch?
I download the libmtp-1.1.5.tar.gz file from SourceForge and it builds
correctly. Then I apply the patch in this way:

I made the patch against libmtp head, so you might want to try that.

(i'm experimenting with rewriting the mtp part in Go as well. Hopefully
that will work, and make all of this mucking with libmtp obsolete).

root@debian:~/mtp/libmtp-1.1.5# patch -p1 < /tmp/go/src/github.com/hanwen/go-mtpfs/mtp-64bit.patch
patching file src/libmtp.c
patching file src/libopenusb1-glue.c
patching file src/libusb-glue.c
patching file src/libusb1-glue.c
patching file src/ptp.c
patching file src/ptp.h

After a make clean, configure and make I get this error:

ptp.c:383:19: error: unknown type name 'uint64'
ptp.c: In function 'ptp_generic_no_data':

Maybe this is a typo (?), so I apply:

root@debian:~/mtp/libmtp-1.1.5# sed -i "383s/uint64/uint64_t/" src/ptp.c

And eventually I get this new error:

libusb1-glue.c:1185:1: error: conflicting types for 'ptp_usb_senddata'
In file included from libusb-glue.h:33:0,
from libusb1-glue.c:34:
ptp.h:2194:10: note: previous declaration of 'ptp_usb_senddata' was here
libusb1-glue.c: In function 'ptp_usb_senddata':
libusb1-glue.c:1195:2: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'uint64_t' [-Wformat]
make[2]: *** [libmtp_la-libusb1-glue.lo] Error 1

My GCC is version 4.7.1 (Debian 4.7.1-8).
Can you explain exactly how can I apply the patch? Thanks!


Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-12472967.

Han-Wen Nienhuys - [email protected] - http://www.xs4all.nl/~hanwen

from go-mtpfs.

virtualdj avatar virtualdj commented on August 12, 2024

Hi, thanks for the answer. Unfortunately, the exact same errors appear on the latest git version (I hope you meant that...):

root@debian:~/mtp/libmtp# git describe --dirty --tags
libmtp-1-1-5-2-gf97c48f-dirty
root@debian:~/mtp/libmtp# git status
# On branch master
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   src/libmtp.c
#       modified:   src/libopenusb1-glue.c
#       modified:   src/libusb-glue.c
#       modified:   src/libusb1-glue.c
#       modified:   src/ptp.c
#       modified:   src/ptp.h
#
no changes added to commit (use "git add" and/or "git commit -a")

Same uint64 typo, and after fixing that same error on the same lines than before. Hints?
Is it working on your system?

from go-mtpfs.

hanwen avatar hanwen commented on August 12, 2024

can you try this patch on top?

diff --git a/src/ptp.c b/src/ptp.c
index 0c943b2..e200e50 100644
--- a/src/ptp.c
+++ b/src/ptp.c
@@ -380,7 +380,7 @@ ptp_exit_fd_handler (PTPDataHandler handler) {
/
Old style transaction, based on memory /
static uint16_t
ptp_transaction (PTPParams
params, PTPContainer* ptp,

  •           uint16_t flags, uint64 sendlen,
    
  •           uint16_t flags, uint64_t sendlen,
            unsigned char *_data, unsigned int *recvlen
    
    ) {
    PTPDataHandler handler;
    diff --git a/src/ptp.h b/src/ptp.h
    index d5b9f4a..4fce85e 100644
    --- a/src/ptp.h
    +++ b/src/ptp.h
    @@ -2192,7 +2192,7 @@ struct PTPParams {
    /
    last, but not least - ptp functions /
    uint16_t ptp_usb_sendreq (PTPParams
    params, PTPContainer* req);
    uint16_t ptp_usb_senddata (PTPParams* params, PTPContainer* ptp,
  •                            unsigned long size, PTPDataHandler *handler);
    
  •                            uint64_t size, PTPDataHandler _handler);
    
    uint16_t ptp_usb_getresp (PTPParams_ params, PTPContainer* resp);
    uint16_t ptp_usb_getdata (PTPParams* params, PTPContainer* ptp,
    PTPDataHandler *handler);

from go-mtpfs.

virtualdj avatar virtualdj commented on August 12, 2024

Thanks, it worked (apart that I had to manually apply it, because GitHub web page messed the patch details...).

Here's the complete mtp-64bit.patch file if you want to publish to your go-mtpfs repository updating the previous one.
It applies to the latest libmtp git version (libmtp-1-1-5-2-gf97c48f).

from go-mtpfs.

Raulvo avatar Raulvo commented on August 12, 2024

Hi,
Well, I've downloaded the libmtp 1.1.5 tarball and applied the patch
manually. It works.

I just don't understand why the transfer seems to occur two times. One time
with the Nautilus dialog, when Nautilus finishes it freezes, then you can
see the go-mtpfs at the terminal saying "sending file" and when it finishes
(20MB/s vs. 30-45MB/s of Nautilus) the transfer is finally done and the
transfer dialog of Nautilus unfreezes.

Thanks for your work.
http://www.libreoffice.org/

from go-mtpfs.

hanwen avatar hanwen commented on August 12, 2024

Please try again with the latest 'master' branch.

from go-mtpfs.

Raulvo avatar Raulvo commented on August 12, 2024

Go-mtpfs master?
El 02/02/2013 17:09, "Han-Wen Nienhuys" [email protected] escribió:

Please try again with the latest 'master' branch.


Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-13032710.

from go-mtpfs.

hanwen avatar hanwen commented on August 12, 2024

can you compile a fresh version from the master branch currently at
https://github.com/hanwen/go-mtpfs/ and see if it fixes your complaint?

On Sat, Feb 2, 2013 at 5:13 PM, Raulvo [email protected] wrote:

Go-mtpfs master?
El 02/02/2013 17:09, "Han-Wen Nienhuys" [email protected]
escribió:

Please try again with the latest 'master' branch.


Reply to this email directly or view it on GitHub<
https://github.com/hanwen/go-mtpfs/issues/20#issuecomment-13032710>.


Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-13032768.

Han-Wen Nienhuys - [email protected] - http://www.xs4all.nl/~hanwen

from go-mtpfs.

Raulvo avatar Raulvo commented on August 12, 2024

I tested go-mtpfs with the latest GIT code. After adding some imports you
forgot I could compile it. I was also able to delete some files although I
had to disconnect the tablet and connect it again because after deleting
the files the available space wasn't updated.

The imports I added were:

"syscall" on files /github.com/hanwen/go-fuse/raw/print_linux.go
github.com/hanwen/go-fuse/fuse/attr_linux.go

and "fmt" on file github.com/hanwen/go-fuse/fuse/loopback_linux.go

After remounting the device, I tried to copy a file and go-mtpfs did a
segmentation fault:

2013/02/07 23:43:31 starting FUSE unknown
2013/02/07 23:44:13 AndroidSendPartialObject failed: LIBUSB_ERROR_TIMEOUT
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x40 pc=0x7fc21045d9df]

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xf84009a754, 0x500000001)
/build/buildd/golang-1.0.2/src/pkg/runtime/zsema_amd64.c:146 +0x25
sync.(_Mutex).Lock(0xf84009a750, 0xf840070568)
/usr/lib/go/src/pkg/sync/mutex.go:60 +0xbe
github.com/hanwen/go-fuse/fuse.(_LockingRawFileSystem).locked(0xf84009a740,
0x100000038, 0x0, 0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/lockingfs.go:156 +0x47
github.com/hanwen/go-fuse/fuse.(_LockingRawFileSystem).GetAttr(0xf84009a740,
0xf8400a30c0, 0xf8400a31d0, 0xf8400a3178, 0x0, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/lockingfs.go:177 +0x2b
github.com/hanwen/go-fuse/fuse.doGetAttr(0xf84006d1e0, 0xf8400a3000, 0x1,
0xf8400a3150)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/opcode.go:216 +0x6c
github.com/hanwen/go-fuse/fuse.(_MountState).handleRequest(0xf84006d1e0,
0xf8400a3000, 0xf8400a3000, 0xf800000000)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:340 +0x235
github.com/hanwen/go-fuse/fuse.(_MountState).loop(0xf84006d1e0, 0x0, 0x0,
0x40175e)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:320 +0x84
github.com/hanwen/go-fuse/fuse.(_MountState).Loop(0xf84006d1e0,
0x7261747300000010)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:292 +0x48
main.main()
/tmp/go/src/github.com/hanwen/go-mtpfs/main.go:74 +0xb5e

goroutine 2 [syscall]:
created by runtime.main
/build/buildd/golang-1.0.2/src/pkg/runtime/proc.c:221

goroutine 3 [semacquire]:
sync.runtime_Semacquire(0xf84009a754, 0x900000005)
/build/buildd/golang-1.0.2/src/pkg/runtime/zsema_amd64.c:146 +0x25
sync.(_Mutex).Lock(0xf84009a750, 0xf840070578)
/usr/lib/go/src/pkg/sync/mutex.go:60 +0xbe
github.com/hanwen/go-fuse/fuse.(_LockingRawFileSystem).locked(0xf84009a740,
0xf800000009, 0xf84006c300, 0x100000001)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/lockingfs.go:156 +0x47
github.com/hanwen/go-fuse/fuse.(_LockingRawFileSystem).Lookup(0xf84009a740,
0xf8400be0c0, 0xf8400be1d0, 0xf840070570, 0x6, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/lockingfs.go:167 +0x2b
github.com/hanwen/go-fuse/fuse.doLookup(0xf84006d1e0, 0xf8400be000, 0x1,
0xf8400be150)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/opcode.go:249 +0x86
github.com/hanwen/go-fuse/fuse.(_MountState).handleRequest(0xf84006d1e0,
0xf8400be000, 0xf8400be000, 0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:340 +0x235
github.com/hanwen/go-fuse/fuse.(_MountState).loop(0xf84006d1e0, 0x1, 0x0,
0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:320 +0x84
created by github.com/hanwen/go-fuse/fuse.(_MountState).readRequest
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:251 +0x604

goroutine 7 [semacquire]:
sync.runtime_Semacquire(0xf84009a754, 0xd00000009)
/build/buildd/golang-1.0.2/src/pkg/runtime/zsema_amd64.c:146 +0x25
sync.(_Mutex).Lock(0xf84009a750, 0xf840070588)
/usr/lib/go/src/pkg/sync/mutex.go:60 +0xbe
github.com/hanwen/go-fuse/fuse.(_LockingRawFileSystem).locked(0xf84009a740,
0xf800000009, 0xf84006c320, 0x100000001)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/lockingfs.go:156 +0x47
github.com/hanwen/go-fuse/fuse.(_LockingRawFileSystem).Lookup(0xf84009a740,
0xf8400be2c0, 0xf8400be3d0, 0xf840070580, 0x6, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/lockingfs.go:167 +0x2b
github.com/hanwen/go-fuse/fuse.doLookup(0xf84006d1e0, 0xf8400be200, 0x1,
0xf8400be350)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/opcode.go:249 +0x86
github.com/hanwen/go-fuse/fuse.(_MountState).handleRequest(0xf84006d1e0,
0xf8400be200, 0xf8400be200, 0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:340 +0x235
github.com/hanwen/go-fuse/fuse.(_MountState).loop(0xf84006d1e0, 0x1, 0x0,
0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:320 +0x84
created by github.com/hanwen/go-fuse/fuse.(_MountState).readRequest
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:251 +0x604

goroutine 5 [finalizer wait]:
created by runtime.gc
/build/buildd/golang-1.0.2/src/pkg/runtime/mgc0.c:882

goroutine 6 [syscall]:
github.com/hanwen/go-mtpfs/usb._Cfunc_libusb_bulk_transfer(0x0,
0xf840070f04)
/tmp/go-build979931987/
github.com/hanwen/go-mtpfs/usb/_obj/_cgo_defun.c:50 +0x34
github.com/hanwen/go-mtpfs/usb.(_DeviceHandle).BulkTransfer(0x0,
0xf840207604, 0xf840208c20, 0x2000000020, 0x7d0, ...)
/tmp/go-build979931987/
github.com/hanwen/go-mtpfs/usb/_obj/_cgo_gotypes.go:1077 +0xc7
github.com/hanwen/go-mtpfs/mtp.(_Device).sendReq(0xf8400005b0,
0x7fc2106bfcf0, 0x100000008, 0x408753, 0x26a0620, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/mtp/mtp.go:161 +0x3b6
github.com/hanwen/go-mtpfs/mtp.(_Device).RunTransaction(0xf8400005b0,
0x7fc2106bfcf0, 0x7fc2106bfcd0, 0x0, 0x0, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/mtp/mtp.go:231 +0x189
github.com/hanwen/go-mtpfs/mtp.(_Device).AndroidSendPartialObject(0xf8400005b0,
0xf50, 0xbfc000, 0xf800001000, 0xf8400992d0, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/mtp/android.go:65 +0x163
github.com/hanwen/go-mtpfs/fs.(_androidFile).Write(0xf840213890,
0xf840216050, 0x10fb000001000, 0xbfc000, 0xf840099c30, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/fs/android.go:37 +0x12d
github.com/hanwen/go-fuse/fuse.(_FileSystemConnector).Write(0xf840093c80,
0xf8400a3fd0, 0xf840216028, 0xf840216050, 0x10fb000001000, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/fsops.go:373 +0xaf
github.com/hanwen/go-fuse/fuse.(_LockingRawFileSystem).Write(0xf84009a740,
0xf8400a3fd0, 0xf840216028, 0xf840216050, 0x10fb000001000, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/lockingfs.go:289 +0xa4
github.com/hanwen/go-fuse/fuse.doWrite(0xf84006d1e0, 0xf8400a3e00, 0x0, 0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/opcode.go:149 +0x73
github.com/hanwen/go-fuse/fuse.(_MountState).handleRequest(0xf84006d1e0,
0xf8400a3e00, 0xf8400a3e00, 0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:340 +0x235
github.com/hanwen/go-fuse/fuse.(_MountState).loop(0xf84006d1e0, 0x1, 0x0,
0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:320 +0x84
created by github.com/hanwen/go-fuse/fuse.(_MountState).readRequest
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:251 +0x604

goroutine 8 [syscall]:
syscall.Syscall()
/build/buildd/golang-1.0.2/src/pkg/syscall/asm_linux_amd64.s:15 +0x5
syscall.Read(0x9, 0xf84025a000, 0x1100000011000, 0xf840291800, 0x0, ...)
/usr/lib/go/src/pkg/syscall/zerrors_linux_amd64.go:2137 +0x78
os.(_File).read(0xf840070670, 0xf84025a000, 0x1100000011000, 0x1ffffffff,
0x0, ...)
/usr/lib/go/src/pkg/os/file_unix.go:163 +0x58
os.(_File).Read(0xf840070670, 0xf84025a000, 0x1100000011000, 0x0, 0x0, ...)
/usr/lib/go/src/pkg/os/file.go:95 +0x83
github.com/hanwen/go-fuse/fuse.(_MountState).readRequest(0xf84006d1e0, 0x1,
0xf840291800, 0x57d4fb, 0x0, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:227 +0x1aa
github.com/hanwen/go-fuse/fuse.(_MountState).loop(0xf84006d1e0, 0x1, 0x0,
0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:304 +0x51
created by github.com/hanwen/go-fuse/fuse.(*MountState).readRequest
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:251 +0x604
http://www.libreoffice.org/

from go-mtpfs.

hanwen avatar hanwen commented on August 12, 2024

thanks, I fixed the update of the free space. Do you have a reproduceable scenario for the crash?

I should note that I have noticed flakiness with the android extensions, but it should not cause crashes.

from go-mtpfs.

Raulvo avatar Raulvo commented on August 12, 2024

Maybe it was caused by a bad usage because I don't let go-mtpfs run in
background (& operator) and I just do Ctrl-C to stop it and unmount the
device with umount (root privileges).

I'll try with it running in background and mounting and unmounting with
fusermount.
http://www.libreoffice.org/

from go-mtpfs.

Raulvo avatar Raulvo commented on August 12, 2024

I've tried again two times, and both times I got errors and go-mtpfs
crashed.

Long story made short: mount->hang->force unmount->terminal trace
(segmentation fault)->cycle USB->mount->delete and copy->nautilus
error->terminal trace (segfault)->cycle USB->mount->hang->force
unmount->terminal trace (segfault)->cycle USB->mount->delete and
copy->nautilus error->terminal trace (segfault)->cycle USB->mount->delete
with Nautilus, copy with cp->semacquire terminal trace (segfault)

Long story with full details (I hope it's not too verbose, I've added the
previous steps on every step so it may be easier to follow):

mount->hang->force unmount->terminal trace->cycle USB->mount->delete and
copy->nautilus error->terminal trace->cycle USB->mount->hang->force
unmount->terminal trace->cycle USB->mount->delete and copy->nautilus
error->terminal trace->cycle USB->mount->delete with Nautilus, copy with
cp->semacquire terminal trace

The first time log. First I mount the device (go-mtpfs nexus10mount &):

2013/02/08 19:52:24 starting FUSE unknown

Then I double click on the Internal storage folder:

2013/02/08 19:52:40 GetObjectInfo failed: transaction ID mismatch got 18
want 19
2013/02/08 19:52:40 GetStorageInfo %x: %v 65537 got type 2 in response
2013/02/08 19:52:42 GetStorageInfo %x: %v 65537 transaction ID mismatch got
19 want 1a
2013/02/08 19:52:42 GetObjectHandles failed: transaction ID mismatch got 1a
want 1b
2013/02/08 19:52:42 GetObjectHandles failed: transaction ID mismatch got 1b
want 1c
2013/02/08 19:52:42 GetStorageInfo %x: %v 65537 transaction ID mismatch got
1c want 1d

mount->hang->force unmount->terminal trace->cycle USB->mount->delete and
copy->nautilus error->terminal trace->cycle USB->mount->hang->force
unmount->terminal trace->cycle USB->mount->delete and copy->nautilus
error->terminal trace->cycle USB->mount->delete with Nautilus, copy with
cp->semacquire terminal trace

mount->hang->force unmount->terminal trace->cycle USB->mount->delete and
copy->nautilus error->terminal trace->cycle USB->mount->hang->force
unmount->terminal trace->cycle USB->mount->delete and copy->nautilus
error->terminal trace->cycle USB->mount->delete with Nautilus, copy with
cp->semacquire terminal trace

Go-mtpfs gets hung there. If force to umount the device an output of a
trace call is written in the console. Using fusermount does not work:

panic: runtime error: invalid memory address or nil pointer dereference

[signal 0xb code=0x1 addr=0x48 pc=0x7f6241ee3fe5]

goroutine 1 [syscall]:
github.com/hanwen/go-mtpfs/usb._Cfunc_libusb_reset_device(0x0, 0x1e)
/tmp/go-build259133475/
github.com/hanwen/go-mtpfs/usb/_obj/_cgo_defun.c:274 +0x2f
github.com/hanwen/go-mtpfs/usb.(_DeviceHandle).Reset(0x0, 0xf840050060,
0xf84006c670, 0x44fd29)
/tmp/go-build259133475/
github.com/hanwen/go-mtpfs/usb/_obj/_cgo_gotypes.go:1101 +0x38
github.com/hanwen/go-mtpfs/mtp.(_Device).Close(0xf8400005b0, 0x0,
0xf8400005b0, 0x100000001)
/tmp/go/src/github.com/hanwen/go-mtpfs/mtp/mtp.go:71 +0x85
main.main()
/tmp/go/src/github.com/hanwen/go-mtpfs/main.go:75 +0xb6f

goroutine 2 [syscall]:
created by runtime.main
/build/buildd/golang-1.0.2/src/pkg/runtime/proc.c:221

goroutine 4 [finalizer wait]:
created by runtime.gc
/build/buildd/golang-1.0.2/src/pkg/runtime/mgc0.c:882

mount->hang->force unmount->terminal trace->cycle USB->mount->delete and
copy->nautilus error->terminal trace->cycle USB->mount->hang->force
unmount->terminal trace->cycle USB->mount->delete and copy->nautilus
error->terminal trace->cycle USB->mount->delete with Nautilus, copy with
cp->semacquire terminal trace

If I try to mount again without disconnecting the device, go-mtpfs returns
the following error and closes afterwards:
20:00:12 Configure failed: OpenSession after reset: LIBUSB_ERROR_TIMEOUT

The second time it mounted flawlessly (just after the previous LIBUSB
error and plug in the USB cable again). Could access the "Internal storage"
folder and then the "Movies" folder. I could delete files and the available
space was updated properly. But when I tried to copy the file (an MKV
movie) it crashed. Nautilus shows a dialog telling that an error happened
while copying the file to the folder. The description is Failed to attach
the file: The program ended the connection
(in spanish: "Error al unir el
archivo: El programa provocó el fin de la conexión").

mount->hang->force unmount->terminal trace->cycle USB->mount->delete
and copy
->nautilus error->terminal trace->cycle USB->mount->hang->force
unmount->terminal trace->cycle USB->mount->delete and copy->nautilus
error->terminal trace->cycle USB->mount->delete with Nautilus, copy with
cp->semacquire terminal trace

2013/02/08 20:01:38 starting FUSE unknown
2013/02/08 20:08:17 GetStorageInfo %x: %v 65537 transaction ID mismatch got
55b want 55c *<- first line of the copy error. *
2013/02/08 20:08:17 AndroidSendPartialObject failed: no sink for data
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x40 pc=0x7f121ae3c9df]

goroutine 1 [syscall]:
syscall.Syscall()
/build/buildd/golang-1.0.2/src/pkg/syscall/asm_linux_amd64.s:15 +0x5
syscall.Read(0xf800000009, 0xf8402af000, 0x1100000011000, 0x4447a0, 0x0,
...)
/usr/lib/go/src/pkg/syscall/zerrors_linux_amd64.go:2137 +0x78
os.(_File).read(0xf840070668, 0xf8402af000, 0x1100000011000, 0xffffffff,
0x0, ...)
/usr/lib/go/src/pkg/os/file_unix.go:163 +0x58
os.(_File).Read(0xf840070668, 0xf8402af000, 0x1100000011000, 0xf8400a2000,
0x0, ...)
/usr/lib/go/src/pkg/os/file.go:95 +0x83
github.com/hanwen/go-fuse/fuse.(_MountState).readRequest(0xf84006d1e0,
0xf8400a2000, 0xf8400a2000, 0xf800000000, 0xf800000001, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:227 +0x1aa
github.com/hanwen/go-fuse/fuse.(_MountState).loop(0xf84006d1e0, 0x0, 0x0,
0x40175e)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:304 +0x51
github.com/hanwen/go-fuse/fuse.(*MountState).Loop(0xf84006d1e0,
0x7261747300000010)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:292 +0x48
main.main()
/tmp/go/src/github.com/hanwen/go-mtpfs/main.go:74 +0xb5e

goroutine 2 [syscall]:
created by runtime.main
/build/buildd/golang-1.0.2/src/pkg/runtime/proc.c:221

goroutine 4 [syscall]:
github.com/hanwen/go-mtpfs/usb._Cfunc_libusb_bulk_transfer(0x0,
0xf840070a04)
/tmp/go-build259133475/
github.com/hanwen/go-mtpfs/usb/_obj/_cgo_defun.c:50 +0x34
github.com/hanwen/go-mtpfs/usb.(_DeviceHandle).BulkTransfer(0x0,
0xf8401f5704, 0xf840052e00, 0x2000000020, 0x7d0, ...)
/tmp/go-build259133475/
github.com/hanwen/go-mtpfs/usb/_obj/_cgo_gotypes.go:1077 +0xc7
github.com/hanwen/go-mtpfs/mtp.(_Device).sendReq(0xf8400005b0,
0x7f121b202cf0, 0x8, 0x414981, 0x69ac00, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/mtp/mtp.go:176 +0x3b6
github.com/hanwen/go-mtpfs/mtp.(_Device).RunTransaction(0xf8400005b0,
0x7f121b202cf0, 0x7f121b202cd0, 0x0, 0x0, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/mtp/mtp.go:246 +0x189
github.com/hanwen/go-mtpfs/mtp.(_Device).AndroidSendPartialObject(0xf8400005b0,
0xf57, 0x3ab000, 0xf800001000, 0xf840099240, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/mtp/android.go:65 +0x163
github.com/hanwen/go-mtpfs/fs.(_androidFile).Write(0xf840070828,
0xf8402ff050, 0x10fb000001000, 0x3ab000, 0xf840099780, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/fs/android.go:37 +0x12d
github.com/hanwen/go-fuse/fuse.(_FileSystemConnector).Write(0xf840093bc0,
0xf8400dc1d0, 0xf8402ff028, 0xf8402ff050, 0x10fb000001000, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/fsops.go:373 +0xaf
github.com/hanwen/go-fuse/fuse.(_LockingRawFileSystem).Write(0xf84009a720,
0xf8400dc1d0, 0xf8402ff028, 0xf8402ff050, 0x10fb000001000, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/lockingfs.go:289 +0xa4
github.com/hanwen/go-fuse/fuse.doWrite(0xf84006d1e0, 0xf8400dc000, 0x0, 0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/opcode.go:149 +0x73
github.com/hanwen/go-fuse/fuse.(_MountState).handleRequest(0xf84006d1e0,
0xf8400dc000, 0xf8400dc000, 0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:340 +0x235
github.com/hanwen/go-fuse/fuse.(_MountState).loop(0xf84006d1e0,
0xf800000001, 0x0, 0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:320 +0x84
created by github.com/hanwen/go-fuse/fuse.(_MountState).readRequest
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:251 +0x604

goroutine 5 [finalizer wait]:
created by runtime.gc
/build/buildd/golang-1.0.2/src/pkg/runtime/mgc0.c:882

goroutine 6 [syscall]:
syscall.Syscall()
/build/buildd/golang-1.0.2/src/pkg/syscall/asm_linux_amd64.s:15 +0x5
syscall.Read(0xf800000009, 0xf8402ee000, 0x1100000011000, 0x100000001, 0x0,
...)
/usr/lib/go/src/pkg/syscall/zerrors_linux_amd64.go:2137 +0x78
os.(_File).read(0xf840070668, 0xf8402ee000, 0x1100000011000,
0x11000ffffffff, 0x0, ...)
/usr/lib/go/src/pkg/os/file_unix.go:163 +0x58
os.(_File).Read(0xf840070668, 0xf8402ee000, 0x1100000011000, 0xf8402ee000,
0x0, ...)
/usr/lib/go/src/pkg/os/file.go:95 +0x83
github.com/hanwen/go-fuse/fuse.(_MountState).readRequest(0xf84006d1e0,
0xf840128c01, 0xf840128c00, 0x0, 0x0, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:227 +0x1aa
github.com/hanwen/go-fuse/fuse.(_MountState).loop(0xf84006d1e0,
0xf800000001, 0x0, 0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:304 +0x51
created by github.com/hanwen/go-fuse/fuse.(*MountState).readRequest
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:251 +0x604

mount->hang->force unmount->terminal trace->cycle USB->mount->delete and
copy->nautilus error->terminal trace->cycle USB->mount->hang->force
unmount->terminal trace->cycle USB->mount->delete and copy->nautilus
error->terminal trace->cycle USB->mount->delete with Nautilus, copy with
cp->semacquire terminal trace

After that if I plug in the USB cable again (unplug, plug) and try to
access the Internal storage folder, Nautilus shows again a dialog of
Input/Output error and the terminal where I run go-mtpfs shows again these
errors with go-mtpfs hung again:

mount->hang->force unmount->terminal trace->cycle USB->mount->delete and
copy->nautilus error->terminal trace->cycle USB->mount->hang->force
unmount->terminal trace->cycle USB->mount->delete and copy->nautilus
error->terminal trace->cycle USB->mount->delete with Nautilus, copy with
cp->semacquire terminal trace

2013/02/08 20:14:54 GetObjectInfo failed: transaction ID mismatch got 1b

want 1c
2013/02/08 20:14:54 GetStorageInfo %x: %v 65537 got type 2 in response
2013/02/08 20:14:55 GetStorageInfo %x: %v 65537 transaction ID mismatch
got 1c want 1d
2013/02/08 20:14:55 GetObjectHandles failed: transaction ID mismatch got
1d want 1e
2013/02/08 20:14:55 GetObjectHandles failed: transaction ID mismatch got
1e want 1f
2013/02/08 20:14:55 GetStorageInfo %x: %v 65537 transaction ID mismatch
got 1f want 20

An umount of the folder where the device is mounted makes go-mtpfs write
this trace:
mount->hang->force unmount->terminal trace->cycle USB->mount->delete and
copy->nautilus error->terminal trace->cycle USB->mount->hang->*force unmount
*->terminal trace->cycle USB->mount->delete and copy->nautilus
error->terminal trace->cycle USB->mount->delete with Nautilus, copy with
cp->semacquire terminal trace

panic: runtime error: invalid memory address or nil pointer dereference

[signal 0xb code=0x1 addr=0x48 pc=0x7fe67c1defe5]

goroutine 1 [syscall]:
github.com/hanwen/go-mtpfs/usb._Cfunc_libusb_reset_device(0x0, 0x21)
/tmp/go-build259133475/
github.com/hanwen/go-mtpfs/usb/_obj/_cgo_defun.c:274 +0x2f
github.com/hanwen/go-mtpfs/usb.(_DeviceHandle).Reset(0x0, 0xf840050060,
0xf84006c2f0, 0x44fd29)
/tmp/go-build259133475/
github.com/hanwen/go-mtpfs/usb/_obj/_cgo_gotypes.go:1101 +0x38
github.com/hanwen/go-mtpfs/mtp.(_Device).Close(0xf840000540, 0x0,
0xf840000540, 0x100000001)
/tmp/go/src/github.com/hanwen/go-mtpfs/mtp/mtp.go:71 +0x85
main.main()
/tmp/go/src/github.com/hanwen/go-mtpfs/main.go:75 +0xb6f

goroutine 2 [syscall]:
created by runtime.main
/build/buildd/golang-1.0.2/src/pkg/runtime/proc.c:221

goroutine 4 [finalizer wait]:
created by runtime.gc
/build/buildd/golang-1.0.2/src/pkg/runtime/mgc0.c:882

mount->hang->force unmount->terminal trace->cycle USB->mount->delete and
copy->nautilus error->terminal trace->cycle USB->mount->hang->force
unmount->terminal trace->cycle USB->mount->delete and copy->nautilus
error->terminal trace->cycle USB->mount->delete with Nautilus, copy with
cp->semacquire terminal trace

Then I mount the device again (USB cable cycle), and after being able to
access the Movies folder that sits inside the Internal storage folder, I
try to copy the same file. A new crash and trace appears on the terminal:

mount->hang->force unmount->terminal trace->cycle USB->mount->delete and
copy->nautilus error->terminal trace->cycle USB->mount->hang->force
unmount->terminal trace->cycle USB->mount->delete and copy->nautilus
error
->terminal trace->cycle USB->mount->delete with Nautilus, copy with
cp->semacquire terminal trace

2013/02/08 20:21:14 GetStorageInfo %x: %v 65537 transaction ID mismatch got

474 want 475
2013/02/08 20:21:14 AndroidSendPartialObject failed: no sink for data
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x40 pc=0x7f94260f79df]

goroutine 1 [syscall]:
syscall.Syscall()
/build/buildd/golang-1.0.2/src/pkg/syscall/asm_linux_amd64.s:15 +0x5
syscall.Read(0xf800000009, 0xf840201000, 0x1100000011000, 0x4447a0, 0x0,
...)
/usr/lib/go/src/pkg/syscall/zerrors_linux_amd64.go:2137 +0x78
os.(_File).read(0xf840070670, 0xf840201000, 0x1100000011000, 0xffffffff,
0x0, ...)
/usr/lib/go/src/pkg/os/file_unix.go:163 +0x58
os.(_File).Read(0xf840070670, 0xf840201000, 0x1100000011000, 0xf8400a3000,
0x0, ...)
/usr/lib/go/src/pkg/os/file.go:95 +0x83
github.com/hanwen/go-fuse/fuse.(_MountState).readRequest(0xf84006d1e0,
0xf8400a3000, 0xf8400a3000, 0xf800000000, 0xf800000001, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:227 +0x1aa
github.com/hanwen/go-fuse/fuse.(_MountState).loop(0xf84006d1e0, 0x0, 0x0,
0x40175e)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:304 +0x51
github.com/hanwen/go-fuse/fuse.(*MountState).Loop(0xf84006d1e0,
0x7261747300000010)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:292 +0x48
main.main()
/tmp/go/src/github.com/hanwen/go-mtpfs/main.go:74 +0xb5e

goroutine 2 [syscall]:
created by runtime.main
/build/buildd/golang-1.0.2/src/pkg/runtime/proc.c:221

goroutine 3 [syscall]:
syscall.Syscall()
/build/buildd/golang-1.0.2/src/pkg/syscall/asm_linux_amd64.s:15 +0x5
syscall.Read(0xf800000009, 0xf84037c000, 0x1100000011000, 0x100000001,
0x0, ...)
/usr/lib/go/src/pkg/syscall/zerrors_linux_amd64.go:2137 +0x78
os.(_File).read(0xf840070670, 0xf84037c000, 0x1100000011000,
0x11000ffffffff, 0x0, ...)
/usr/lib/go/src/pkg/os/file_unix.go:163 +0x58
os.(_File).Read(0xf840070670, 0xf84037c000, 0x1100000011000, 0xf84037c000,
0x0, ...)
/usr/lib/go/src/pkg/os/file.go:95 +0x83
github.com/hanwen/go-fuse/fuse.(_MountState).readRequest(0xf84006d1e0,
0xf8400cf001, 0xf8400cf000, 0x0, 0xf840098000, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:227 +0x1aa
github.com/hanwen/go-fuse/fuse.(_MountState).loop(0xf84006d1e0, 0x1, 0x0,
0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:304 +0x51
created by github.com/hanwen/go-fuse/fuse.(*MountState).readRequest
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:251 +0x604

goroutine 4 [finalizer wait]:
created by runtime.gc
/build/buildd/golang-1.0.2/src/pkg/runtime/mgc0.c:882

goroutine 5 [syscall]:
github.com/hanwen/go-mtpfs/usb._Cfunc_libusb_bulk_transfer(0x0,
0xf840070e04)
/tmp/go-build259133475/
github.com/hanwen/go-mtpfs/usb/_obj/_cgo_defun.c:50 +0x34
github.com/hanwen/go-mtpfs/usb.(_DeviceHandle).BulkTransfer(0x0,
0xf840173d04, 0xf84018ce60, 0x2000000020, 0x7d0, ...)
/tmp/go-build259133475/
github.com/hanwen/go-mtpfs/usb/_obj/_cgo_gotypes.go:1077 +0xc7
github.com/hanwen/go-mtpfs/mtp.(_Device).sendReq(0xf8400005b0,
0x7f94264becf0, 0x8, 0x414981, 0x69ac00, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/mtp/mtp.go:176 +0x3b6
github.com/hanwen/go-mtpfs/mtp.(*Device).RunTransaction(0xf8400005b0,
0x7f94264becf0, 0x7f94264becd0, 0x0, 0x0, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/mtp/mtp.go:246 +0x189

github.com/hanwen/go-mtpfs/mtp.(_Device).AndroidSendPartialObject(0xf8400005b0,
0xf58, 0x3ee000, 0xf800001000, 0xf8400992d0, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/mtp/android.go:65 +0x163
github.com/hanwen/go-mtpfs/fs.(_androidFile).Write(0xf840070fe0,
0xf84038d050, 0x10fb000001000, 0x3ee000, 0xf840099750, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/fs/android.go:37 +0x12d
github.com/hanwen/go-fuse/fuse.(_FileSystemConnector).Write(0xf840093c00,
0xf8400a3fd0, 0xf84038d028, 0xf84038d050, 0x10fb000001000, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/fsops.go:373 +0xaf
github.com/hanwen/go-fuse/fuse.(_LockingRawFileSystem).Write(0xf84009a760,
0xf8400a3fd0, 0xf84038d028, 0xf84038d050, 0x10fb000001000, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/lockingfs.go:289 +0xa4
github.com/hanwen/go-fuse/fuse.doWrite(0xf84006d1e0, 0xf8400a3e00, 0x0,
0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/opcode.go:149 +0x73
github.com/hanwen/go-fuse/fuse.(_MountState).handleRequest(0xf84006d1e0,
0xf8400a3e00, 0xf8400a3e00, 0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:340 +0x235
github.com/hanwen/go-fuse/fuse.(_MountState).loop(0xf84006d1e0,
0xf800000001, 0x0, 0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:320 +0x84
created by github.com/hanwen/go-fuse/fuse.(*MountState).readRequest
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:251 +0x604

So, I tried again to mount the device. After every crash I have to cycle
the USB cable so I can access the device due to the LIBUSB_ERROR_TIMEOUT
error. Also it seems there are some quirks with the timing between the
device USB being plugged to the computer and when you can use go-mtpfs
without getting LIBUSB_ERROR_TIMEOUT error.
I haven't mentioned it before, but every time go-mtpfs crashed while
copying the file, after I could mount the device again, I can see that
around ~4 MB of the file were copied, including this last try.

mount->hang->force unmount->terminal trace->cycle USB->mount->delete and
copy->nautilus error->terminal trace->cycle USB->mount->hang->force
unmount->terminal trace->cycle USB->mount->delete with Nautilus, copy
with cp
->semacquire terminal trace

This last try I used cp via the text terminal. Got again this message:
2013/02/08 20:36:12 GetStorageInfo %x: %v 65537 transaction ID mismatch got
233 want 234

And cp got hung with an uninterruptible state. Killing cp (Ctrl+C and
waiting for a while) results in another trace:

^C2013/02/08 20:36:32 Unimplemented opcode INTERRUPT

^C

AndroidSendPartialObject failed: LIBUSB_ERROR_TIMEOUT
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x40 pc=
0x7f84bbece9df]

goroutine 1 [semacquire]:
sync.runtime_Semacquire(0xf84009a774, 0x500000001)
/build/buildd/golang-1.0.2/src/pkg/runtime/zsema_amd64.c:146 +0x25
sync.(_Mutex).Lock(0xf84009a770, 0xf8400702e8)
/usr/lib/go/src/pkg/sync/mutex.go:60 +0xbe
github.com/hanwen/go-fuse/fuse.(_LockingRawFileSystem).locked(0xf84009a760,
0x38, 0x0, 0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/lockingfs.go:156 +0x47
github.com/hanwen/go-fuse/fuse.(_LockingRawFileSystem).GetAttr(0xf84009a760,
0xf8400a30c0, 0xf8400a31d0, 0xf8400a3178, 0x0, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/lockingfs.go:177 +0x2b
github.com/hanwen/go-fuse/fuse.doGetAttr(0xf84006d1e0, 0xf8400a3000, 0x1,
0xf8400a3150)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/opcode.go:216 +0x6c
github.com/hanwen/go-fuse/fuse.(_MountState).handleRequest(0xf84006d1e0,
0xf8400a3000, 0xf8400a3000, 0xf800000000)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:340 +0x235
github.com/hanwen/go-fuse/fuse.(_MountState).loop(0xf84006d1e0, 0x0, 0x0,
0x40175e)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:320 +0x84
github.com/hanwen/go-fuse/fuse.(_MountState).Loop(0xf84006d1e0,
0x7261747300000010)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:292 +0x48
main.main()
/tmp/go/src/github.com/hanwen/go-mtpfs/main.go:74 +0xb5e

goroutine 2 [syscall]:
created by runtime.main
/build/buildd/golang-1.0.2/src/pkg/runtime/proc.c:221

goroutine 5 [finalizer wait]:
created by runtime.gc
/build/buildd/golang-1.0.2/src/pkg/runtime/mgc0.c:882

goroutine 6 [syscall]:
syscall.Syscall()
/build/buildd/golang-1.0.2/src/pkg/syscall/asm_linux_amd64.s:15 +0x5
syscall.Read(0xf800000009, 0xf8403a4000, 0x1100000011000, 0x6, 0x0, ...)
/usr/lib/go/src/pkg/syscall/zerrors_linux_amd64.go:2137 +0x78
os.(_File).read(0xf840070670, 0xf8403a4000, 0x1100000011000, 0xffffffff,
0x0, ...)
/usr/lib/go/src/pkg/os/file_unix.go:163 +0x58
os.(_File).Read(0xf840070670, 0xf8403a4000, 0x1100000011000, 0xf840186200,
0x0, ...)
/usr/lib/go/src/pkg/os/file.go:95 +0x83
github.com/hanwen/go-fuse/fuse.(_MountState).readRequest(0xf84006d1e0,
0xf840186201, 0xf840186200, 0xf800000000, 0xf840145c60, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:227 +0x1aa
github.com/hanwen/go-fuse/fuse.(_MountState).loop(0xf84006d1e0, 0x1, 0x0,
0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:304 +0x51
created by github.com/hanwen/go-fuse/fuse.(*MountState).readRequest
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:251 +0x604

goroutine 7 [syscall]:
github.com/hanwen/go-mtpfs/usb._Cfunc_libusb_bulk_transfer(0x0,
0xf840070204)
/tmp/go-build259133475/
github.com/hanwen/go-mtpfs/usb/_obj/_cgo_defun.c:50 +0x34
github.com/hanwen/go-mtpfs/usb.(_DeviceHandle).BulkTransfer(0x0,
0xf84018bc04, 0xf84018afe0, 0x2000000020, 0x7d0, ...)
/tmp/go-build259133475/
github.com/hanwen/go-mtpfs/usb/_obj/_cgo_gotypes.go:1077 +0xc7
github.com/hanwen/go-mtpfs/mtp.(_Device).sendReq(0xf840000540,
0x7f84bc173d28, 0x0, 0x0, 0x0, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/mtp/mtp.go:176 +0x3b6
github.com/hanwen/go-mtpfs/mtp.(_Device).RunTransaction(0xf840000540,
0x7f84bc173d28, 0x7f84bc173d48, 0x0, 0x0, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/mtp/mtp.go:246 +0x189
github.com/hanwen/go-mtpfs/mtp.(_Device).AndroidEndEditObject(0xf840000540,
0xf59, 0xf800000000, 0x100000000, 0x100000001, ...)
/tmp/go/src/github.com/hanwen/go-mtpfs/mtp/android.go:75 +0xfc
github.com/hanwen/go-mtpfs/fs.(_fileNode).endEdit(0xf84015b270,
0xf84009a620, 0x42b0dc, 0xf840070f40)
/tmp/go/src/github.com/hanwen/go-mtpfs/fs/fs.go:296 +0x59
github.com/hanwen/go-mtpfs/fs.(_androidFile).Release(0xf840070f40,
0xaa01f0800021e)
/tmp/go/src/github.com/hanwen/go-mtpfs/fs/android.go:50 +0x28
github.com/hanwen/go-fuse/fuse.(_FileSystemConnector).Release(0xf840093c00,
0xf84012d5d0, 0xf84012d578, 0xf840075480, 0xf840093c00, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/fsops.go:321 +0x86
github.com/hanwen/go-fuse/fuse.(_LockingRawFileSystem).Release(0xf84009a760,
0xf84012d5d0, 0xf84012d578, 0xf8400755a0, 0xf84009a760, ...)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/lockingfs.go:274 +0x7f
github.com/hanwen/go-fuse/fuse.doRelease(0xf84006d1e0, 0xf84012d400,
filiprino@kiwi64:~/nexu10mount/Almacenamiento interno/Movies$ 0x1,
0xf84012d550)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/opcode.go
:296 +0x66
github.com/hanwen/go-fuse/fuse.(_MountState).handleRequest(0xf84006d1e0,
0xf84012d400, 0xf84012d400, 0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:340 +0x235
github.com/hanwen/go-fuse/fuse.(_MountState).loop(0xf84006d1e0, 0x1, 0x0,
0x0)
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:320 +0x84
created by github.com/hanwen/go-fuse/fuse.(*MountState).readRequest
/tmp/go/src/github.com/hanwen/go-fuse/fuse/mountstate.go:251 +0x604

from go-mtpfs.

hanwen avatar hanwen commented on August 12, 2024

Hey,

the symptoms you show look like go-mtpfs taking over an existing session. I've added some checks which should detect and fix this problem. Can you try again?

from go-mtpfs.

hanwen avatar hanwen commented on August 12, 2024

ping?

from go-mtpfs.

Raulvo avatar Raulvo commented on August 12, 2024

Sorry, I haven't tested it yet. I haven't found the right time :S

2013/2/24 Han-Wen Nienhuys [email protected]

ping?


Reply to this email directly or view it on GitHubhttps://github.com//issues/20#issuecomment-14008319.

Si necesitas enviarme información como pueda ser un documento de texto,
hoja de cálculo u otros, utiliza el formato OpenDocument, estándar ISO/IEC
26300:2006. PDF también puede ser válido para archivos no editables, pero
no debe contener ningún objeto binario y/o propietario empotrado.
http://www.libreoffice.org/

from go-mtpfs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.