Title: libuv update in 18.18.0 breaks webpack's `thread-loader` · Issue #49911 · nodejs/node · GitHub
Open Graph Title: libuv update in 18.18.0 breaks webpack's `thread-loader` · Issue #49911 · nodejs/node
X Title: libuv update in 18.18.0 breaks webpack's `thread-loader` · Issue #49911 · nodejs/node
Description: Version v18.18.0 Platform Linux abulia 6.5.0-1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.3-1 (2023-09-13) x86_64 GNU/Linux Subsystem No response What steps will reproduce the bug? Starting in an empty directory, Create the following files:...
Open Graph Description: Version v18.18.0 Platform Linux abulia 6.5.0-1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.3-1 (2023-09-13) x86_64 GNU/Linux Subsystem No response What steps will reproduce the bug? Starting in an empt...
X Description: Version v18.18.0 Platform Linux abulia 6.5.0-1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.3-1 (2023-09-13) x86_64 GNU/Linux Subsystem No response What steps will reproduce the bug? Starting in an empt...
Opengraph URL: https://github.com/nodejs/node/issues/49911
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"libuv update in 18.18.0 breaks webpack's `thread-loader`","articleBody":"### Version\r\n\r\nv18.18.0\r\n\r\n### Platform\r\n\r\nLinux abulia 6.5.0-1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.3-1 (2023-09-13) x86_64 GNU/Linux\r\n\r\n### Subsystem\r\n\r\n_No response_\r\n\r\n### What steps will reproduce the bug?\r\n\r\nStarting in an empty directory,\r\n\r\n1. Create the following files:\r\n * package.json:\r\n ```json\r\n {\r\n \t\"dependencies\": {\r\n \t\t\"thread-loader\": \"^4.0.2\",\r\n \t\t\"webpack\": \"^5.88.2\",\r\n \t\t\"webpack-cli\": \"^4.10.0\"\r\n \t}\r\n }\r\n ```\r\n * webpack.config.js:\r\n ```\r\n const path = require( 'path' );\r\n \r\n module.exports = {\r\n mode: 'production',\r\n entry: './index.js',\r\n output: {\r\n path: path.resolve( __dirname, 'dist' ),\r\n filename: 'foo.bundle.js',\r\n },\r\n module: {\r\n rules: [\r\n {\r\n test: /\\.(js)$/,\r\n exclude: /node_modules/,\r\n use: [\r\n {\r\n loader: require.resolve( 'thread-loader' ),\r\n },\r\n ],\r\n }\r\n ]\r\n },\r\n };\r\n ```\r\n2. Run `node -e 'console.log( \"console.log( typeof {} );\" ); for(let i=0; i\u003c5000; i++){ console.log( \"// we need a large file in order to trigger the bug\" ); }' > index.js`. Increase the \"5000\" if necessary, I don't know whether it depends on the system in some manner.\r\n3. `npm install`\r\n4. `npm exec webpack`\r\n\r\n### How often does it reproduce? Is there a required condition?\r\n\r\nAlways. No requirements I know of beyond what's described above and being on Linux.\r\n\r\n### What is the expected behavior? Why is that the expected behavior?\r\n\r\n```\r\nasset foo.bundle.js 22 bytes [emitted] [minimized] (name: main)\r\n./index.js 254 KiB [built] [code generated]\r\nwebpack 5.88.2 compiled successfully in 376 ms\r\n```\r\nBecause that's what happens when webpack runs successfully.\r\n\r\n### What do you see instead?\r\n\r\nProcess hangs before producing any output. CPU is not being used, processes seem to be waiting in `epoll_pwait`.\r\n\r\n### Additional information\r\n\r\nIt worked in 18.17.1. fb2b80fca08fca9940e4fd1c2fa0fa7f7c33b056 appears to be the first failing commit.\r\n\r\nSetting `UV_USE_IO_URING=0` works around the problem. Of course, that's undocumented and temporary so a real fix would be good.\r\n\r\nI found this problem exists in 20.3.0 through 20.6.1 as well, but is not present in 20.7.0. A `git bisect` turned up 88ba79b083517c5d0790ca1ba7d4e78cfd84c390 as the commit that fixed it. Cherry-picking that commit onto 18.18.0 fixes it for me there too.\r\n\r\nSo my guess is that the new io_uring stuff started returning short writes when passed a lot of data, which WriteStream didn't handle correctly until 88ba79b083517c5d0790ca1ba7d4e78cfd84c390 fixed it.\r\n\r\nSee also https://github.com/webpack-contrib/thread-loader/issues/191","author":{"url":"https://github.com/anomiex","@type":"Person","name":"anomiex"},"datePublished":"2023-09-27T20:54:14Z","url":"https://github.com/nodejs/node/issues/49911"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:e187506a-3062-38a3-aa6b-4a67dcf661e4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 84F8:EC78C:7CDE20:A6B312:6B063194 |
| html-safe-nonce | dd6169345d3ef666467c9432fe909f021f4083f3bb68ea7e16c15f4775e0d5cf |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEY4OkVDNzhDOjdDREUyMDpBNkIzMTI6NkIwNjMxOTQiLCJ2aXNpdG9yX2lkIjoiODMxNDI4MTM2Nzk0NTIyODY5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 69f9fb03df9fb8a3e245c95144aec8d72d1bcaef83f35f78358c806c92467292 |
| hovercard-subject-tag | issue:1916304201 |
| 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/49911/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3632dd8a83932dba67fdcfb9d3c957f72c28436c2b9c80b3783aafaad6289056/nodejs/node/issues/49911 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3632dd8a83932dba67fdcfb9d3c957f72c28436c2b9c80b3783aafaad6289056/nodejs/node/issues/49911 |
| og:image:alt | Version v18.18.0 Platform Linux abulia 6.5.0-1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.3-1 (2023-09-13) x86_64 GNU/Linux Subsystem No response What steps will reproduce the bug? Starting in an empt... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | anomiex |
| hostname | github.com |
| expected-hostname | github.com |
| None | c3584c853cd39700ecff6e2cf8364295ffdb5313e571046c41cd2479270f7df0 |
| 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 | 9eb3bb1597d09170a5f282cd38ae376dee1a5ec1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width