joyent/node — Issue #2698: difficult debugging - (libev) kevent EBADF
Author: AndreasMadsen
Created: 2012-02-04 20:41:10+00:00
State: open

So the error might just be me doing something very stupid. But the core issue is, that it's very difficult to isolate this error since there is no way to know where it happens.

**Testcase:**

* execute: https://gist.github.com/1740007
* Then I open my browser to `localhost:1337` and get the following:

```shell
Andreass-MacBook-Pro:node Andreas$ node child/deamon.js
head: 7684
deamon: 7685
process: 7686

/Users/Andreas/GitHub/node/child/deamon.js:61
throw 'oh shit x2';
^
oh shit x2
Andreass-MacBook-Pro:node Andreas$ deamon: 7688
(libev) kevent: Bad file descriptor
process: 7689
deamon: 7691
(libev) kevent: Bad file descriptor
process: 7692
deamon: 7693
(libev) kevent: Bad file descriptor
process: 7694
deamon: 7695
(libev) kevent: Bad file descriptor
process: 7696
deamon: 7697
```

It looks like the error isn't catched by `libuv` but just thrown by `libev`.

@mmalecki you might be interrested in the testcase.