question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[windows] web workers - EBADF: bad file descriptor

See original GitHub issue

Maybe i should raise this over here - https://github.com/modulesio/window-worker

it looks like web workers are broken with the following output:

{ [Error: EBADF: bad file descriptor, read] errno: -4083, code: 'EBADF', syscall: 'read' }
{ [Error: EBADF: bad file descriptor, close] errno: -4083, code: 'EBADF', syscall: 'close' }
ErrorEvent {
  error:
   Error: EBADF: bad file descriptor, write
       at Object.writeSync (fs.js:564:3)
       at createRequest (c:\exokit\node_modules\window-worker\src\worker.js:24:8)
       at getScript (c:\exokit\node_modules\window-worker\src\worker.js:97:33)
       at c:\exokit\node_modules\window-worker\src\worker.js:124:17
       at onmessage (c:\exokit\node_modules\window-worker\src\worker.js:202:5)
       at onthreadmessage (c:\exokit\node_modules\child-process-thread\child.js:14:5),
  message: 'EBADF: bad file descriptor, write',
  filename: 'fs.js',
  lineno: 564 }
Bugsnag:  Encountered an uncaught error, terminating…
Error: EBADF: bad file descriptor, close

You can visit this glitch to test - https://sordid-asparagus.glitch.me/, it has a bare bones web worker example with the following code:

<!DOCTYPE html>
<html lang="en">
  <head>
  </head>  
  <body>
    <script>
      var myWorker = new Worker("worker.js");
      myWorker.postMessage('hello worker'); 
      myWorker.onmessage = function(e) {
        console.log(e.data);
      }
    </script>
  </body>
</html>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sidequestlegendcommented, Nov 1, 2018

i can confirm this is now workering again 😉

1reaction
avaercommented, Oct 28, 2018

The reason window-worker exists is all of the alternatives are missing a ton of features like importScripts, transferables, forklessness, url/blob support, native re-require, and probably more I forgot.

The window-worker fix is to fix blocking pipes on windows (Unix is not a problem). Or we could sidestep the need for them by doing the synchronous piping inside the worker itself with native node workers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: EBADF: bad file descriptor, uv_pipe_open · Issue #680
Debug Console output infor. OS: win32 x64 Adapter node: v7.9.0 x64 vscode-chrome-debug-core: 3.23.0 Starting debugger app worker.
Read more >
Running "rails test" is throwing Bad file descriptor (Errno
We get the Bad file descriptor (Errno::EBADF) after a handful of tests are run if we run it against mysql 8.0, but mysql...
Read more >
CS110 Assignment 3: All Things Multiprocessing
The script can output information about the open file descriptors for any ... file descriptor) close(1000) = -1 EBADF (Bad file descriptor) ...
Read more >
Failed readahead on ifile EBADF: Bad file descriptor 失败案例 ...
终于正确配置好Hadoop了,我用的是centos7 伪分布式安装,做个记录,留个纪念,也为和我遇到同样问题的道友“排忧解难”一下
Read more >
redbean
single file distributable web server. ... On Windows redbean executes just like any other program. ... -f, log worker function calls.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found