Title: napi_get_value_uint32 difference between Node 14 and previous · Issue #33117 · nodejs/node · GitHub
Open Graph Title: napi_get_value_uint32 difference between Node 14 and previous · Issue #33117 · nodejs/node
X Title: napi_get_value_uint32 difference between Node 14 and previous · Issue #33117 · nodejs/node
Description: Hi, In sodium-native we have a special malloc that allows you to allocated a mmap'ed buffer with special flags that provide extra protection. The signature is sodium_malloc(bytes) where bytes can be up to 0xffffffff. Until Node 14 napi_g...
Open Graph Description: Hi, In sodium-native we have a special malloc that allows you to allocated a mmap'ed buffer with special flags that provide extra protection. The signature is sodium_malloc(bytes) where bytes can b...
X Description: Hi, In sodium-native we have a special malloc that allows you to allocated a mmap'ed buffer with special flags that provide extra protection. The signature is sodium_malloc(bytes) where bytes c...
Opengraph URL: https://github.com/nodejs/node/issues/33117
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"napi_get_value_uint32 difference between Node 14 and previous","articleBody":"Hi,\r\n\r\nIn sodium-native we have a special malloc that allows you to allocated a mmap'ed buffer with special flags that provide extra protection. The signature is `sodium_malloc(bytes)` where `bytes` can be up to `0xffffffff`. Until Node 14 `napi_get_value_uint32` would fail for numbers outside this range (eg. `-1` or `Number.MAX_SAFE_INTEGER`) but for Node 14 our tests now fail with varying errors on different operating system. My guess is that in Node 14, this wraps around, but it is unspecified by the napi docs whether wrap around does happen, so we might have relied on undefined behaviour.\r\n\r\nHere is our failing tests:\r\nhttps://github.com/sodium-friends/sodium-native/blob/91e28b44648164ba8054f22e9a96c826329462bd/test/memory.js#L117-L125\r\n\r\nHere is the macro we use to read a `uint32_t` from a `Number`:\r\nhttps://github.com/sodium-friends/sodium-native/blob/91e28b44648164ba8054f22e9a96c826329462bd/macros.h#L157-L161","author":{"url":"https://github.com/emilbayes","@type":"Person","name":"emilbayes"},"datePublished":"2020-04-28T07:00:06Z","url":"https://github.com/nodejs/node/issues/33117"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| 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:27d4003a-7d1b-d4a4-4d89-59cc5f73909a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9692:2529CF:76031A:9F9DDF:6AED2A44 |
| html-safe-nonce | 5b762bed965a5fc2cb8d1bd386f66f9d78876c4c6120388925b9e191ef0d793b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NjkyOjI1MjlDRjo3NjAzMUE6OUY5RERGOjZBRUQyQTQ0IiwidmlzaXRvcl9pZCI6IjI5OTYyNTIxMTkwMDcwNDYyMTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 1eb4f9bc1e127ac45fcddf844405a1a524b6376613de6f4b9d9ffaa936a5ad24 |
| hovercard-subject-tag | issue:608074787 |
| 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/nodejs/node/33117/issue_layout |
| twitter:image | https://opengraph.githubassets.com/34a4d711c799da318d2964defa82dc21f3015f04cd4dc48d59d739b1983e1cc1/nodejs/node/issues/33117 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/34a4d711c799da318d2964defa82dc21f3015f04cd4dc48d59d739b1983e1cc1/nodejs/node/issues/33117 |
| og:image:alt | Hi, In sodium-native we have a special malloc that allows you to allocated a mmap'ed buffer with special flags that provide extra protection. The signature is sodium_malloc(bytes) where bytes can b... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | emilbayes |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d95365dda0576efe9b71f45807595e396bd0ca9286fba5367a05048e6ddf8f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| 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 | 98b41fa4b5635ceb45a4c54320fced73817ff290 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width