{"action":"opened","issue":{"url":"https://api.github.com/repos/golang/go/issues/19873","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/19873/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/19873/comments","events_url":"https://api.github.com/repos/golang/go/issues/19873/events","html_url":"https://github.com/golang/go/issues/19873","id":220089384,"number":19873,"title":"encoding/asn1: cannot unmarshal SET if its fields have different ordering","user":{"login":"hirochachacha","id":898442,"avatar_url":"https://avatars3.githubusercontent.com/u/898442?v=3","gravatar_id":"","url":"https://api.github.com/users/hirochachacha","html_url":"https://github.com/hirochachacha","followers_url":"https://api.github.com/users/hirochachacha/followers","following_url":"https://api.github.com/users/hirochachacha/following{/other_user}","gists_url":"https://api.github.com/users/hirochachacha/gists{/gist_id}","starred_url":"https://api.github.com/users/hirochachacha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hirochachacha/subscriptions","organizations_url":"https://api.github.com/users/hirochachacha/orgs","repos_url":"https://api.github.com/users/hirochachacha/repos","events_url":"https://api.github.com/users/hirochachacha/events{/privacy}","received_events_url":"https://api.github.com/users/hirochachacha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-07T02:22:31Z","updated_at":"2017-04-07T02:22:31Z","closed_at":null,"body":"Please answer these questions before submitting your issue. Thanks!\r\n\r\n#### What did you do?\r\nIf possible, provide a recipe for reproducing the error.\r\nA complete runnable program is good.\r\nA link on play.golang.org is best.\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"encoding/asn1\"\r\n\t\"fmt\"\r\n)\r\n\r\ntype A struct {\r\n\tName string\r\n\tInt  int\r\n}\r\n\r\ntype B struct {\r\n\tInt  int\r\n\tName string\r\n}\r\n\r\nfunc main() {\r\n\tbs, err := asn1.Marshal(A{Name: \"foo\", Int: 5})\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\r\n\tbs[0] = asn1.TagSet | 0x20\r\n\r\n\tvar b B\r\n\r\n\trest, err := asn1.UnmarshalWithParams(bs, &b, \"set\")\r\n\tif err != nil {\r\n\t\tpanic(err)\r\n\t}\r\n\tif len(rest) != 0 {\r\n\t\tpanic(\"invalid length\")\r\n\t}\r\n\r\n\tfmt.Println(b)\r\n}\r\n```\r\n\r\n#### What did you expect to see?\r\n{5 foo}\r\n\r\n#### What did you see instead?\r\npanic: asn1: structure error: tags don't match (2 vs {class:0 tag:19 length:3 isCompound:false}) {optional:false explicit:false application:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false} int @2\r\n\r\ngoroutine 1 [running]:\r\nmain.main()\r\n\t/Users/hiro/set.go:42 +0x24a\r\nexit status 2\r\n\r\n#### Does this issue reproduce with the latest release (go1.8)?\r\nyes\r\n\r\n#### System details\r\n\r\n```\r\ngo version devel +5cadc91b3c Tue Apr 4 02:40:11 2017 +0000 darwin/amd64\r\nGOARCH=\"amd64\"\r\nGOBIN=\"\"\r\nGOEXE=\"\"\r\nGOHOSTARCH=\"amd64\"\r\nGOHOSTOS=\"darwin\"\r\nGOOS=\"darwin\"\r\nGOPATH=\"/Users/hiro/.go\"\r\nGORACE=\"\"\r\nGOROOT=\"/Users/hiro/go\"\r\nGOTOOLDIR=\"/Users/hiro/go/pkg/tool/darwin_amd64\"\r\nGCCGO=\"gccgo\"\r\nCC=\"clang\"\r\nGOGCCFLAGS=\"-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/wq/dwn8hs0x7njbzty9f68y61700000gn/T/go-build019140017=/tmp/go-build -gno-record-gcc-switches -fno-common\"\r\nCXX=\"clang++\"\r\nCGO_ENABLED=\"1\"\r\nCGO_CFLAGS=\"-g -O2\"\r\nCGO_CPPFLAGS=\"\"\r\nCGO_CXXFLAGS=\"-g -O2\"\r\nCGO_FFLAGS=\"-g -O2\"\r\nCGO_LDFLAGS=\"-g -O2\"\r\nPKG_CONFIG=\"pkg-config\"\r\nGOROOT/bin/go version: go version devel +5cadc91b3c Tue Apr 4 02:40:11 2017 +0000 darwin/amd64\r\nGOROOT/bin/go tool compile -V: compile version devel +5cadc91b3c Tue Apr 4 02:40:11 2017 +0000 X:framepointer\r\nuname -v: Darwin Kernel Version 16.5.0: Fri Mar  3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64\r\nProductName:\tMac OS X\r\nProductVersion:\t10.12.4\r\nBuildVersion:\t16E195\r\nlldb --version: lldb-370.0.37\r\n  Swift-3.1\r\ngdb --version: GNU gdb (GDB) 7.12.1\r\n```\r\n"}}
{"actor":{"display_login":"hirochachacha"}}