Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File download causes std::out_of_range #2

Closed
wiserweb opened this issue Mar 25, 2014 · 3 comments
Closed

File download causes std::out_of_range #2

wiserweb opened this issue Mar 25, 2014 · 3 comments
Assignees
Labels

Comments

@wiserweb
Copy link
Contributor

This may be two issues, or one issue creating a second issue.

  1. MegaFuse ends unexpectedly when downloading file
  2. Cannot umount MegaFuse with same user account used to create mount (this may be permission related and not a MegaFuse issue.. )

This is under an apache setup. The mount is created in a user virtual root with limited privileges.

Steps to replicate:

megafuse.conf is in the home folder of the user.

/home/user/public_html/megafuse.conf

Login via ssh to user shell

/home/user/public_html/MegaFuse -f -o allow_other -o gid=1004 -o uid=1004

Request file in /home/user/public_html/megafs1/ with browser from http://www.myhost.com/megafs/13562166.jpg

The image is loaded and displayed in the browser but all subsequent requests are forbidden. The endpoint appears lost.

Console output:

creato il file /tmp/filesOUV4Z
opend: aspetto il risultato per il file /13562166.jpg
topen riuscito
tmpfile creato con 1 blocchi
file: /13562166.jpg ora in stato DOWNLOADING
open[0] flags: 0x88000 /13562166.jpg
unique: 16, success, outsize: 32
unique: 17, opcode: READ (15), nodeid: 5, insize: 80, pid: 4070
read[0] 65536 bytes from 0 flags: 0x88000
read richiesto, offset 0, size 0
apro cache: /tmp/filesOUV4Z
mi metto in attesa di ricevere i dati necessari
lock acquisito,
0: Update: 33 KB of 60 KB, 13 KB/s
scaricato fino al byte 34752 di: 61887
0: Update: 41 KB of 60 KB, 11 KB/s
scaricato fino al byte 41992 di: 61887
blocco 0 salvato
wait conclusa
-----offset richiesto: 0, offset della cache: 0,status 0,availablebytes 1
read[0] 61887 bytes from 0
unique: 17, success, outsize: 61903
unique: 18, opcode: FLUSH (25), nodeid: 5, insize: 64, pid: 4070
unique: 18, error: -38 (Function not implemented), outsize: 16
unique: 19, opcode: RELEASE (18), nodeid: 5, insize: 64, pid: 0
release[0] flags: 0x88000
terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check
Aborted

Console output of larger file:

unique: 45, opcode: READ (15), nodeid: 2, insize: 80, pid: 2844
read[0] 131072 bytes from 3932160 flags: 0x88000
read richiesto, offset 3932160, size 0
apro cache: /tmp/fileLOR5bw
-----offset richiesto: 3932160, offset della cache: 0,status 0,availablebytes 1
read[0] 131072 bytes from 3932160
unique: 45, success, outsize: 131088
unique: 46, opcode: READ (15), nodeid: 2, insize: 80, pid: 2844
read[0] 131072 bytes from 4063232 flags: 0x88000
read richiesto, offset 4063232, size 0
blocco 92 salvato
blocco 93 salvato
blocco 94 salvato
blocco 95 salvato
blocco 96 salvato
blocco 97 salvato
blocco 98 salvato
blocco 99 salvato
terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check
Aborted
$

Trying to remount using MegaFuse gives.

./MegaFuse -f -o allow_other -o gid=1004 -o uid=1004

fuse: bad mount point `./megafs1': Transport endpoint is not connected
terminate called without an active exception
Aborted

After cleaning the temp, cannot remount.

rm -rf ~/.megaclient
umount ./megafs

./MegaFuse -f -o allow_other -o gid=1004 -o uid=1004

fuse: bad mount point `./megafs1': Transport endpoint is not connected
terminate called without an active exception
Aborted

Temporary solution to umount:
Login with root account and use umount with full path

umount /home/user/public_html/megafs1

Then the user can remount using

./MegaFuse -f -o allow_other -o gid=1004 -o uid=1004

This remount again works for the first file then the endpoint appears to be lost.

@matteoserva
Copy link
Owner

hello

  1. the "endpoint not connected" error means that the FS is still mounted. you might have to unmount it from root
  2. did you update to the latest commit? you shouldn't see that error but something like this:
    /usr/include/c++/4.7/debug/vector:336:error: attempt to subscript container
    with out-of-bounds index 2, but container only holds 2 elements.

Objects involved in the operation:
sequence "this" @ 0x0x7fffe63b2a20 {
type = NSt7__debug6vectorIiSaIiEEE;
}
3) please run
gdb ./MegaFuse
run -f -o allow_other -o gid=1004 -o uid=1004
and when the program crashes:
backtrace
paste here the result

@matteoserva matteoserva self-assigned this Mar 25, 2014
@wiserweb
Copy link
Contributor Author

Ok, the issue appears to have been on this end. Initially only the MegaFuse binary was copied and not the entire MegaFuse-master folder. When the entire folder was copied to the new location MegaFuse was able to connect and serve the files correctly.

This is working well so far during testing today.

I would suggest perhaps posting a bitcoin wallet address to support you and this project. :)

@matteoserva
Copy link
Owner

thanks
I removed caching so the executable needs only the megafuse.conf file.
Added a donation link in the README but I prefer paypal over bitcoins.

drok referenced this issue in drok/MegaFuse Dec 23, 2019
Fix to compile on Fedora 30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants