Title: test_unicode test_raiseMemError miscalculates struct size when string has UTF-8 representation. · Issue #93575 · python/cpython · GitHub
Open Graph Title: test_unicode test_raiseMemError miscalculates struct size when string has UTF-8 representation. · Issue #93575 · python/cpython
X Title: test_unicode test_raiseMemError miscalculates struct size when string has UTF-8 representation. · Issue #93575 · python/cpython
Description: The test case test_raiseMemError assumes that all structs have a NULL byte of length 1. However compact_struct_size allocate 2 or 4 bytes space for NULL bytes: (PyUnicode_GET_LENGTH(self) + 1) * PyUnicode_KIND(self). Note that it's (len(...
Open Graph Description: The test case test_raiseMemError assumes that all structs have a NULL byte of length 1. However compact_struct_size allocate 2 or 4 bytes space for NULL bytes: (PyUnicode_GET_LENGTH(self) + 1) * Py...
X Description: The test case test_raiseMemError assumes that all structs have a NULL byte of length 1. However compact_struct_size allocate 2 or 4 bytes space for NULL bytes: (PyUnicode_GET_LENGTH(self) + 1) * Py...
Opengraph URL: https://github.com/python/cpython/issues/93575
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_unicode test_raiseMemError miscalculates struct size when string has UTF-8 representation.","articleBody":"The test case ``test_raiseMemError`` assumes that all structs have a NULL byte of length 1. However ``compact_struct_size`` allocate 2 or 4 bytes space for NULL bytes: ``(PyUnicode_GET_LENGTH(self) + 1) * PyUnicode_KIND(self)``. Note that it's ``(len(s) + 1) * char_size``, not ``len(s) * char_size + 1``. The bug introduces an off-by-one / off-by-three error that sometimes leads to failing test on WASI, because code does not raise a memory error.","author":{"url":"https://github.com/tiran","@type":"Person","name":"tiran"},"datePublished":"2022-06-07T10:50:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/93575/cpython/issues/93575"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:61bf1fd9-2e4f-c2fd-a885-06399be2d221 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AC90:274FD0:AF4F34:EECC24:69697DE2 |
| html-safe-nonce | 2adb76a058b92483aa675dab366505b038e65f3a18bce9bf7207a99fb69265a5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzkwOjI3NEZEMDpBRjRGMzQ6RUVDQzI0OjY5Njk3REUyIiwidmlzaXRvcl9pZCI6IjU0MTU3NTQ3NjMzMDQ3OTU2MTgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0f45a967ff964f0d8d0e2162cb7c3579db1adc59438951a75d89c8d2cec8ddf7 |
| hovercard-subject-tag | issue:1263100006 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/93575/issue_layout |
| twitter:image | https://opengraph.githubassets.com/506177bea382b8439c359850c61bcd05716954a129361467839e8f86cd007613/python/cpython/issues/93575 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/506177bea382b8439c359850c61bcd05716954a129361467839e8f86cd007613/python/cpython/issues/93575 |
| og:image:alt | The test case test_raiseMemError assumes that all structs have a NULL byte of length 1. However compact_struct_size allocate 2 or 4 bytes space for NULL bytes: (PyUnicode_GET_LENGTH(self) + 1) * Py... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tiran |
| hostname | github.com |
| expected-hostname | github.com |
| None | f33e4b94c8824ab2b434d82a94139432fb5ebee9df4b75304140ad22508c4a77 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 48f380098b30acbb700b04f1724481ca10d574fc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width