Skip to content

Protobuf Python 5.28.0 crashes in __str__ on Windows x64 #18045

Closed
@mtnpke

Description

What version of protobuf and what language are you using?
Version: v5.28.0

Language: Python

What operating system (Linux, Windows, ...) and version?
Windows 11 23H2 Build 22631.4037

What runtime / compiler are you using (e.g., python version or gcc version)
Python 3.12.5 (tags/v3.12.5:ff3bc82, Aug 6 2024, 20:45:27) [MSC v.1940 64 bit (AMD64)] on win32

What did you do?

  • Create Python venv
  • Run pip install protobuf (as of today: installs protobuf 5.28.0)
  • Create test.proto with this content:
syntax = "proto3";

message MyMessage {
    string test = 1;
}
  • Run protoc --python_out=. -I. test.proto
  • Create test.py with this content:
import test_pb2
for i in range(100):
    print(i)
    m = test_pb2.MyMessage()
    print(m)
print("ok")
  • Run python test.py

What did you expect to see
Counting from 0 to 99 and then "ok"

What did you see instead?
Crash at i = 1

image

image

Note: There is no crash with protobuf Python package 5.27.4. Crashing starts with 5.28.0rc1.

Note: If you include an integer field instead of a string, it will not crash, but display random values for the field.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions