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

Segmentation Fault with Node version 13 but not with version 12 #151

Closed
Kylir opened this issue May 27, 2020 · 11 comments
Closed

Segmentation Fault with Node version 13 but not with version 12 #151

Kylir opened this issue May 27, 2020 · 11 comments
Assignees
Labels
question Further information is requested

Comments

@Kylir
Copy link

Kylir commented May 27, 2020

I wanted to share with who may be interested.

With NodeJS version 13 on Linux (Manjaro) I experienced some Segmentation Fault while using Nut.js - Especially the screen functions.
Switching to Node version 12 solved the issue.

I'm more than happy to do any testing if needed.

@s1hofmann s1hofmann self-assigned this May 28, 2020
@s1hofmann s1hofmann added the question Further information is requested label May 28, 2020
@s1hofmann
Copy link
Member

Hi @Kylir, thanks for reaching out!

May I ask about your particular setup?
Which node versions are you using?

CI is running fine latest versions, but I do not have info about any prior release for node v13.

Can you elaborate on what some segfaults means?
Is it only related to screen functions, or are keyboard / mouse actions also causing trouble?

Best regards

Simon

@Kylir
Copy link
Author

Kylir commented May 29, 2020

Sure! More than happy to help.

My system is Linux Manjaro (5.4.40-1-MANJARO).
My window manager is i3 version 4.18.1

When using Node v13.5.0, Any screen functions would make the program stop and output "Segmentation Fault (Core dump)" with no additional message.
Mouse and Keyboard functions are working fine.

I suspected some kind of problem with opencv4nodejs on my set-up, so I tried to install it in a separate project. The build went OK, no errors. I didn't try to use it though.

Switching to Node v12.16.2 solved all my issues it seems.

How can I give more info on the Seg fault?

@wilforlan
Copy link

Hi, @Kylir did all the issues stop on 12.16.2 permanently for you?
@s1hofmann I am experiencing the same issue when running nut-js in a docker container.

The segmentation fault issue occurs when I use any of the screen functions. Mouse and Keyboard works fine.

Ubuntu 20.04.1 LTS
Node 12.12.0 (I have tried 12.16.2 and 14.16.0 as well non worked)
Docker version 20.10.5, build 55c4c88

I can see the project uses a prebuilt version of opencv. When looking at the documentation for opencv4nodejs, I see where it's recommended to use a dockerized version of opencv when running the application inside docker.

@s1hofmann Is there a recommended way to use nut-js inside docker?

@s1hofmann
Copy link
Member

Hi @wilforlan 👋 ,

may I ask which Docker image you're using?

@wilforlan
Copy link

Hi @wilforlan 👋 ,

may I ask which Docker image you're using?

I'm currently using mdouchement/zoom-us:latest
Repo: https://github.com/mdouchement/docker-zoom-us

@s1hofmann
Copy link
Member

s1hofmann commented Apr 3, 2021

Hi @wilforlan 👋 ,

I noticed the image you mentioned mounts the X socket but does not set the $DISPLAY environment variable (which is used to connect to the X server).
Unfortunately, I have no machine at hand to run some tests by myself, but could you try running your image with $DISPLAY set?

E.g.

docker run -e DISPLAY=:0.0 mdouchement/zoom-us:latest

Regardless the outcome, X display handling needs some additional error handling, I'll open a separate issue for that 👍

@wilforlan
Copy link

Hi @s1hofmann, I'm actually already setting the display in my Dockerfile like so ENV DISPLAY :99. The GUI application (in this case Zoom) is able to connect to the X server successfully. I have also started the X server like so

Xvfb :99 -screen 0 1280x720x16

This issue still occurs after setting this, so I used a seg-fault handler module and I got this (see screenshot below)

image

@s1hofmann
Copy link
Member

@wilforlan Ok, so at the moment I'm not sure what's causing this issue. I'm running nut.js in a Docker container on CI and haven't encountered any issues so far.

@wilforlan
Copy link

Okay. Can you share some part of the Dockerfile that might seem relevant?
Thank you for your help so far. @s1hofmann

@s1hofmann
Copy link
Member

I'm using an image which provides a full containerized UI.
See https://github.com/nut-tree/whale-nut/tree/master/whale-nut-ci

@s1hofmann
Copy link
Member

Closed due to inactivity. Feel free to reopen if there are any updates

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

No branches or pull requests

3 participants