google-code-export / protobuf

Automatically exported from code.google.com/p/protobuf
Other
1 stars 1 forks source link

Protocol compiler doesn't issue an meaningful error message when two custom options use the same extension field number. #526

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
- upgrade to 2.5

What is the expected output? What do you see instead?
- expected: java sources
- I see:    protoc error

What version of the product are you using? On what operating system?
- 2.5.0 win32

Please provide any additional information below.

Upgrading to 2.5.0 our build stops working. Executing protoc I get:

[libprotobuf FATAL google/protobuf/compiler/java/java_file.cc:123] CHECK 
failed: CollectExtensions(*dynamic_file_proto, extensions): Find unknown fields 
in FileDescriptorProto when building authentication_protocol.proto. It's likely 
that those fields are custom options, however, those options cannot be 
recognized in the builder pool. This normally should not happen. Please report 
a bug.

I can't attach our protocols directly into this issue, but I could send them 
private by mail on request.

Thank you.

Original issue reported on code.google.com by dusan...@gmail.com on 1 Jul 2013 at 1:03

GoogleCodeExporter commented 9 years ago
Can you find a minimum .proto file that can reproduce the problem and then 
attach the source?

Original comment by xiaof...@google.com on 1 Jul 2013 at 5:23

GoogleCodeExporter commented 9 years ago
Hi,

sorry, I can't isolate the problem.

It seems to be some 'race' bug, because when I change 'protoc' argument 
order ( but I still use the same bundle of .proto files ), compilation 
succeed.

Please see attached ( a little bit complex ) example.

You can simulate the problem easily - see two shell scripts - one will 
fail, one will succeed. It seems there is no sense in order of arguments 
in 'success' script, because all higher level protocols ( 
authentication, system information ... ) are based/encapsulated into 
lower level protocols (nano, header, ...).

Original comment by dusan...@gmail.com on 2 Jul 2013 at 8:56

GoogleCodeExporter commented 9 years ago
I didn't see the attachment?

Original comment by xiaof...@google.com on 2 Jul 2013 at 5:25

GoogleCodeExporter commented 9 years ago
Was re-sent to your private mail.

Original comment by dusan...@gmail.com on 3 Jul 2013 at 6:47

GoogleCodeExporter commented 9 years ago
The actual problem is that there are two .protos both defining an extension to 
MessageOptions using the same extension field number. This conflict causes 
protocol compiler to fail when parsing custom options.
The solution is to remove one of the duplicated extension definitions. For 
protobuf, the protocol compiler should generate a more meaningfully error 
message in this case.

Original comment by xiaof...@google.com on 10 Jul 2013 at 6:31

GoogleCodeExporter commented 9 years ago
Any update on this issue?  It seems to be still a problem (I just ran into it 
using 2.6.1).

Jason

Original comment by j...@squareup.com on 3 Feb 2015 at 4:09