Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix no display found error on Node 12.13.1+ on macOS #180

Closed
dhritzkiv opened this issue Jan 1, 2020 · 7 comments
Closed

Fix no display found error on Node 12.13.1+ on macOS #180

dhritzkiv opened this issue Jan 1, 2020 · 7 comments

Comments

@dhritzkiv
Copy link
Member

dhritzkiv commented Jan 1, 2020

While attempting to fix the CI issues on macOS, it became apparent that headless-gl doesn't work on macOS with nodejs 12.13.1 and higher. nodejs 12.13.0 still works, believe it or not.

I have not been able to pinpoint the cause of the breakage yet. All I know is that it's unrelated to the building of the native module with gyp (as building on 12.13.0, then running 12.13.1 doesn't work). It's likely a runtime issue.

@dhritzkiv dhritzkiv changed the title Fix no display found error on Node 12.3.1+ on macOS Fix no display found error on Node 12.13.1+ on macOS Jan 2, 2020
@dhritzkiv
Copy link
Member Author

dhritzkiv commented Jan 2, 2020

It seems that eglInitialize in webgl.cc fails in node 12.13.1.

I believe I've narrowed down the change in node that may have brought this about.

This commit to node (nodejs/node@2764567f90) upgraded libuv. Inside the upgrade was this insignificant, seemingly unrelated change: libuv/libuv@038eacf

As crazy as it sounds, the process-title code may be the culprit. (!!)

Why do I suspect this? Three years ago when first working with headless-gl, I noticed that my implementation suddenly stopped working on OSX. I eventually traced it back to me setting process.title to some value. I scratched my head, removed the process.title line, and moved on without thinking too much more about it.

In fact, you can re-create the behaviour of this issue's bug in Node 12.13.0 and below by simply doing this in any JS file that is required by the process:

process.title = "Foo";

// the rest of your code

I'm planning to build node from source just before that commit and just after that commit to confirm my suspicions. As for the next steps after that? No idea.

@dhritzkiv
Copy link
Member Author

dhritzkiv commented Jan 2, 2020

Amazingly, more digging turned up this issue: libuv/libuv#2566 (and nodejs/node-gyp#1981)

Not exactly our problem, but looks extremely related.

The suspect code has been reverted in libuv, but a new version hasn't been created. It might be some time before it makes its way into a new node release. Hopefully any libuv upgrade will also make it into node v12.

Unfortunately, I don't believe there is anything to do on our end.

The README will need to be updated to note the total breakage in certain version ranges of node.

@mourner
Copy link
Collaborator

mourner commented Jan 2, 2020

Wow, that's super obscure! Good work on narrowing down the issue. Yeah, it seems there's nothing we can do but declare a certain range of Node versions unsupported.

@Nismit
Copy link

Nismit commented Jan 29, 2020

Thank you for digging into the issue.
I noticed Node v13.7.0 has been updated libuv (https://github.com/nodejs/node/releases/tag/v13.7.0)
so, I tested;
Node v13.7.0 + gl v4.4.1, it's working. (while installing, I got some warnings)
Node v13.6.0 + gl v4.4.1, it does not work. (while installing, I got some warnings as well)
I didn't tested deeply, something won't work possibly but I'd like to let you know that.

Thank you so much for contribution and maintenance!

FYI:
Machine Specs.
MacBook Pro (Retina, 15-inch, Mid 2014)
MacOS Catalina 10.15.2

@dhritzkiv
Copy link
Member Author

Thanks for updating this thread, @Nismit. Looks like 13.7.0 includes the fix. I've submitted an issue to nodejs (nodejs/node#31623) to back port the changes to the 12.x line.

I'll close the issue when nodejs 12.x (or the next LTS) is working again.

@Nismit
Copy link

Nismit commented Feb 4, 2020

Perfect. Thank you for hard working for it.
Hope it will be approved.

@dhritzkiv
Copy link
Member Author

Fixed with the releases of Node v12.16.2 and v13.7.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants