t3rm1n4l/go-mega

Cannot upload 2.7 GB file

Closed this issue · 1 comments

When I try to upload 2.7 GB file via megacmd. It crashes with "panic: runtime error: makeslice: len out of range".

Cmd writes the following errors:

root@euhost:~/megacmd# megacmd put /root/backup/www/server-20140924.tar.gz mega: /backups/ams/
Copying /root/backup/www/server-20140924.tar.gz -> mega:/backups/ams/ # 0.00 % o f 2.7GB at 0B/s 0 panic: runtime error: makeslice: len out of range

goroutine 21 [running]:
runtime.panic(0x8220ce0, 0x8494140)
/usr/lib/go/src/pkg/runtime/panic.c:266 +0xac
github.com/t3rm1n4l/go-mega.func·005()
/root/megacmd/.gopath/src/github.com/t3rm1n4l/go-mega/mega.go:869 +0x218
created by github.com/t3rm1n4l/go-mega.(*Mega).UploadFile
/root/megacmd/.gopath/src/github.com/t3rm1n4l/go-mega/mega.go:926 +0xd64

goroutine 1 [runnable]:
github.com/t3rm1n4l/go-mega.(_Mega).UploadFile(0x18748420, 0xbf9d584f, 0x27, 0x1 887dee0, 0xbf9d5860, ...)
/root/megacmd/.gopath/src/github.com/t3rm1n4l/go-mega/mega.go:939 +0x1a9 5
github.com/t3rm1n4l/megacmd/client.(_MegaClient).Put(0x187006e8, 0xbf9d584f, 0x2 7, 0xbf9d5877, 0x12, ...)
/root/megacmd/.gopath/src/github.com/t3rm1n4l/megacmd/client/client.go:4 88 +0x6dd
main.main()
/root/megacmd/main.go:176 +0x13eb

goroutine 3 [syscall]:
os/signal.loop()
/usr/lib/go/src/pkg/os/signal/signal_unix.go:21 +0x21
created by os/signal.init·1
/usr/lib/go/src/pkg/os/signal/signal_unix.go:27 +0x34

goroutine 4 [syscall]:
runtime.goexit()
/usr/lib/go/src/pkg/runtime/proc.c:1394

goroutine 5 [chan receive]:
main.func·002()
/root/megacmd/main.go:105 +0xaa
created by main.main
/root/megacmd/main.go:108 +0x5e1

goroutine 11 [select]:
net/http.(_persistConn).roundTrip(0x188610f0, 0x188b9dc8, 0x188610f0, 0x0, 0x0)
/usr/lib/go/src/pkg/net/http/transport.go:879 +0x595
net/http.(_Transport).RoundTrip(0x187483c0, 0x18808000, 0x188f5314, 0x0, 0x0)
/usr/lib/go/src/pkg/net/http/transport.go:187 +0x2a2
net/http.send(0x18808000, 0xb756aa30, 0x187483c0, 0x0, 0x0, ...)
/usr/lib/go/src/pkg/net/http/client.go:168 +0x2b3
net/http.(_Client).send(0x1870aae0, 0x18808000, 0x33, 0x80673fa, 0x4)
/usr/lib/go/src/pkg/net/http/client.go:100 +0xb0
net/http.(_Client).doFollowingRedirects(0x1870aae0, 0x18808000, 0x82a6e60, 0x0, 0x0, ...)
/usr/lib/go/src/pkg/net/http/client.go:294 +0x50e
net/http.(_Client).Get(0x1870aae0, 0x187f33c0, 0x33, 0x81d34e0, 0x0, ...)
/usr/lib/go/src/pkg/net/http/client.go:248 +0x98
github.com/t3rm1n4l/go-mega.(_Mega).pollEvents(0x18748420)
/root/megacmd/.gopath/src/github.com/t3rm1n4l/go-mega/mega.go:1195 +0x7b 0
created by github.com/t3rm1n4l/go-mega.(*Mega).getFileSystem
/root/megacmd/.gopath/src/github.com/t3rm1n4l/go-mega/mega.go:601 +0x2e5

goroutine 9 [IO wait]:
net.runtime_pollWait(0xb756bcc0, 0x72, 0x0)
/usr/lib/go/src/pkg/runtime/netpoll.goc:116 +0x61
net.(_pollDesc).Wait(0x1872f478, 0x72, 0xb756a910, 0xb)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:81 +0x35
net.(_pollDesc).WaitRead(0x1872f478, 0xb, 0xb756a910)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:86 +0x33
net.(_netFD).Read(0x1872f440, 0x1876c000, 0x1000, 0x1000, 0x0, ...)
/usr/lib/go/src/pkg/net/fd_unix.go:204 +0x234
net.(_conn).Read(0x187008b8, 0x1876c000, 0x1000, 0x1000, 0x0, ...)
/usr/lib/go/src/pkg/net/net.go:122 +0xab
crypto/tls.(_block).readFromUntil(0x1876b060, 0xb756bd80, 0x187008b8, 0x5, 0x187 008b8, ...)
/usr/lib/go/src/pkg/crypto/tls/conn.go:459 +0x99
crypto/tls.(_Conn).readRecord(0x1876a000, 0x17, 0x0, 0x8053823)
/usr/lib/go/src/pkg/crypto/tls/conn.go:539 +0xcb
crypto/tls.(_Conn).Read(0x1876a000, 0x188c9000, 0x1000, 0x1000, 0x0, ...)
/usr/lib/go/src/pkg/crypto/tls/conn.go:897 +0xfc
bufio.(_Reader).fill(0x18802900)
/usr/lib/go/src/pkg/bufio/bufio.go:91 +0xe1
bufio.(_Reader).Peek(0x18802900, 0x1, 0x0, 0x0, 0x0, ...)
/usr/lib/go/src/pkg/bufio/bufio.go:119 +0xb3
net/http.(_persistConn).readLoop(0x18741410)
/usr/lib/go/src/pkg/net/http/transport.go:687 +0xa5
created by net/http.(*Transport).dialConn
/usr/lib/go/src/pkg/net/http/transport.go:528 +0x4c7

goroutine 10 [select]:
net/http.(_persistConn).writeLoop(0x18741410)
/usr/lib/go/src/pkg/net/http/transport.go:791 +0x207
created by net/http.(_Transport).dialConn
/usr/lib/go/src/pkg/net/http/transport.go:529 +0x4dc

goroutine 12 [select]:
github.com/t3rm1n4l/megacmd/client.progressBar(0x188b5570, 0x188a8d20, 0x9f99f17 4, 0x0, 0xbf9d584f, ...)
/root/megacmd/.gopath/src/github.com/t3rm1n4l/megacmd/client/utils.go:15 5 +0x4ee
created by github.com/t3rm1n4l/megacmd/client.(*MegaClient).Put
/root/megacmd/.gopath/src/github.com/t3rm1n4l/megacmd/client/client.go:4 85 +0x68d

goroutine 15 [IO wait]:
net.runtime_pollWait(0xb756bc54, 0x72, 0x0)
/usr/lib/go/src/pkg/runtime/netpoll.goc:116 +0x61
net.(_pollDesc).Wait(0x18897c78, 0x72, 0xb756a910, 0xb)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:81 +0x35
net.(_pollDesc).WaitRead(0x18897c78, 0xb, 0xb756a910)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:86 +0x33
net.(_netFD).Read(0x18897c40, 0x187a9000, 0x1000, 0x1000, 0x0, ...)
/usr/lib/go/src/pkg/net/fd_unix.go:204 +0x234
net.(_conn).Read(0x1880cfd0, 0x187a9000, 0x1000, 0x1000, 0x0, ...)
/usr/lib/go/src/pkg/net/net.go:122 +0xab
crypto/tls.(_block).readFromUntil(0x1889d540, 0xb756bd80, 0x1880cfd0, 0x5, 0x188 0cfd0, ...)
/usr/lib/go/src/pkg/crypto/tls/conn.go:459 +0x99
crypto/tls.(_Conn).readRecord(0x187ff480, 0x17, 0x0, 0x8053823)
/usr/lib/go/src/pkg/crypto/tls/conn.go:539 +0xcb
crypto/tls.(_Conn).Read(0x187ff480, 0x188f6000, 0x1000, 0x1000, 0x0, ...)
/usr/lib/go/src/pkg/crypto/tls/conn.go:897 +0xfc
bufio.(_Reader).fill(0x18898510)
/usr/lib/go/src/pkg/bufio/bufio.go:91 +0xe1
bufio.(_Reader).Peek(0x18898510, 0x1, 0x0, 0x0, 0x0, ...)
/usr/lib/go/src/pkg/bufio/bufio.go:119 +0xb3
net/http.(_persistConn).readLoop(0x1889ac80)
/usr/lib/go/src/pkg/net/http/transport.go:687 +0xa5
created by net/http.(*Transport).dialConn
/usr/lib/go/src/pkg/net/http/transport.go:528 +0x4c7

goroutine 16 [select]:
net/http.(_persistConn).writeLoop(0x1889ac80)
/usr/lib/go/src/pkg/net/http/transport.go:791 +0x207
created by net/http.(_Transport).dialConn
/usr/lib/go/src/pkg/net/http/transport.go:529 +0x4dc

goroutine 19 [IO wait]:
net.runtime_pollWait(0xb756bbe8, 0x72, 0x0)
/usr/lib/go/src/pkg/runtime/netpoll.goc:116 +0x61
net.(_pollDesc).Wait(0x187f37f8, 0x72, 0xb756a910, 0xb)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:81 +0x35
net.(_pollDesc).WaitRead(0x187f37f8, 0xb, 0xb756a910)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:86 +0x33
net.(_netFD).Read(0x187f37c0, 0x188f8000, 0x1000, 0x1000, 0x0, ...)
/usr/lib/go/src/pkg/net/fd_unix.go:204 +0x234
net.(_conn).Read(0x188b9e40, 0x188f8000, 0x1000, 0x1000, 0x188b9e78, ...)
/usr/lib/go/src/pkg/net/net.go:122 +0xab
bufio.(_Reader).fill(0x18898780)
/usr/lib/go/src/pkg/bufio/bufio.go:91 +0xe1
bufio.(_Reader).Peek(0x18898780, 0x1, 0x1, 0x804dfff, 0x1887cf00, ...)
/usr/lib/go/src/pkg/bufio/bufio.go:119 +0xb3
net/http.(_persistConn).readLoop(0x188610f0)
/usr/lib/go/src/pkg/net/http/transport.go:687 +0xa5
created by net/http.(_Transport).dialConn
/usr/lib/go/src/pkg/net/http/transport.go:528 +0x4c7

goroutine 20 [select]:
net/http.(_persistConn).writeLoop(0x188610f0)
/usr/lib/go/src/pkg/net/http/transport.go:791 +0x207
created by net/http.(_Transport).dialConn
/usr/lib/go/src/pkg/net/http/transport.go:529 +0x4dc

goroutine 22 [runnable]:
github.com/t3rm1n4l/go-mega.func·005()
/root/megacmd/.gopath/src/github.com/t3rm1n4l/go-mega/mega.go:856
created by github.com/t3rm1n4l/go-mega.(*Mega).UploadFile
/root/megacmd/.gopath/src/github.com/t3rm1n4l/go-mega/mega.go:926 +0xd64

goroutine 23 [runnable]:
github.com/t3rm1n4l/go-mega.func·005()
/root/megacmd/.gopath/src/github.com/t3rm1n4l/go-mega/mega.go:856
created by github.com/t3rm1n4l/go-mega.(*Mega).UploadFile
/root/megacmd/.gopath/src/github.com/t3rm1n4l/go-mega/mega.go:926 +0xd64

goroutine 24 [runnable]:
github.com/t3rm1n4l/go-mega.func·005()
/root/megacmd/.gopath/src/github.com/t3rm1n4l/go-mega/mega.go:856
created by github.com/t3rm1n4l/go-mega.(*Mega).UploadFile
/root/megacmd/.gopath/src/github.com/t3rm1n4l/go-mega/mega.go:926 +0xd64

ncw commented

I've fixed this now - sorry for the delay!