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 on Arch/Wayland/Hyprland #248

Closed
Jeff4Success opened this issue Apr 19, 2023 · 14 comments
Closed

Segmentation Fault on Arch/Wayland/Hyprland #248

Jeff4Success opened this issue Apr 19, 2023 · 14 comments
Labels
bug Something isn't working

Comments

@Jeff4Success
Copy link

Jeff4Success commented Apr 19, 2023

I've installed the package from the repository and the AUR, and when I try to connect from a remote it shows the screen for a brief instance and then wayvnc crashes with a segmentation fault. I ran the debug and here it is.

wayvnc --log-level=debug 0.0.0.0
Info: Capturing output eDP-1
Info: >> AU Optronics 0x123D (eDP-1) 1920x1080+0x0 Power:ON
DEBUG: ../neatvnc/src/server.c: 1341: Trying address: 0.0.0.0
DEBUG: ../neatvnc/src/server.c: 1361: Successfully bound to address
Info: Listening for connections on 0.0.0.0:5900
DEBUG: ../wayvnc/src/ctl-server.c: 724: Initializing wayvncctl socket: /run/user/1000/wayvncctl
DEBUG: ../wayvnc/src/ctl-server.c: 693: Connecting to existing socket in case it's stale
DEBUG: ../wayvnc/src/ctl-server.c: 700: Connect failed: Connection refused
Warning: ../wayvnc/src/ctl-server.c: 703: Deleting stale control socket path "/run/user/1000/wayvncctl"
Info: New client connection from btc: 0x55865aa8a210 (ref 1)
Info: Starting screen capture
DEBUG: ../wayvnc/src/main.c: 1069: Client connected, new client count: 1
DEBUG: ../wayvnc/src/ctl-server.c: 849: Enqueueing client-connected event: {"id":"1","hostname":"btc","username":null,"connection_count":1}
DEBUG: ../wayvnc/src/ctl-server.c: 876: Enqueued client-connected event for 0 clients
Info: Choosing raw encoding for client 0x55865aa8a210
Segmentation fault (core dumped)

Let me know if I can get you more information. Thanks for being a open source developer!

@any1
Copy link
Owner

any1 commented Apr 20, 2023

A backtrace would be nice. There are instructions for that in the issue template for bug reports.

@KolojE
Copy link

KolojE commented Apr 22, 2023

I'm encountering the same problem here in Hyprland. It seems like a segmentation fault occurs whenever the screen frame updates or the mouse is moved, causing an immediate crash.

@rubyowo
Copy link

rubyowo commented Apr 23, 2023

facing same problem on hyprland here

version:

wayvnc: 0.6.0
neatvnc: 0.6.0
aml: 0.3.0

trace log:

Info: Capturing output eDP-1
Info: >> AU Optronics 0x133D (eDP-1) 1920x1080+0x0 Power:ON
DEBUG: ../src/server.c: 1167: Trying address: 0.0.0.0
DEBUG: ../src/server.c: 1182: Successfully bound to address
Info: Listening for connections on 0.0.0.0:5900
DEBUG: ../src/ctl-server.c: 724: Initializing wayvncctl socket: /run/user/1000/wayvncctl
Info: New client connection from localhost: 0x52de30 (ref 1)
Info: Starting screen capture
DEBUG: ../src/main.c: 1069: Client connected, new client count: 1
DEBUG: ../src/ctl-server.c: 849: Enqueueing client-connected event: {"id":"1","hostname":"localhost","username":null,"connection_count":1}
DEBUG: ../src/ctl-server.c: 876: Enqueued client-connected event for 0 clients
Info: Choosing tight encoding for client 0x52de30

stack trace: i know its useless because i haven't compiled it in debug mode, will update later

#0  0x00007fa137404a60 in murmurhash () from /nix/store/71786qk0c2crqqg0b058pm2wnb1alf2d-neatvnc-0.6.0/lib/libneatvnc.so.0
No symbol table info available.
#1  0x00007fa137404914 in damage_refine () from /nix/store/71786qk0c2crqqg0b058pm2wnb1alf2d-neatvnc-0.6.0/lib/libneatvnc.so.0
No symbol table info available.
#2  0x00007fa137402e2d in nvnc_display_feed_buffer () from /nix/store/71786qk0c2crqqg0b058pm2wnb1alf2d-neatvnc-0.6.0/lib/libneatvnc.so.0
No symbol table info available.
#3  0x000000000040867f in wayvnc_process_frame ()
No symbol table info available.
#4  0x00007fa13733c84a in ffi_call_unix64 () from /nix/store/gy3i9akr5w2dqdzjijcn0nv1df93bnw8-libffi-3.4.4/lib/libffi.so.8
No symbol table info available.
#5  0x00007fa13733b89e in ffi_call_int () from /nix/store/gy3i9akr5w2dqdzjijcn0nv1df93bnw8-libffi-3.4.4/lib/libffi.so.8
No symbol table info available.
#6  0x00007fa13733c2bd in ffi_call () from /nix/store/gy3i9akr5w2dqdzjijcn0nv1df93bnw8-libffi-3.4.4/lib/libffi.so.8
No symbol table info available.
#7  0x00007fa13741b706 in wl_closure_invoke () from /nix/store/4qn8kb4mrvrqi0iyha50xkq7zd9g2dp0-wayland-1.21.0/lib/libwayland-client.so.0
No symbol table info available.
#8  0x00007fa137417ac9 in dispatch_event.isra () from /nix/store/4qn8kb4mrvrqi0iyha50xkq7zd9g2dp0-wayland-1.21.0/lib/libwayland-client.so.0
No symbol table info available.
#9  0x00007fa137419414 in wl_display_dispatch_queue_pending () from /nix/store/4qn8kb4mrvrqi0iyha50xkq7zd9g2dp0-wayland-1.21.0/lib/libwayland-client.so.0
No symbol table info available.
#10 0x00000000004079cc in on_wayland_event ()
No symbol table info available.
#11 0x00007fa13745059c in aml_dispatch () from /nix/store/nycmqv5c9fpy39kiy5rnj875f742avcl-aml-0.3.0/lib/libaml.so.0
No symbol table info available.
#12 0x000000000040634d in main ()
No symbol table info available.

@any1
Copy link
Owner

any1 commented Apr 23, 2023

Looks like the compositor might be posting out-of-bounds damage. A patch like this for neatvnc should guard against it:

diff --git a/src/display.c b/src/display.c
index ec59959..470f69b 100644
--- a/src/display.c
+++ b/src/display.c
@@ -117,6 +117,9 @@ void nvnc_display_feed_buffer(struct nvnc_display* self, struct nvnc_fb* fb,
 	struct nvnc* server = self->server;
 	assert(server);
 
+	pixman_region_intersect_rect(damage, damage, 0, 0, fb->width,
+			fb->height);
+
 	struct pixman_region16 refined_damage;
 	pixman_region_init(&refined_damage);

@KolojE
Copy link

KolojE commented Apr 24, 2023

Thanks for sharing the patch! I tried it and it worked perfectly for me.

Looks like the compositor might be posting out-of-bounds damage. A patch like this for neatvnc should guard against it:

diff --git a/src/display.c b/src/display.c
index ec59959..470f69b 100644
--- a/src/display.c
+++ b/src/display.c
@@ -117,6 +117,9 @@ void nvnc_display_feed_buffer(struct nvnc_display* self, struct nvnc_fb* fb,
 	struct nvnc* server = self->server;
 	assert(server);
 
+	pixman_region_intersect_rect(damage, damage, 0, 0, fb->width,
+			fb->height);
+
 	struct pixman_region16 refined_damage;
 	pixman_region_init(&refined_damage);

@Consolatis
Copy link
Contributor

CC @vaxerski, JFYI

@vaxerski
Copy link

fixed

@any1 any1 added the bug Something isn't working label May 1, 2023
@tifasoftware
Copy link

patch works, might need to create issue on neatvnc.

@sitolam
Copy link

sitolam commented Aug 30, 2023

Thanks for sharing the patch! I tried it and it worked perfectly for me.

Looks like the compositor might be posting out-of-bounds damage. A patch like this for neatvnc should guard against it:

diff --git a/src/display.c b/src/display.c
index ec59959..470f69b 100644
--- a/src/display.c
+++ b/src/display.c
@@ -117,6 +117,9 @@ void nvnc_display_feed_buffer(struct nvnc_display* self, struct nvnc_fb* fb,
 	struct nvnc* server = self->server;
 	assert(server);
 
+	pixman_region_intersect_rect(damage, damage, 0, 0, fb->width,
+			fb->height);
+
 	struct pixman_region16 refined_damage;
 	pixman_region_init(&refined_damage);

How to apply this patch?

@KolojE
Copy link

KolojE commented Aug 31, 2023

Thanks for sharing the patch! I tried it and it worked perfectly for me.

Looks like the compositor might be posting out-of-bounds damage. A patch like this for neatvnc should guard against it:

diff --git a/src/display.c b/src/display.c
index ec59959..470f69b 100644
--- a/src/display.c
+++ b/src/display.c
@@ -117,6 +117,9 @@ void nvnc_display_feed_buffer(struct nvnc_display* self, struct nvnc_fb* fb,
 	struct nvnc* server = self->server;
 	assert(server);
 
+	pixman_region_intersect_rect(damage, damage, 0, 0, fb->width,
+			fb->height);
+
 	struct pixman_region16 refined_damage;
 	pixman_region_init(&refined_damage);

How to apply this patch?

Just edit the desired file and compile it yourself

@Rexoen
Copy link

Rexoen commented Sep 3, 2023

Looks like the compositor might be posting out-of-bounds damage. A patch like this for neatvnc should guard against it:

diff --git a/src/display.c b/src/display.c
index ec59959..470f69b 100644
--- a/src/display.c
+++ b/src/display.c
@@ -117,6 +117,9 @@ void nvnc_display_feed_buffer(struct nvnc_display* self, struct nvnc_fb* fb,
 	struct nvnc* server = self->server;
 	assert(server);
 
+	pixman_region_intersect_rect(damage, damage, 0, 0, fb->width,
+			fb->height);
+
 	struct pixman_region16 refined_damage;
 	pixman_region_init(&refined_damage);

Thanks for sharing the patch. it worked like a charm on my Archlinux/Hyprland.

@CarloCattano
Copy link

Having the same outcome by using wlvncc as a client

@eksno
Copy link

eksno commented Nov 27, 2023

On my end the issue is no longer precent, and the issue has been stale for a month. The issue should be able to be closed.

@Jeff4Success
Copy link
Author

Not sure I am supposed to closed, but since I am the OP, I will close it. What could it hurt? LOL! Thanks for every one who contributes to FOSS!

Repository owner deleted a comment from PlumpMath May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests