anacrolix / confluence

Torrent client as a HTTP service
Mozilla Public License 2.0
236 stars 32 forks source link

panic when using the /data endpoint #4

Closed arranlomas closed 7 years ago

arranlomas commented 7 years ago

E/Go: panic: page 4 already freed 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: panic: sync: Unlock of unlocked RWMutex 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: goroutine 10 [running]: 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: panic(0x7f9584cb20, 0x44202702d0) 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: D:/Go/src/runtime/panic.go:500 +0x390 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: sync.(RWMutex).Unlock(0x4420238130) 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: D:/Go/src/sync/rwmutex.go:118 +0xbc 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: github.com/anacrolix/sync.(RWMutex).Unlock(0x4420238000) 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: D:/Go/projects/src/github.com/anacrolix/sync/rwmutex.go:26 +0x68 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: panic(0x7f9584cb20, 0x44202702a0) 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: D:/Go/src/runtime/panic.go:458 +0x4c0 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: github.com/boltdb/bolt.(freelist).free(0x4420165f20, 0x2b, 0x7f94080000) 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: D:/Go/projects/src/github.com/boltdb/bolt/freelist.go:121 +0x280 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: github.com/boltdb/bolt.(node).spill(0x44204fe540, 0x0, 0x0) 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: D:/Go/projects/src/github.com/boltdb/bolt/node.go:363 +0x24c 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: github.com/boltdb/bolt.(Bucket).spill(0x4420298480, 0x0, 0x0) 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: D:/Go/projects/src/github.com/boltdb/bolt/bucket.go:570 +0x154 06-14 01:06:50.718 9996-0/com.shwifty.tex E/Go: github.com/boltdb/bolt.(Bucket).spill(0x44201240f8, 0x0, 0x0) 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: D:/Go/projects/src/github.com/boltdb/bolt/bucket.go:537 +0x804 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: github.com/boltdb/bolt.(Tx).Commit(0x44201240e0, 0x0, 0x0) 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: D:/Go/projects/src/github.com/boltdb/bolt/tx.go:163 +0x19c 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: github.com/boltdb/bolt.(DB).Update(0x4420232000, 0x442003fa28, 0x0, 0x0) 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: D:/Go/projects/src/github.com/boltdb/bolt/db.go:605 +0x12c 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: github.com/anacrolix/torrent/storage.(boltPieceCompletion).Set(0x442016a130, 0x4952003b839e81b, 0x49331a0845795f8f, 0xa1262123, 0x1, 0x442000c000, 0x0, 0x0) 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: D:/Go/projects/src/github.com/anacrolix/torrent/storage/boltPieceCompletion.go:70 +0xa8 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: github.com/anacrolix/torrent/storage.(fileStoragePiece).MarkNotComplete(0x44202983c0, 0x0, 0x0) 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: D:/Go/projects/src/github.com/anacrolix/torrent/storage/file_storage_piece.go:49 +0x11c 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: github.com/anacrolix/torrent/storage.Piece.ReadAt(0x7f95add280, 0x44202983c0, 0x4420100620, 0x1, 0x44201fa000, 0x8000, 0x8000, 0x0, 0x0, 0x7f95ad5a20, ...) 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: D:/Go/projects/src/github.com/anacrolix/torrent/storage/wrappers.go:79 +0x3dc 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: github.com/anacrolix/torrent/storage.(Piece).ReadAt(0x4420168520, 0x44201fa000, 0x8000, 0x8000, 0x0, 0x44201fa000, 0x0, 0x0) 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: :47 +0xf4 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: io.(SectionReader).Read(0x44202365d0, 0x44201fa000, 0x8000, 0x8000, 0x8000, 0x0, 0x0) 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: D:/Go/src/io/io.go:463 +0xd0 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: io.copyBuffer(0x7f91f39000, 0x44204fe460, 0x7f95ad6120, 0x44202365d0, 0x44201fa000, 0x8000, 0x8000, 0x0, 0x0, 0x0) 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: D:/Go/src/io/io.go:390 +0x1b0 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: io.Copy(0x7f91f39000, 0x44204fe460, 0x7f95ad6120, 0x44202365d0, 0x44204fe460, 0x0, 0x0) 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: D:/Go/src/io/io.go:360 +0x54 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: github.com/anacrolix/torrent.(Torrent).hashPiece(0x44200c0c80, 0x1, 0x0, 0x0, 0x0) 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: D:/Go/projects/src/github.com/anacrolix/torrent/torrent.go:630 +0x274 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: github.com/anacrolix/torrent.(Torrent).verifyPiece(0x44200c0c80, 0x1) 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: D:/Go/projects/src/github.com/anacrolix/torrent/torrent.go:1486 +0x188 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: github.com/anacrolix/torrent.(Torrent).setInfoBytes.func1(0x44200c0c80) 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: D:/Go/projects/src/github.com/anacrolix/torrent/torrent.go:289 +0x44 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: created by github.com/anacrolix/torrent.(Torrent).setInfoBytes 06-14 01:06:50.719 9996-0/com.shwifty.tex E/Go: D:/Go/projects/src/github.com/anacrolix/torrent/torrent.go:291 +0x844

anacrolix commented 7 years ago

thx m9

arranlomas commented 7 years ago

no-worries-man

anacrolix commented 7 years ago

How often does it occur? I guess the DB has been corrupted, but there was a change recently to fix a missing Close of the piece completion bolt DB, tho it looks like that situation would never occur in confluence (since the Torrent or any storage is never closed except by killing the process).

arranlomas commented 7 years ago

happens everytime, I was tired when it occured and it was on my fork when it happened so could have been a problem with my pull and merge of your latest commit. I'll test again tomorrow.

anacrolix commented 7 years ago

Yeah no problem. I'm not super familiar with bolt, but I expect if it's corrupted, then you should keep getting the exactly same error message. There's a tool that does an integrity check on files, I don't know the details, you could run that or delete the DB if it's corrupt, and see if it happens again. Also make sure you have updated github.com/boltdb/bolt of course.

arranlomas commented 7 years ago

Seems to be very android device specific at the moment. Just as a note it seems to be specifically redmi devices that I'm having problems with, runs fine on windows and ubuntu vps. Will close for now until I can say what is causing it and if it is a general problem or actually cause by the torrent or confluence