{"action":"created","issue":{"url":"https://api.github.com/repos/syndtr/goleveldb/issues/146","repository_url":"https://api.github.com/repos/syndtr/goleveldb","labels_url":"https://api.github.com/repos/syndtr/goleveldb/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/syndtr/goleveldb/issues/146/comments","events_url":"https://api.github.com/repos/syndtr/goleveldb/issues/146/events","html_url":"https://github.com/syndtr/goleveldb/issues/146","id":162616875,"number":146,"title":"panic: runtime error: slice bounds out of range","user":{"login":"jacoblai","id":11623139,"avatar_url":"https://avatars.githubusercontent.com/u/11623139?v=3","gravatar_id":"","url":"https://api.github.com/users/jacoblai","html_url":"https://github.com/jacoblai","followers_url":"https://api.github.com/users/jacoblai/followers","following_url":"https://api.github.com/users/jacoblai/following{/other_user}","gists_url":"https://api.github.com/users/jacoblai/gists{/gist_id}","starred_url":"https://api.github.com/users/jacoblai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacoblai/subscriptions","organizations_url":"https://api.github.com/users/jacoblai/orgs","repos_url":"https://api.github.com/users/jacoblai/repos","events_url":"https://api.github.com/users/jacoblai/events{/privacy}","received_events_url":"https://api.github.com/users/jacoblai/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-06-28T07:08:00Z","updated_at":"2016-06-29T06:53:57Z","closed_at":null,"body":"only on mipsel 32bit openwrt : panic: runtime error: slice bounds out of range\r\nlinux amd64 and windows are run fine!\r\n\r\nI'm find it golang/go#9007\r\n\r\nlook's like must change to higher go version to fix this bug???\r\n\r\ncode source:\r\n\r\nfunc main() {\r\n    db, err := leveldb.OpenFile(\"data\", nil)\r\n    if err != nil {\r\n        fmt.Println(\"error:\", err)\r\n    }\r\n    defer db.Close()\r\n\r\n    data, err := db.Get([]byte(\"key\"), nil)\r\n    fmt.Println(string(data),err)\r\n\r\n    err = db.Put([]byte(\"key\"), []byte(\"value\"), nil)\r\n    data, err = db.Get([]byte(\"key\"), nil)\r\n    fmt.Println(string(data),err)\r\n}\r\nbug review:\r\n1 ./main that's run allright\r\n2 rerun ./main error show for bug view\r\n\r\nbug view:\r\nroot@OpenWrt:/tmp# ./main\r\npanic: runtime error: slice bounds out of range\r\n\r\ngoroutine 1 [running]:\r\ngithub.com/golang/snappy.encodeBlock(0x10410141, 0x43, 0x43, 0x1086623c, 0x1b, 0x40, 0x50)\r\n/opt/slu/src/github.com/golang/snappy/encode_other.go:175 +0x10c4\r\ngithub.com/golang/snappy.Encode(0x10410140, 0x44, 0x44, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n/opt/slu/src/github.com/golang/snappy/encode.go:37 +0x370\r\ngithub.com/syndtr/goleveldb/leveldb/table.(Writer).writeBlock(0x10866200, 0x1086622c, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n/opt/slu/src/github.com/syndtr/goleveldb/leveldb/table/writer.go:170 +0x1e4\r\ngithub.com/syndtr/goleveldb/leveldb/table.(Writer).finishBlock(0x10866200, 0x0, 0x0)\r\n/opt/slu/src/github.com/syndtr/goleveldb/leveldb/table/writer.go:221 +0xa0\r\ngithub.com/syndtr/goleveldb/leveldb/table.(Writer).Close(0x10866200, 0x0, 0x0)\r\n/opt/slu/src/github.com/syndtr/goleveldb/leveldb/table/writer.go:294 +0x960\r\ngithub.com/syndtr/goleveldb/leveldb.(tWriter).finish(0x10434740, 0x0, 0x0, 0x0)\r\n/opt/slu/src/github.com/syndtr/goleveldb/leveldb/table.go:507 +0x9c\r\ngithub.com/syndtr/goleveldb/leveldb.(tOps).createFrom(0x104366e0, 0x77817d08, 0x10434700, 0x0, 0x1, 0x0, 0x0)\r\n/opt/slu/src/github.com/syndtr/goleveldb/leveldb/table.go:340 +0x288\r\ngithub.com/syndtr/goleveldb/leveldb.(session).flushMemdb(0x1042e000, 0x10448070, 0x1042e080, 0x0, 0x0, 0x0, 0x0)\r\n/opt/slu/src/github.com/syndtr/goleveldb/leveldb/session_compaction.go:27 +0x1cc\r\ngithub.com/syndtr/goleveldb/leveldb.(*DB).recoverJournal(0x1045a000, 0x0, 0x0)\r\n/opt/slu/src/github.com/syndtr/goleveldb/leveldb/db.go:603 +0xce0\r\ngithub.com/syndtr/goleveldb/leveldb.openDB(0x1042e000, 0x0, 0x0, 0x0)\r\n/opt/slu/src/github.com/syndtr/goleveldb/leveldb/db.go:124 +0x9e8\r\ngithub.com/syndtr/goleveldb/leveldb.Open(0x77817a48, 0x10434000, 0x0, 0x0, 0x0, 0x0)\r\n/opt/slu/src/github.com/syndtr/goleveldb/leveldb/db.go:196 +0x1e0\r\ngithub.com/syndtr/goleveldb/leveldb.OpenFile(0x1a9b58, 0x4, 0x0, 0x0, 0x0, 0x0)\r\n/opt/slu/src/github.com/syndtr/goleveldb/leveldb/db.go:218 +0xbc\r\nmain.main()\r\n/opt/slu/main.go:14 +0x58\r\n\r\ngoroutine 5 [select]:\r\ngithub.com/syndtr/goleveldb/leveldb/util.(*BufferPool).drain(0x1043e0b0)\r\n/opt/slu/src/github.com/syndtr/goleveldb/leveldb/util/buffer_pool.go:206 +0x2a0\r\ncreated by github.com/syndtr/goleveldb/leveldb/util.NewBufferPool\r\n/opt/slu/src/github.com/syndtr/goleveldb/leveldb/util/buffer_pool.go:237 +0x2cc\r\n\r\nthx!"},"comment":{"url":"https://api.github.com/repos/syndtr/goleveldb/issues/comments/229271918","html_url":"https://github.com/syndtr/goleveldb/issues/146#issuecomment-229271918","issue_url":"https://api.github.com/repos/syndtr/goleveldb/issues/146","id":229271918,"user":{"login":"calmh","id":125426,"avatar_url":"https://avatars.githubusercontent.com/u/125426?v=3","gravatar_id":"","url":"https://api.github.com/users/calmh","html_url":"https://github.com/calmh","followers_url":"https://api.github.com/users/calmh/followers","following_url":"https://api.github.com/users/calmh/following{/other_user}","gists_url":"https://api.github.com/users/calmh/gists{/gist_id}","starred_url":"https://api.github.com/users/calmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calmh/subscriptions","organizations_url":"https://api.github.com/users/calmh/orgs","repos_url":"https://api.github.com/users/calmh/repos","events_url":"https://api.github.com/users/calmh/events{/privacy}","received_events_url":"https://api.github.com/users/calmh/received_events","type":"User","site_admin":false},"created_at":"2016-06-29T06:53:56Z","updated_at":"2016-06-29T06:53:56Z","body":"The panic is in the `github.com/golang/snappy` package."}}
{"actor":{"display_login":"calmh"}}