Skip to content

Instantly share code, notes, and snippets.

@watson
Last active October 28, 2015 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save watson/d3c222b3d7f1ca599b80 to your computer and use it in GitHub Desktop.
Save watson/d3c222b3d7f1ca599b80 to your computer and use it in GitHub Desktop.
Debugging EBADF in Node.js
(libuv) Failed to create kqueue (24)
(libuv) Failed to create kqueue (24)
events.js:72
throw er; // Unhandled 'error' event
^
Error: write EBADF
at errnoException (net.js:905:11)
at WriteStream.Socket._write (net.js:646:26)
at doWrite (_stream_writable.js:226:10)
at writeOrBuffer (_stream_writable.js:216:5)
at WriteStream.Writable.write (_stream_writable.js:183:11)
at WriteStream.Socket.write (net.js:616:40)
at Console.log (console.js:54:16)
at /Users/watson/code/node_modules/stackman/too-many-open-files.js:5:13
at fs.js:208:20
at Object.oncomplete (fs.js:108:15)
var fs = require('fs')
for (var n = 0; n < 300; n++) {
fs.readFile(__filename, function () {
console.log() // just having a console log makes the program throw (see error.log)
})
}
var fs = require('fs')
for (var n = 0; n < 300; n++) {
fs.readFile(__filename, function () {
// noop
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment