{"action":"created","issue":{"url":"https://api.github.com/repos/tchap/go-patricia/issues/26","repository_url":"https://api.github.com/repos/tchap/go-patricia","labels_url":"https://api.github.com/repos/tchap/go-patricia/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/tchap/go-patricia/issues/26/comments","events_url":"https://api.github.com/repos/tchap/go-patricia/issues/26/events","html_url":"https://github.com/tchap/go-patricia/issues/26","id":169564456,"number":26,"title":"Testsuite fails with gccgo 6.1","user":{"login":"michael-holzheu","id":13906644,"avatar_url":"https://avatars.githubusercontent.com/u/13906644?v=3","gravatar_id":"","url":"https://api.github.com/users/michael-holzheu","html_url":"https://github.com/michael-holzheu","followers_url":"https://api.github.com/users/michael-holzheu/followers","following_url":"https://api.github.com/users/michael-holzheu/following{/other_user}","gists_url":"https://api.github.com/users/michael-holzheu/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-holzheu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-holzheu/subscriptions","organizations_url":"https://api.github.com/users/michael-holzheu/orgs","repos_url":"https://api.github.com/users/michael-holzheu/repos","events_url":"https://api.github.com/users/michael-holzheu/events{/privacy}","received_events_url":"https://api.github.com/users/michael-holzheu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-05T09:16:01Z","updated_at":"2016-08-05T15:51:38Z","closed_at":null,"body":"The s390x (Mainframe) Docker CI runs with gccgo 6.1. Currently it fails because Docker updated its go-patricia from v2.1.0 to v2.2.4 (see issue docker/docker#25360).\r\n\r\nWhile investigating the problem I found out that the go-patricia testsuite does not run for version 2.2.4 with gccgo 6.1 also on amd64:\r\n\r\n1) Start gcc:6.1 image and get go-patricia code:\r\n```\r\n$ docker run -ti --rm gcc:6.1 bash\r\nroot@a0f013b0c10a:~# mkdir -p /root/go/src\r\nroot@a0f013b0c10a:~# cd /root/go/src\r\nroot@a0f013b0c10a:~/go/src# export GOPATH=/root/go\r\nroot@a0f013b0c10a:~/go/src# go get github.com/satori/go.uuid\r\nroot@a0f013b0c10a:~/go/src# git clone https://github.com/tchap/go-patricia.git github.com/tchap/go-patricia\r\n```\r\n\r\n2) Try with version 2.1.0 (works):\r\n```\r\nroot@a0f013b0c10a:~/go/src# cd github.com/tchap/go-patricia/patricia && git checkout v2.1.0 && cd -\r\nHEAD is now at d87fea6... Merge pull request #14 from ishidawataru/fix_walk\r\nroot@a0f013b0c10a:~/go/src# go test github.com/tchap/go-patricia/patricia\r\nok      github.com/tchap/go-patricia/patricia   4.646s\r\n```\r\n\r\n3) Try with version 2.2.4 (fails):\r\n```\r\nroot@a0f013b0c10a:~/go/src# cd github.com/tchap/go-patricia/patricia && git checkout v2.2.4 && cd -\r\nHEAD is now at 0d76659... Fix Delete memory leak and other bugs found\r\nroot@a0f013b0c10a:~# go test github.com/tchap/go-patricia/patricia\r\n\r\n--- FAIL: TestTrie_DeleteLeakageDense (0.00s)\r\npanic: runtime error: index out of range [recovered]\r\n        panic: runtime error: index out of range\r\n\r\n\r\n        :0\r\n\r\n        :0\r\n\r\ngithub_com_tchap_go_patricia_patricia.remove.pN53_github_com_tchap_go_patricia_patricia.sparseChildList\r\n        /root/go/src/github.com/tchap/go-patricia/patricia/children.go:73\r\ngithub_com_tchap_go_patricia_patricia.Delete.pN42_github_com_tchap_go_patricia_patricia.Trie\r\n        /root/go/src/github.com/tchap/go-patricia/patricia/patricia.go:302\r\ngithub_com_tchap_go_patricia_patricia.TestTrie_DeleteLeakageDense\r\n        /root/go/src/github.com/tchap/go-patricia/patricia/patricia_dense_test.go:196\r\n\r\n        :0\r\n\r\ngoroutine 16 [chan receive]:\r\n\r\n        :0\r\n\r\n\r\ncreated by main\r\n        /usr/src/gcc/libgo/runtime/go-main.c:54\r\n\r\n        :0\r\n\r\n        :0\r\n\r\ngoroutine 17 [syscall]:\r\n        goroutine in C code; stack unavailable\r\n\r\ngoroutine 18 [finalizer wait]:\r\n\r\ngoroutine 19 [GC sweep wait]:\r\n        :0\r\n\r\n        :0\r\nFAIL    github.com/tchap/go-patricia/patricia   0.044s\r\n```\r\n\r\nThe testsuite runs well with golang 1.7rc5.\r\n\r\nI am not sure if this is a gccgo or patricia problem. Could you verify that there is no \"index out of range\" problem in [children.go:73](https://github.com/tchap/go-patricia/blob/0d76659452e3b71b109c45196b32e662db2ad16a/patricia/children.go#L73)?\r\n"},"comment":{"url":"https://api.github.com/repos/tchap/go-patricia/issues/comments/237887853","html_url":"https://github.com/tchap/go-patricia/issues/26#issuecomment-237887853","issue_url":"https://api.github.com/repos/tchap/go-patricia/issues/26","id":237887853,"user":{"login":"michael-holzheu","id":13906644,"avatar_url":"https://avatars.githubusercontent.com/u/13906644?v=3","gravatar_id":"","url":"https://api.github.com/users/michael-holzheu","html_url":"https://github.com/michael-holzheu","followers_url":"https://api.github.com/users/michael-holzheu/followers","following_url":"https://api.github.com/users/michael-holzheu/following{/other_user}","gists_url":"https://api.github.com/users/michael-holzheu/gists{/gist_id}","starred_url":"https://api.github.com/users/michael-holzheu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael-holzheu/subscriptions","organizations_url":"https://api.github.com/users/michael-holzheu/orgs","repos_url":"https://api.github.com/users/michael-holzheu/repos","events_url":"https://api.github.com/users/michael-holzheu/events{/privacy}","received_events_url":"https://api.github.com/users/michael-holzheu/received_events","type":"User","site_admin":false},"created_at":"2016-08-05T15:51:38Z","updated_at":"2016-08-05T15:51:38Z","body":"Commit e30d10f29301fa31d4520d7a6d0b7bac132134e5 introduced the problem:\r\n\r\n```\r\ncommit e30d10f29301fa31d4520d7a6d0b7bac132134e5\r\nAuthor: Andrew Stone <a@stoney.io>\r\nDate:   Thu Oct 1 12:07:13 2015 -0400\r\n\r\n    Fix memory leak in sparse list child removal\r\n\r\ndiff --git a/patricia/children.go b/patricia/children.go\r\nindex 26c5613..47ebf15 100644\r\n--- a/patricia/children.go\r\n+++ b/patricia/children.go\r\n@@ -79,7 +79,9 @@ func (list *sparseChildList) replace(b byte, child *Trie) {\r\n func (list *sparseChildList) remove(child *Trie) {\r\n        for i, node := range list.children {\r\n                if node.prefix[0] == child.prefix[0] {\r\n-                       list.children = append(list.children[:i], list.children[i+1:]...)\r\n+                       list.children, list.children[len(list.children)-1] =\r\n+                               append(list.children[:i], list.children[i+1:]...),\r\n+                               nil\r\n                        return\r\n                }\r\n        }\r\n```\r\n"}}
{"actor":{"display_login":"michael-holzheu"}}