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

x2goagent 3.5.99.26 crashes on connect #1009

Closed
marmarek opened this issue Mar 16, 2021 · 8 comments · Fixed by #1011
Closed

x2goagent 3.5.99.26 crashes on connect #1009

marmarek opened this issue Mar 16, 2021 · 8 comments · Fixed by #1011

Comments

@marmarek
Copy link

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).

@marmarek marmarek changed the title nxagent 3.5.99.26 crashes on connect x2goagent 3.5.99.26 crashes on connect Mar 16, 2021
@uli42
Copy link
Member

uli42 commented Mar 16, 2021 via email

@marmarek
Copy link
Author

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
Copy link
Contributor

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
Copy link
Member

uli42 commented Mar 16, 2021

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
Copy link
Member

uli42 commented Mar 16, 2021

@marmarek
Copy link
Author

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
Copy link
Member

uli42 commented Mar 16, 2021 via email

@sunweaver
Copy link
Member

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.

uli42 added a commit to uli42/nx-libs that referenced this issue Mar 17, 2021
Backport of this xorg-xserver commit:

  commit 941aeb3b92e644923bd112eef8023f033a140ee6
  Author: Olivier Fourdan <ofourdan@redhat.com>
  Date:   Fri May 13 08:58:58 2016 +0200

    randr: Do not update ConnectionInfo if NULL

    RRScreenSizeNotify() will update the connection information block, but
    if this occurs during initialization before ConnectionInfo is even
    initialized, this will lead to a crash.

    Simply check for ConnectionInfo prior to update it to avoid the crash.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95337
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>

Fixes ArcticaProject#1009
sunweaver pushed a commit to uli42/nx-libs that referenced this issue Jun 7, 2021
Backport of this xorg-xserver commit:

  commit 941aeb3b92e644923bd112eef8023f033a140ee6
  Author: Olivier Fourdan <ofourdan@redhat.com>
  Date:   Fri May 13 08:58:58 2016 +0200

    randr: Do not update ConnectionInfo if NULL

    RRScreenSizeNotify() will update the connection information block, but
    if this occurs during initialization before ConnectionInfo is even
    initialized, this will lead to a crash.

    Simply check for ConnectionInfo prior to update it to avoid the crash.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95337
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>

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

Successfully merging a pull request may close this issue.

4 participants