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

when php google/protobuf is used, generated binary php file cause exception after compiled to dll #1123

Open
chrislam1987 opened this issue Sep 22, 2023 · 1 comment

Comments

@chrislam1987
Copy link

chrislam1987 commented Sep 22, 2023

when php google/protobuf is used, generated binary php file cause exception after compiled to dll

as the generated binary is mixed up?

Hello, World!
Unhandled exception. Google\Protobuf\Internal\GPBDecodeException: Error occurred during parsing: Fail to push limit. in D:\ClassLibrary1\ClassLibrary1\vendor\google\protobuf\src\Google\Protobuf\Internal\CodedInputStream.php(339,12)
Stack trace:
#0 D:\ClassLibrary1\ClassLibrary1\vendor\google\protobuf\src\Google\Protobuf\Internal\CodedInputStream.php(362,8): CodedInputStream->pushLimit($byte_limit)
#1 D:\ClassLibrary1\ClassLibrary1\vendor\google\protobuf\src\Google\Protobuf\Internal\GPBWire.php(285,8): CodedInputStream->incrementRecursionDepthAndPushLimit($byte_limit, $old_limit, $recursion_budget)
#2 D:\ClassLibrary1\ClassLibrary1\vendor\google\protobuf\src\Google\Protobuf\Internal\Message.php(436,20): GPBWire::readMessage($input, $message)
@jakubmisek
Copy link
Member

This is caused by this piece of code: https://github.com/protocolbuffers/protobuf-php/blob/2e3487f1a15bed2fc2eb64f187ea4baea2760c93/src/Google/Protobuf/Internal/CodedInputStream.php#L316

Can you debug the program to see what's the actual variables value, or what is unexpected there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants