ArcticaProject / nx-libs

nx-libs
Other
120 stars 39 forks source link

x2goagent 3.5.99.26 crashes on connect #1009

Closed marmarek closed 3 years ago

marmarek commented 3 years ago

When connecting to an existing X11 session ("connect to local desktop"), I get a x2goagent crash:

                Stack trace of thread 663053:
                #0  0x00005f237a3f4f0b RREditConnectionInfo (nxagent + 0x32ff0b)
                #1  0x00005f237a17f840 nxagentChangeScreenConfig (nxagent + 0xba840)
                #2  0x00005f237a16d2e9 nxagentDispatchEvents (nxagent + 0xa82e9)
                #3  0x00005f237a167e2d nxagentDisplayWriteHandler (nxagent + 0xa2e2d)
                #4  0x000079af2a8bf6f1 _XSendClientPrefix (libX11.so.6 + 0x266f1)
                #5  0x000079af2a8d2cd4 XOpenDisplay (libX11.so.6 + 0x39cd4)
                #6  0x000079af2a74a9a4 _ZN6Poller4initEv (libXcompshad.so.3 + 0x99a4)
                #7  0x000079af2a74806c NXShadowCreate (libXcompshad.so.3 + 0x706c)
                #8  0x00005f237a17f92a nxagentShadowInit (nxagent + 0xba92a)
                #9  0x00005f237a1172fb DefineInitialRootWindow (nxagent + 0x522fb)
                #10 0x00005f237a1079f0 main (nxagent + 0x429f0)
                #11 0x000079af2a0ab082 __libc_start_main (libc.so.6 + 0x27082)
                #12 0x00005f237a107d7e _start (nxagent + 0x42d7e)

By inspecting it with gdb, I see the crash is on accessing ConnectionInfo, which is NULL at this point. Indeed the crash happens at DefineInitialRootWindow call time, and ConnectionInfo is initialized only a few lines below.

It is 100% reproducible for me, 3.5.99.25 worked fine. Both on Fedora 32 based system.

I can provide more details if you tell me what is needed. I can also share the coredump if it would be useful (I don't have any sensitive data on this system).

uli42 commented 3 years ago

Hmm, can you please install debug symbols and repeat the backtrace?

On Tue, Mar 16, 2021 at 5:06 AM Marek Marczykowski-Górecki < @.***> wrote:

When connecting to an existing X11 session ("connect to local desktop"), I get a x2goagent crash:

            Stack trace of thread 663053:
            #0  0x00005f237a3f4f0b RREditConnectionInfo (nxagent + 0x32ff0b)
            #1  0x00005f237a17f840 nxagentChangeScreenConfig (nxagent + 0xba840)
            #2  0x00005f237a16d2e9 nxagentDispatchEvents (nxagent + 0xa82e9)
            #3  0x00005f237a167e2d nxagentDisplayWriteHandler (nxagent + 0xa2e2d)
            #4  0x000079af2a8bf6f1 _XSendClientPrefix (libX11.so.6 + 0x266f1)
            #5  0x000079af2a8d2cd4 XOpenDisplay (libX11.so.6 + 0x39cd4)
            #6  0x000079af2a74a9a4 _ZN6Poller4initEv (libXcompshad.so.3 + 0x99a4)
            #7  0x000079af2a74806c NXShadowCreate (libXcompshad.so.3 + 0x706c)
            #8  0x00005f237a17f92a nxagentShadowInit (nxagent + 0xba92a)
            #9  0x00005f237a1172fb DefineInitialRootWindow (nxagent + 0x522fb)
            #10 0x00005f237a1079f0 main (nxagent + 0x429f0)
            #11 0x000079af2a0ab082 __libc_start_main (libc.so.6 + 0x27082)
            #12 0x00005f237a107d7e _start (nxagent + 0x42d7e)

By inspecting it with gdb, I see the crash is on accessing ConnectionInfo, which is NULL at this point. Indeed the crash happens at DefineInitialRootWindow call time https://github.com/ArcticaProject/nx-libs/blob/3.6.x/nx-X11/programs/Xserver/dix/main.c#L334, and ConnectionInfo is initialized only a few lines below https://github.com/ArcticaProject/nx-libs/blob/3.6.x/nx-X11/programs/Xserver/dix/main.c#L344 .

It is 100% reproducible for me, 3.5.99.25 worked fine. Both on Fedora 32 based system.

I can provide more details if you tell me what is needed. I can also share the coredump if it would be useful (I don't have any sensitive data on this system).

— 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/1009, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQHBZERSKCAQDQSLHN6ZZTTD3KMJANCNFSM4ZHYDHXA .

marmarek commented 3 years ago

Sure:

#0  0x00005ee94bbf8f0b in RREditConnectionInfo (pScreen=0x5ee94c8e4c70) at rrscreen.c:73
#1  RRScreenSizeNotify (pScreen=0x5ee94c8e4c70) at rrscreen.c:176
#2  0x00005ee94b982716 in nxagentAdjustCustomMode (pScreen=<optimized out>) at Screen.c:3728
#3  0x00005ee94b983840 in nxagentChangeScreenConfig (screen=<optimized out>, width=<optimized out>, height=<optimized out>, doresize=<optimized out>)
    at Screen.c:3796
#4  0x00005ee94b9712e9 in nxagentDispatchEvents (predicate=predicate@entry=0x0) at Events.c:2080
#5  0x00005ee94b97aa68 in nxagentDispatchHandler (client=client@entry=0x0, in=in@entry=0, out=<optimized out>) at Handlers.c:1260
#6  0x00005ee94b96be2d in nxagentDisplayWriteHandler (disp=<optimized out>, length=<optimized out>) at Display.c:705
#7  0x00007fa258d86ee9 in _XSendClientPrefix () from /usr/lib64/nx/X11/libX11.so.6
#8  0x00007fa258d9a544 in XOpenDisplay () from /usr/lib64/nx/X11/libX11.so.6
#9  0x00007fa258c10744 in Poller::init() () from /lib64/libXcompshad.so.3
#10 0x00007fa258c0dddc in NXShadowCreate () from /lib64/libXcompshad.so.3
#11 0x00005ee94b98392a in nxagentShadowInit (pScreen=<optimized out>, pWin=<optimized out>) at Screen.c:2585
#12 0x00005ee94b91b2fb in DefineInitialRootWindow (win=0x5ee94c9029e0) at NXevents.c:412
#13 0x00005ee94b90b9f0 in main (argc=19, argv=0x7ffda9c5edb8, envp=<optimized out>) at main.c:334
realsimix commented 3 years ago

There was a problem with 32bit builds recently and I just read Fedora 32 and an alarm was ringing in my head. Of course it's a wrong alarm because you're using Fedora 32 64bit and not 32bit :-)

uli42 commented 3 years ago

Hmm, so ConnectionInfo is setup in CreateConnectionBlock() while DefineInitialRootWindow() is called a few lines before. The thing is: that code has not been touched recently.

Maybe having the dump might help.

uli42 commented 3 years ago

Ok, we should probably backport this:

https://gitlab.freedesktop.org/xorg/xserver/-/commit/941aeb3b92e644923bd112eef8023f033a140ee6

marmarek commented 3 years ago

Ok, we should probably backport this:

This indeed looks like a fix for this issue! I was afraid to propose something like this, because I'm not sure if that wouldn't miss some important data (after all, this event is handled for some reason). I wonder why it wasn't an issue before. Were there any other changes to randr handling recently?

uli42 commented 3 years ago

no, not that I am aware of. This make me wondering, too.

On Tue, Mar 16, 2021 at 3:25 PM Marek Marczykowski-Górecki < @.***> wrote:

Ok, we should probably backport this:

This indeed looks like a fix for this issue! I was afraid to propose something like this, because I'm not sure if that wouldn't miss some important data (after all, this event is handled for some reason). I wonder why it wasn't an issue before. Were there any other changes to randr handling recently?

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

sunweaver commented 3 years ago

Ok, we should probably backport this:

https://gitlab.freedesktop.org/xorg/xserver/-/commit/941aeb3b92e644923bd112eef8023f033a140ee6

@uli42: Please do. Thanks! This would be a candidate for a patch I should bring to Debian's version of nx-libs.