{"action":"closed","issue":{"url":"https://api.github.com/repos/golang/protobuf/issues/668","repository_url":"https://api.github.com/repos/golang/protobuf","labels_url":"https://api.github.com/repos/golang/protobuf/issues/668/labels{/name}","comments_url":"https://api.github.com/repos/golang/protobuf/issues/668/comments","events_url":"https://api.github.com/repos/golang/protobuf/issues/668/events","html_url":"https://github.com/golang/protobuf/issues/668","id":347094777,"node_id":"MDU6SXNzdWUzNDcwOTQ3Nzc=","number":668,"title":"proto: panics on handwritten types that directly embed generated messages","user":{"login":"tandr","id":5227075,"node_id":"MDQ6VXNlcjUyMjcwNzU=","avatar_url":"https://avatars3.githubusercontent.com/u/5227075?v=4","gravatar_id":"","url":"https://api.github.com/users/tandr","html_url":"https://github.com/tandr","followers_url":"https://api.github.com/users/tandr/followers","following_url":"https://api.github.com/users/tandr/following{/other_user}","gists_url":"https://api.github.com/users/tandr/gists{/gist_id}","starred_url":"https://api.github.com/users/tandr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tandr/subscriptions","organizations_url":"https://api.github.com/users/tandr/orgs","repos_url":"https://api.github.com/users/tandr/repos","events_url":"https://api.github.com/users/tandr/events{/privacy}","received_events_url":"https://api.github.com/users/tandr/received_events","type":"User","site_admin":false},"labels":[{"id":150727130,"node_id":"MDU6TGFiZWwxNTA3MjcxMzA=","url":"https://api.github.com/repos/golang/protobuf/labels/working-as-intended","name":"working-as-intended","color":"ffffff","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2018-08-02T16:55:23Z","updated_at":"2018-08-03T21:47:19Z","closed_at":"2018-08-03T21:47:19Z","author_association":"NONE","body":"Ok, I am trying to convert our code (pre-XXX) to the latest protoc-gen-go and... I am seriously thinking about switching back to json.\r\n\r\nSide effects so far\r\n- Things that were perfectly comparable are not comparable any more (most of our structs were strings and ints, nothing fancy). Now I have to use proto.Equals(), which uses **reflection**. Something tells me that speedup that I got from using protobuf might be slowly disappearing into comparisons and special cases to handle it (that I need to remember when I am using it). (this is covered by @sitano in https://github.com/golang/protobuf/issues/607)\r\n- getting panic in tests for code that serializing / deserializing the following (handrolled) code for serialization that was perfectly working before. (We have many of these little things created without proto files, and it was considered a nice feature of proto to be able to do it easily)\r\n\r\n```go\r\ntype leveldbModTime struct {\r\n\tModTime *proto.Timestamp `protobuf:\"bytes,1,opt,name=modTime\" json:\"modTime,omitempty\"`\r\n}\r\n\r\nfunc (m * leveldbModTime) Reset()         { *m = leveldbModTime{} }\r\nfunc (m * leveldbModTime) String() string { return proto.CompactTextString(m) }\r\nfunc (* leveldbModTime) ProtoMessage()    {}\r\n\r\nfunc init() {\r\n\tproto.RegisterType((* leveldbModTime)(nil), \"tandr.leveldbModTime\")\r\n}\r\n```\r\n\r\nand the panic stack is something like this \r\n\r\n```log\r\n=== RUN   TestStore_StoreLoad\r\n--- FAIL: TestStore_StoreLoad (0.16s)\r\npanic: runtime error: invalid memory address or nil pointer dereference [recovered]\r\n\tpanic: runtime error: invalid memory address or nil pointer dereference\r\n[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x1185538]\r\n\r\ngoroutine 29 [running]:\r\ntesting.tRunner.func1(0xc4201cab40)\r\n\t/usr/local/go/src/testing/testing.go:742 +0x29d\r\npanic(0x15a03a0, 0x1a32e00)\r\n\t/usr/local/go/src/runtime/panic.go:502 +0x229\r\ntandr/myexe1/vendor/github.com/golang/protobuf/proto.unmarshalStringValue(0xc4201d41e2, 0x1d4, 0x1df, 0x0, 0x2, 0xc4206db910, 0x101397c, 0xc4200ba878, 0xc4206db9d8, 0x10)\r\n\t/Users/tandrey/ww/go/src/tandr/myexe1/vendor/github.com/golang/protobuf/proto/table_unmarshal.go:1454 +0x108\r\ntandr/myexe1/vendor/github.com/golang/protobuf/proto.(*unmarshalInfo).unmarshal(0xc4200fbea0, 0x0, 0xc4201d41e0, 0x1d6, 0x1e0, 0x1cbee40, 0xc4201fe820)\r\n\t/Users/tandrey/ww/go/src/tandr/myexe1/vendor/github.com/golang/protobuf/proto/table_unmarshal.go:171 +0x7b7\r\ntandr/myexe1/vendor/github.com/golang/protobuf/proto.(*InternalMessageInfo).Unmarshal(0x1a45bc0, 0x16dafc0, 0x0, 0xc4201d41e0, 0x1d6, 0x1e0, 0x1, 0x1cbee40)\r\n\t/Users/tandrey/ww/go/src/tandr/myexe1/vendor/github.com/golang/protobuf/proto/table_unmarshal.go:63 +0x75\r\ntandr/myexe1/vendor/tandr/proto-interfaces/gen/go/myexe1_proto.(*Block).XXX_Unmarshal(0x0, 0xc4201d41e0, 0x1d6, 0x1e0, 0x0, 0x0)\r\n\t/Users/tandrey/ww/go/src/tandr/myexe1/vendor/tandr/proto-interfaces/gen/go/myexe1_proto/block.pb.go:173 +0x61\r\ntandr/myexe1/vendor/github.com/golang/protobuf/proto.Unmarshal(0xc4201d41e0, 0x1d6, 0x1e0, 0x16da200, 0xc42000e408, 0x1a64080, 0xc4201d41e0)\r\n\t/Users/tandrey/ww/go/src/tandr/myexe1/vendor/github.com/golang/protobuf/proto/decode.go:338 +0x1ad\r\ntandr/myexe1/leveldb_store.unpackBlock(0xc4201d41e0, 0x1d6, 0x1e0, 0x1e0, 0xc4201f27e0, 0x8)\r\n\t/Users/tandrey/ww/go/src/tandr/myexe1/leveldb_store/proto_helpers.go:44 +0x71\r\ntandr/myexe1/leveldb_store.(*leveldbStore).collectBlocks(0xc4201f41b0, 0x0, 0x0, 0x0, 0x0)\r\n\t/Users/tandrey/ww/go/src/tandr/myexe1/leveldb_store/leveldb_store.go:385 +0x272\r\ntandr/myexe1/leveldb_store.(*leveldbStore).LoadOutputs(0xc4201f41b0, 0xc4207100c0, 0x0, 0x0, 0x0, 0x0, 0xc4206e0b40)\r\n\t/Users/tandrey/ww/go/src/tandr/myexe1/leveldb_store/leveldb_store.go:327 +0x39\r\ntandr/myexe1/leveldb_store.(*leveldbResolver).LoadOutputs(0xc42000c080, 0xc4207100c0, 0x0, 0x0, 0xc4201cab40, 0x0, 0x0)\r\n\t/Users/tandrey/ww/go/src/tandr/myexe1/leveldb_store/leveldb_store_resolver.go:235 +0x97\r\ntandr/myexe1/leveldb_store.checkStoredBlocks(0xc4201cab40, 0x16e02c0, 0xc42000c080, 0xc420030240, 0x4, 0x0, 0x0)\r\n\t/Users/tandrey/ww/go/src/tandr/myexe1/leveldb_store/leveldb_store_test.go:366 +0x50\r\ntandr/myexe1/leveldb_store.setupAcAndOutputs(0xc4201cab40, 0x16e02c0, 0xc42000c080, 0x2d2, 0x10ed5c0, 0x10ed5ed, 0x17b06d0)\r\n\t/Users/tandrey/ww/go/src/tandr/myexe1/leveldb_store/leveldb_store_test.go:357 +0x498\r\ntandr/myexe1/leveldb_store.TestStore_StoreLoadOutputs(0xc4201cab40)\r\n\t/Users/tandrey/ww/go/src/tandr/myexe1/leveldb_store/leveldb_store_test.go:77 +0xb1\r\ntesting.tRunner(0xc4201cab40, 0x168ebe8)\r\n\t/usr/local/go/src/testing/testing.go:777 +0xd0\r\ncreated by testing.(*T).Run\r\n\t/usr/local/go/src/testing/testing.go:824 +0x2e0\r\nFAIL\ttandr/myexe1/leveldb_store\t1.968s\r\n```\r\n"}}
{"actor":{"display_login":"dsnet"}}