protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Fix signature of `PyUpb_MessageMeta_Clear`

Open hoodmane opened this issue 1 year ago • 2 comments

A tp_clear function should have signature int f(PyObject*). The presence of erroneous extra parameters leads to undefined behavior as indicated in the C specification 6.3.2.3.8. In WebAssembly builds, this causes crashes. https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf#page=60

hoodmane avatar Aug 27 '24 10:08 hoodmane

Thanks for the review @haberman. Can this be merged?

hoodmane avatar Aug 28 '24 12:08 hoodmane

We have an automated system that should take over now and submit the change internally first, with it propagating to GitHub after.

haberman avatar Aug 28 '24 15:08 haberman

Why did the bot close this? The patch is clearly correct...

hoodmane avatar Sep 02 '24 07:09 hoodmane

It was closed because the bot committed the change in https://github.com/protocolbuffers/protobuf/commit/b915e9f44e9d979617d7738f7ddd7dd02ccd7c76

haberman avatar Sep 03 '24 00:09 haberman

Out of curiosity, what's your use case for compiling this to WebAssembly? I'd love to hear how that works out.

haberman avatar Sep 03 '24 00:09 haberman

Ah, the workflow here is a bit confusing, thanks for the explanation! It might be helpful for new contributors if the bot posted a comment explaining that the PR was merged. It does say "closed in commit hash" but I got confused because github marks the status as Closed and not Merged.

what's your use case

@bartbreore could perhaps clarify what he uses it for. He added a wasm protobuf build to Pyodide in May of 2023. I think he was mostly concerned about other packages downstream of protobuf but I'm not sure which ones. https://github.com/pyodide/pyodide/pull/3813

hoodmane avatar Sep 03 '24 08:09 hoodmane