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

xpra: fix #85694 #87985

Merged
merged 1 commit into from Jun 3, 2020
Merged

xpra: fix #85694 #87985

merged 1 commit into from Jun 3, 2020

Conversation

@lourkeur
Copy link
Contributor

lourkeur commented May 16, 2020

Motivation for this change

Fix #85694

Things done

Hard-code the default libfakeXinerama location instead of relying on the automatic detection dance that upstream does.

I tried to make the dance succeed but couldn't do it. It would require at least bringing in binutils so ctypes.util can call ld and adding a SONAME to libfakeXinerama, but in fine it would still be quite fragile.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@mjlbach
Copy link
Contributor

mjlbach commented May 17, 2020

Previously we had to use:

 xpra start --daemon=no --fake-xinerama=no :100

I'm assuming after this PR, disabling fake-xinerama is no longer supposed to be necessary?

I tried to test this but getting the following error:

Steps:

  1. xpra start :100
  2. DISPLAY=:100 konsole
  3. xpra attach :100

clientside:

2020-05-16 17:46:00,551 Error: cannot access the list of printers
2020-05-16 17:46:00,552  failed to connect to server
2020-05-16 17:46:01,571 Warning: server connection failure:
2020-05-16 17:46:01,571  server error
2020-05-16 17:46:01,571  error accepting new connection

serverside

2020-05-16 17:45:30,357 Error during threaded setup of <class 'xpra.server.mixins.child_command_server.ChildCommandServer'>
Traceback (most recent call last):
  File "/nix/store/yb8as201yjn4vcbpcl7x704qp96bx6k4-xpra-3.0.9/lib/python3.7/site-packages/xpra/server/server_base.py", line 170, in threaded_init
    c.threaded_setup(self)
  File "/nix/store/yb8as201yjn4vcbpcl7x704qp96bx6k4-xpra-3.0.9/lib/python3.7/site-packages/xpra/server/mixins/child_command_server.py", line 92, in threaded_setup
    load_xdg_menu_data()
  File "/nix/store/yb8as201yjn4vcbpcl7x704qp96bx6k4-xpra-3.0.9/lib/python3.7/site-packages/xpra/platform/xposix/xdg_helper.py", line 237, in load_xdg_menu_data
    xdg_menu_data = do_load_xdg_menu_data()
  File "/nix/store/yb8as201yjn4vcbpcl7x704qp96bx6k4-xpra-3.0.9/lib/python3.7/site-packages/xpra/platform/xposix/xdg_helper.py", line 268, in do_load_xdg_menu_data
    menu = parse()
  File "/nix/store/xqhbn34zxm7z27qpsfjk7y57kjqs9b3d-python3.7-pyxdg-0.26/lib/python3.7/site-packages/xdg/Menu.py", line 1128, in parse
    return XMLMenuBuilder(debug).parse(filename)
  File "/nix/store/xqhbn34zxm7z27qpsfjk7y57kjqs9b3d-python3.7-pyxdg-0.26/lib/python3.7/site-packages/xdg/Menu.py", line 637, in parse
    self.post_parse(menu)
  File "/nix/store/xqhbn34zxm7z27qpsfjk7y57kjqs9b3d-python3.7-pyxdg-0.26/lib/python3.7/site-packages/xdg/Menu.py", line 983, in post_parse
    self.post_parse(submenu)
  File "/nix/store/xqhbn34zxm7z27qpsfjk7y57kjqs9b3d-python3.7-pyxdg-0.26/lib/python3.7/site-packages/xdg/Menu.py", line 997, in post_parse
    elif menuentry.Type == MenuEntry.TYPE_SYSTEM:
AttributeError: 'MenuEntry' object has no attribute 'Type'
2020-05-16 17:45:30,373  uid=1000 (mjlbach), gid=100 (users)
2020-05-16 17:45:30,373  running with pid 12264 on Linux
2020-05-16 17:45:30,378  connected to X11 display :99 with 24 bit colors
2020-05-16 17:45:30,404 15.5GB of system memory
2020-05-16 17:45:59,410 New unix-domain connection received
2020-05-16 17:45:59,411  on '/run/user/1000/xpra/nixos-99'
2020-05-16 17:45:59,413 Handshake complete; enabling connection
2020-05-16 17:45:59,423  mmap is enabled using 256MB area in /run/user/1000/xpra/xpra.wv3t7g7i.mmap
2020-05-16 17:45:59,424 Python/GTK3 Linux x11 client version 3.0.9-r26127 64-bit
2020-05-16 17:45:59,424  connected from 'nixos' as 'mjlbach'
2020-05-16 17:45:59,479 setting key repeat rate from client: 600ms delay / 40ms interval
2020-05-16 17:45:59,480 setting keymap:
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name <I372> ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
Errors from xkbcomp are not fatal to the X server
2020-05-16 17:45:59,493 setting keyboard layout to 'us'
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name <I372> ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
Errors from xkbcomp are not fatal to the X server
2020-05-16 17:45:59,523  client root window size is 2560x1440 with 1 display:
2020-05-16 17:45:59,523   :0.0 (602x342 mm - DPI: 108x106) workarea: 2560x1331 at 0x24
2020-05-16 17:45:59,523     DEL DP-0 (598x336 mm - DPI: 108x108)
2020-05-16 17:45:59,544 server virtual display now set to 2560x1440
2020-05-16 17:45:59,558 Error: processing new connection from Protocol(unix-domain socket:/run/user/1000/xpra/nixos-99):
2020-05-16 17:45:59,559  'MenuEntry' object has no attribute 'Type'
2020-05-16 17:45:59,559 Disconnecting client /run/user/1000/xpra/nixos-99:
2020-05-16 17:45:59,559  server error (error accepting new connection)
2020-05-16 17:45:59,560 xpra client 1 disconnected.
2020-05-16 17:45:59,570 DPI set to 108 x 107
2020-05-16 17:46:00,357 New unix-domain connection received
2020-05-16 17:46:00,357  on '/run/user/1000/xpra/nixos-99'
@lourkeur
Copy link
Contributor Author

lourkeur commented May 17, 2020

Previously we had to use:

 xpra start --daemon=no --fake-xinerama=no :100

I'm assuming after this PR, disabling fake-xinerama is no longer supposed to be necessary?

Yes it is.

I tried to test this but getting the following error:

Steps:

  1. xpra start :100
  2. DISPLAY=:100 konsole
  3. xpra attach :100

clientside:

2020-05-16 17:46:00,551 Error: cannot access the list of printers
2020-05-16 17:46:00,552  failed to connect to server
2020-05-16 17:46:01,571 Warning: server connection failure:
2020-05-16 17:46:01,571  server error
2020-05-16 17:46:01,571  error accepting new connection

serverside

2020-05-16 17:45:30,357 Error during threaded setup of <class 'xpra.server.mixins.child_command_server.ChildCommandServer'>
Traceback (most recent call last):
  File "/nix/store/yb8as201yjn4vcbpcl7x704qp96bx6k4-xpra-3.0.9/lib/python3.7/site-packages/xpra/server/server_base.py", line 170, in threaded_init
    c.threaded_setup(self)
  File "/nix/store/yb8as201yjn4vcbpcl7x704qp96bx6k4-xpra-3.0.9/lib/python3.7/site-packages/xpra/server/mixins/child_command_server.py", line 92, in threaded_setup
    load_xdg_menu_data()
  File "/nix/store/yb8as201yjn4vcbpcl7x704qp96bx6k4-xpra-3.0.9/lib/python3.7/site-packages/xpra/platform/xposix/xdg_helper.py", line 237, in load_xdg_menu_data
    xdg_menu_data = do_load_xdg_menu_data()
  File "/nix/store/yb8as201yjn4vcbpcl7x704qp96bx6k4-xpra-3.0.9/lib/python3.7/site-packages/xpra/platform/xposix/xdg_helper.py", line 268, in do_load_xdg_menu_data
    menu = parse()
  File "/nix/store/xqhbn34zxm7z27qpsfjk7y57kjqs9b3d-python3.7-pyxdg-0.26/lib/python3.7/site-packages/xdg/Menu.py", line 1128, in parse
    return XMLMenuBuilder(debug).parse(filename)
  File "/nix/store/xqhbn34zxm7z27qpsfjk7y57kjqs9b3d-python3.7-pyxdg-0.26/lib/python3.7/site-packages/xdg/Menu.py", line 637, in parse
    self.post_parse(menu)
  File "/nix/store/xqhbn34zxm7z27qpsfjk7y57kjqs9b3d-python3.7-pyxdg-0.26/lib/python3.7/site-packages/xdg/Menu.py", line 983, in post_parse
    self.post_parse(submenu)
  File "/nix/store/xqhbn34zxm7z27qpsfjk7y57kjqs9b3d-python3.7-pyxdg-0.26/lib/python3.7/site-packages/xdg/Menu.py", line 997, in post_parse
    elif menuentry.Type == MenuEntry.TYPE_SYSTEM:
AttributeError: 'MenuEntry' object has no attribute 'Type'
2020-05-16 17:45:30,373  uid=1000 (mjlbach), gid=100 (users)
2020-05-16 17:45:30,373  running with pid 12264 on Linux
2020-05-16 17:45:30,378  connected to X11 display :99 with 24 bit colors
2020-05-16 17:45:30,404 15.5GB of system memory
2020-05-16 17:45:59,410 New unix-domain connection received
2020-05-16 17:45:59,411  on '/run/user/1000/xpra/nixos-99'
2020-05-16 17:45:59,413 Handshake complete; enabling connection
2020-05-16 17:45:59,423  mmap is enabled using 256MB area in /run/user/1000/xpra/xpra.wv3t7g7i.mmap
2020-05-16 17:45:59,424 Python/GTK3 Linux x11 client version 3.0.9-r26127 64-bit
2020-05-16 17:45:59,424  connected from 'nixos' as 'mjlbach'
2020-05-16 17:45:59,479 setting key repeat rate from client: 600ms delay / 40ms interval
2020-05-16 17:45:59,480 setting keymap:
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name <I372> ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
Errors from xkbcomp are not fatal to the X server
2020-05-16 17:45:59,493 setting keyboard layout to 'us'
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported high keycode 372 for name <I372> ignored
>                   X11 cannot support keycodes above 255.
>                   This warning only shows for the first high keycode.
Errors from xkbcomp are not fatal to the X server
2020-05-16 17:45:59,523  client root window size is 2560x1440 with 1 display:
2020-05-16 17:45:59,523   :0.0 (602x342 mm - DPI: 108x106) workarea: 2560x1331 at 0x24
2020-05-16 17:45:59,523     DEL DP-0 (598x336 mm - DPI: 108x108)
2020-05-16 17:45:59,544 server virtual display now set to 2560x1440
2020-05-16 17:45:59,558 Error: processing new connection from Protocol(unix-domain socket:/run/user/1000/xpra/nixos-99):
2020-05-16 17:45:59,559  'MenuEntry' object has no attribute 'Type'
2020-05-16 17:45:59,559 Disconnecting client /run/user/1000/xpra/nixos-99:
2020-05-16 17:45:59,559  server error (error accepting new connection)
2020-05-16 17:45:59,560 xpra client 1 disconnected.
2020-05-16 17:45:59,570 DPI set to 108 x 107
2020-05-16 17:46:00,357 New unix-domain connection received
2020-05-16 17:46:00,357  on '/run/user/1000/xpra/nixos-99'

Cannot reproduce. On my machine (under GNOME3) both xterm and konsole go through without any fatal errors. Looks like this is another bug entirely that you hit because this one is squashed. Without this patch, the client side crashes like has been reported previously:

2020-05-17 11:20:53,248 Error: cannot start the seamless server
Traceback (most recent call last):
  File "/nix/store/pl8vmzwd3bwrqaymm5i3vlam8ny1wjp7-xpra-3.0.9/lib/python3.7/site-packages/xpra/scripts/server.py", line 852, in do_run_server
    app.server_init()
  File "/nix/store/pl8vmzwd3bwrqaymm5i3vlam8ny1wjp7-xpra-3.0.9/lib/python3.7/site-packages/xpra/x11/server.py", line 223, in server_init
    X11ServerBase.server_init(self)
  File "/nix/store/pl8vmzwd3bwrqaymm5i3vlam8ny1wjp7-xpra-3.0.9/lib/python3.7/site-packages/xpra/x11/x11_server_core.py", line 106, in server_init
    self.x11_init()
  File "/nix/store/pl8vmzwd3bwrqaymm5i3vlam8ny1wjp7-xpra-3.0.9/lib/python3.7/site-packages/xpra/x11/server.py", line 246, in x11_init
    X11ServerBase.x11_init(self)
  File "/nix/store/pl8vmzwd3bwrqaymm5i3vlam8ny1wjp7-xpra-3.0.9/lib/python3.7/site-packages/xpra/x11/x11_server_core.py", line 129, in x11_init
    elif os.path.isabs(self.fake_xinerama):
  File "/nix/store/2dcsn57cgaxs92ha5swihrab0g3l2h6g-python3-3.7.7/lib/python3.7/posixpath.py", line 66, in isabs
    s = os.fspath(s)
TypeError: expected str, bytes or os.PathLike object, not NoneType
2020-05-17 11:20:53,250 expected str, bytes or os.PathLike object, not NoneType
@lourkeur
Copy link
Contributor Author

lourkeur commented May 17, 2020

@mjlbach Just reproduced on a KDE virtual machine. That seems to be KDE specific for some reason. Can you open an issue?

@mjlbach
Copy link
Contributor

mjlbach commented May 17, 2020

@mjlbach Just reproduced on a KDE virtual machine. That seems to be KDE specific for some reason. Can you open an issue?

Yes, I'll do that right now. Just to clarify, even with this patch, we should still use xpra start --daemon=no --fake-xinerama=no ? I wasn't sure what you meant by yes (my fault for wording my comment ambiguously in the first place).

@lourkeur
Copy link
Contributor Author

lourkeur commented May 17, 2020

@mjlbach Just reproduced on a KDE virtual machine. That seems to be KDE specific for some reason. Can you open an issue?

Yes, I'll do that right now. Just to clarify, even with this patch, we should still use xpra start --daemon=no --fake-xinerama=no ? I wasn't sure what you meant by yes (my fault for wording my comment ambiguously in the first place).

My bad. The fake-xinerama option should not be needed anymore after this patch. if it's set to auto (the default), it will go to the hardcoded path instead of crashing.

@lourkeur lourkeur marked this pull request as ready for review May 17, 2020
@mjlbach
Copy link
Contributor

mjlbach commented May 17, 2020

I'm having a hard time reproducing the failure, I just reinstalled this PR to run some debugging and it seems to work. I'm curious what you did in the VM, because i can't figure out what is different. The one thing I noticed (which I can open a separate issue for) is that xpra seems to not shut down cleanly, requiring killing the process to get it to start on the same DISPLAY.

  1. xpra start :100
  2. xpra list
  3. xpra stop :100
  4. xpra list
  5. xpra start :100
  6. cat /run/user/1000/xpra/:100.log
2020-05-17 02:50:22,214 cannot use uinput for virtual devices:
2020-05-17 02:50:22,214  [Errno 19] Failed to open the uinput device: No such device
(EE)
Fatal server error:
(EE) Server is already active for display 100
        If this server is no longer running, remove /tmp/.X100-lock
        and start again.
(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE)
2020-05-17 02:50:22,220
2020-05-17 02:50:22,220 Xvfb command has terminated! xpra cannot continue
2020-05-17 02:50:22,220  if the display is already running, try a different one,
2020-05-17 02:50:22,220  or use the --use-display flag
2020-05-17 02:50:22,220

The following works on my computer now:

  1. pkill -9 -f xpra
  2. xpra start :100
  3. DISPLAY=:100 konsole
  4. xpra attach :100

So this PR LGTM? Thanks for fixing this, this has been one of those packages that I've always missed working on NixOS.

@lourkeur
Copy link
Contributor Author

lourkeur commented May 17, 2020

My VM is a declaratively built QEMU VM. It's here. (You probably want to remove the Lourkeur™ Custom™ Ergonomic Keyboard Layout™.) It has access to the host's Nix store, that's how I got rebuilt xpra's on it.

@mjlbach mjlbach mentioned this pull request May 17, 2020
0 of 7 tasks complete
@lourkeur lourkeur marked this pull request as ready for review May 17, 2020
@mjlbach mjlbach mentioned this pull request May 21, 2020
2 of 10 tasks complete
@lourkeur lourkeur requested a review from offlinehacker May 21, 2020
@lourkeur lourkeur mentioned this pull request May 22, 2020
3 of 10 tasks complete
@lourkeur
Copy link
Contributor Author

lourkeur commented Jun 3, 2020

@offlinehacker please lmk what I have left to do to get this merged

@offlinehacker
Copy link
Contributor

offlinehacker commented Jun 3, 2020

It looks good, I just waited some time to see if anyone will comment anything, but I think we can merge it 🙂

@offlinehacker offlinehacker merged commit fd9d37e into NixOS:master Jun 3, 2020
16 checks passed
16 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="8b92f67"; rev="8b92f678f95d6f7924d2b53cca2e908f443a81fc"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="8b92f67"; rev="8b92f678f95d6f7924d2b53cca2e908f443a81fc"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="8b92f67"; rev="8b92f678f95d6f7924d2b53cca2e908f443a81fc"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="8b92f67"; rev="8b92f678f95d6f7924d2b53cca2e908f443a81fc"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="8b92f67"; rev="8b92f678f95d6f7924d2b53cca2e908f443a81fc"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="8b92f67"; rev="8b92f678f95d6f7924d2b53cca2e908f443a81fc"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="8b92f67"; rev="8b92f678f95d6f7924d2b53cca2e908f443a81fc"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
xpra, xpra.passthru.tests on aarch64-linux Success
Details
xpra, xpra.passthru.tests on x86_64-linux Success
Details
@lourkeur lourkeur deleted the lourkeur:fix_85694 branch Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

3 participants
You can’t perform that action at this time.