Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: Segfault comparing default message fields with protobuf 4.21.x #10257

Closed
villainy opened this issue Jul 15, 2022 · 2 comments
Closed
Labels

Comments

@villainy
Copy link

What version of protobuf and what language are you using?
Version: v21.2
Language: Python

What operating system (Linux, Windows, ...) and version?
Ubuntu Linux 20.04.4 LTS

What runtime / compiler are you using (e.g., python version or gcc version)
Python 3.10.5/3.9.13/3.8.13

What did you do?
Steps to reproduce the behavior:

  1. Create a protobuf outer message with an inner submessage field
  2. Build python module with protoc v21.2
  3. Compare (==) the default value of the outer message's field with a standalone instance of the inner message
  4. See Python segfault

What did you expect to see

Not a segfault

What did you see instead?

A segfault

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

Versions:

$ lsb_release -d
Description:    Ubuntu 20.04 LTS

$ protoc --version
libprotoc 3.21.2

$ python --version
Python 3.10.5

$ pip show protobuf|grep Version
Version: 4.21.2

Minimal reproducible protobuf repro.proto:

syntax = "proto3";

package repro;

message OuterMessage {
    uint32 id = 1;
    InnerMessage msg = 2;
}

message InnerMessage {
    uint32 id = 1;
}

Minimal reproducible python repro.py:

from repro_pb2 import OuterMessage, InnerMessage

outer = OuterMessage(id=1)
inner = InnerMessage(id=2)

outer.msg == inner

print("Segfault before we get here.")

Example output:

$ ls
repro.proto  repro.py

$ protoc --python_out . repro.proto

$ ls
repro.proto  repro.py  repro_pb2.py

$ python repro.py
Segmentation fault

Anything else we should know about your project / environment

@villainy villainy added the untriaged auto added to all issues by default when created. label Jul 15, 2022
@ericsalo
Copy link
Member

This looks identical to #10208, which I fixed three days ago. Please confirm whether this bug still exists after a fresh sync.

@villainy
Copy link
Author

Confirmed cannot reproduce from main. Thanks for the quick reply and sorry for the noise.

@fowles fowles added python and removed untriaged auto added to all issues by default when created. labels Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants