ArcticaProject / nx-libs

nx-libs
Other
120 stars 39 forks source link

nxagent segfults with -geometry fullscreen #987

Closed realsimix closed 3 years ago

realsimix commented 3 years ago

I've just compiled latest code for my test systems and see a new crash with https://github.com/ArcticaProject/nx-libs/commit/f60ac577713c28212cdf2f4203b2cc0726034f5f

NX agent doesn't like -geometry fullscreen anymore and segfaults.

Backtrace from catched core is below:

Core was generated by `./nxagent -geometry fullscreen'.
Program terminated with signal 11, Segmentation fault.
...
(gdb) bt
#0  XYToWindow (x=0, y=0) at ../../dix/events.c:1935
#1  0x0000000000420555 in CheckMotion (xE=0x0) at NXevents.c:377
#2  WindowsRestructured () at ../../dix/events.c:2044
#3  0x000000000049fb62 in nxagentSetRootClip (enable=1, pScreen=0x203e650) at Screen.c:2266
#4  nxagentResizeScreen (pScreen=pScreen@entry=0x203e650, width=width@entry=1920, height=height@entry=1200, mmWidth=<optimized out>, mmWidth@entry=0, mmHeight=<optimized out>, mmHeight@entry=0, doresize=doresize@entry=1) at Screen.c:2433
#5  0x000000000049fdb8 in nxagentChangeScreenConfig (screen=screen@entry=0, width=1920, height=1200, doresize=doresize@entry=1) at Screen.c:3759
#6  0x00000000004a8021 in nxagentSwitchAllScreens (pScreen=0x203e650, switchOn=<optimized out>) at Window.c:906
#7  0x000000000049b075 in nxagentMaximizeToFullScreen (pScreen=pScreen@entry=0x203e650) at Screen.c:341
#8  0x00000000004aa478 in nxagentMapDefaultWindows () at Window.c:2559
#9  0x0000000000415c12 in InitRootWindow (pWin=0x206f0c0) at NXwindow.c:171
#10 0x000000000040e467 in main (argc=3, argv=0x7ffd81c3f468, envp=<optimized out>) at main.c:333

Any clues where in the recent changes this could come from.

Regards, Simon

uli42 commented 3 years ago

Mit directly, but I have added all screens and Singlescreen, can you please test those, too? Will check the code later today.

Simon Matter notifications@github.com schrieb am Sa., 16. Jan. 2021, 12:54:

I've just compiled latest code for my test systems and see a new crash with f60ac57 https://github.com/ArcticaProject/nx-libs/commit/f60ac577713c28212cdf2f4203b2cc0726034f5f

NX agent doesn't like -geometry fullscreen anymore and segfaults.

Backtrace from catched core is below:

Core was generated by `./nxagent -geometry fullscreen'. Program terminated with signal 11, Segmentation fault. ... (gdb) bt

0 XYToWindow (x=0, y=0) at ../../dix/events.c:1935

1 0x0000000000420555 in CheckMotion (xE=0x0) at NXevents.c:377

2 WindowsRestructured () at ../../dix/events.c:2044

3 0x000000000049fb62 in nxagentSetRootClip (enable=1, pScreen=0x203e650) at Screen.c:2266

4 nxagentResizeScreen (pScreen=pScreen@entry=0x203e650, width=width@entry=1920, height=height@entry=1200, mmWidth=, mmWidth@entry=0, mmHeight=, mmHeight@entry=0, doresize=doresize@entry=1) at Screen.c:2433

5 0x000000000049fdb8 in nxagentChangeScreenConfig (screen=screen@entry=0, width=1920, height=1200, doresize=doresize@entry=1) at Screen.c:3759

6 0x00000000004a8021 in nxagentSwitchAllScreens (pScreen=0x203e650, switchOn=) at Window.c:906

7 0x000000000049b075 in nxagentMaximizeToFullScreen (pScreen=pScreen@entry=0x203e650) at Screen.c:341

8 0x00000000004aa478 in nxagentMapDefaultWindows () at Window.c:2559

9 0x0000000000415c12 in InitRootWindow (pWin=0x206f0c0) at NXwindow.c:171

10 0x000000000040e467 in main (argc=3, argv=0x7ffd81c3f468, envp=) at main.c:333

Any clues where in the recent changes this could come from.

Regards, Simon

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ArcticaProject/nx-libs/issues/987, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQHBZEYJ5MNU5NTNGCTYLTS2F46NANCNFSM4WFGTU7A .

realsimix commented 3 years ago

Results:

./nxagent -geometry fullscreen -> segfault ./nxagent -geometry allscreens -> segfault ./nxagent -geometry onescreen -> works

In my setup I can simply use onescreen instead of fullscreen and everything works. Of course that's not the solution but should give some more info to find the issue.

realsimix commented 3 years ago

Maybe this could also be added?

--- ./nx-X11/programs/Xserver/hw/nxagent/Args.c.orig    2021-01-16 00:28:13.000000000 +0100
+++ ./nx-X11/programs/Xserver/hw/nxagent/Args.c 2021-01-16 17:56:05.949256176 +0100
@@ -2083,7 +2083,7 @@
   ErrorF("-full                  utilize full regeneration\n");
   ErrorF("-class string          default visual class\n");
   ErrorF("-depth int             default depth\n");
-  ErrorF("-geometry WxH+X+Y      window size and position\n");
+  ErrorF("-geometry WxH+X+Y      window size and position or 'allscreens' / 'onescreen'\n");
   ErrorF("-bw int                window border width\n");
   ErrorF("-name string           window name\n");
   ErrorF("-scrns int             number of screens to generate\n");
uli42 commented 3 years ago

Please retry with this patch:

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 173d2fb82..197004d80 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -337,11 +337,13 @@ void nxagentMinimizeFromFullScreen(ScreenPtr pScreen) */ void nxagentMaximizeToFullScreen(ScreenPtr pScreen) {

I am a bit puzzled why I have added that at all. It seems to work for me without. Can you please test allscreens and onescreen again after applying above patch?

Thx,

Uli (who only has one display available at the moment...)

On Sat, Jan 16, 2021 at 5:57 PM Simon Matter notifications@github.com wrote:

Maybe this could also be added?

--- ./nx-X11/programs/Xserver/hw/nxagent/Args.c.orig 2021-01-16 00:28:13.000000000 +0100 +++ ./nx-X11/programs/Xserver/hw/nxagent/Args.c 2021-01-16 17:56:05.949256176 +0100 @@ -2083,7 +2083,7 @@ ErrorF("-full utilize full regeneration\n"); ErrorF("-class string default visual class\n"); ErrorF("-depth int default depth\n");

  • ErrorF("-geometry WxH+X+Y window size and position\n");
  • ErrorF("-geometry WxH+X+Y window size and position or 'allscreens' / 'onescreen'\n"); ErrorF("-bw int window border width\n"); ErrorF("-name string window name\n"); ErrorF("-scrns int number of screens to generate\n");

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ArcticaProject/nx-libs/issues/987#issuecomment-761596439, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQHBZCYYVV4R4B4WB4GRO3S2HAOVANCNFSM4WFGTU7A .

realsimix commented 3 years ago

While it doesn't crash anymore, it now doesn't go into fullscreen mode when using onescreen.

With allscreens it shows: Info: Screen [0] resized to geometry [1920x1200] fullscreen [1]. and works fullscreen.

With onescreen it shows: Info: Screen [0] resized to geometry [1920x1119] fullscreen [1]. and works in a maximized window.

Note that I also have only a single display to test.

uli42 commented 3 years ago

sigh.... Thanks anyway, so pushing this patch will at least fix the crashes. I will test more...

On Sun, Jan 17, 2021 at 11:23 AM Simon Matter notifications@github.com wrote:

While it doesn't crash anymore, it now doesn't go into fullscreen mode when using onescreen.

With allscreens it shows: Info: Screen [0] resized to geometry [1920x1200] fullscreen [1]. and works fullscreen.

With onescreen it shows: Info: Screen [0] resized to geometry [1920x1119] fullscreen [1]. and works in a maximized window.

Note that I also have only a single display to test.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.