square / square/wire

Crash on field tags

Open
#1,862 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
4.4k
Forks
627
Avg merge
3d 15m
Merged PRs (30d)
20

Description

// Copyright (c) 2015, Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.api;

import "google/api/http.proto";
import "google/protobuf/descriptor.proto";

option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
option java_multiple_files = true;
option java_outer_classname = "AnnotationsProto";
option java_package = "com.google.api";
option objc_class_prefix = "GAPI";

extend google.protobuf.MethodOptions {
  // See `HttpRule`.
  HttpRule http = 72295728;
}
Cause: multiple fields share tag 72295728:
  1. http (/Users/tolu/src/kampus_idl/idl/google/api/annotations.proto:30:3)
  2. http (/Users/tolu/src/kampus_idl/idl/google/api/annotations.proto:30:3)
  for message google.protobuf.MethodOptions (google/protobuf/descriptor.proto:689:1)
multiple fields share name http:
  1. http (/Users/tolu/src/kampus_idl/idl/google/api/annotations.proto:30:3)
  2. http (/Users/tolu/src/kampus_idl/idl/google/api/annotations.proto:30:3)
  for message google.protobuf.MethodOptions (google/protobuf/descriptor.proto:689:1)

I'm getting errors that multiple fields share the same tag, but the two fields it's referring are the same.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the report with annotations.proto, including its imports of google/api/http.proto and google/protobuf/descriptor.proto. Inspect the compiler path that reports duplicate tags and names for google.protobuf.MethodOptions; done means the reported input no longer crashes or incorrectly treats the same field declaration as two fields.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.