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

No sysv shm #116

Merged
merged 7 commits into from
Oct 15, 2022
Merged

No sysv shm #116

merged 7 commits into from
Oct 15, 2022

Conversation

DemiMarie
Copy link
Contributor

No description provided.

@DemiMarie DemiMarie force-pushed the no-sysv-shm branch 2 times, most recently from 95aab84 to 926b477 Compare August 15, 2022 03:32
@DemiMarie DemiMarie marked this pull request as ready for review August 15, 2022 03:45
@marmarek
Copy link
Member

Duplicate of #78 ?

@DemiMarie
Copy link
Contributor Author

Duplicate of #78 ?

Same as #78 but with a few extra commits.

This avoids having to define XLIB_ILLEGAL_ACCESS, which we would prefer
to avoid.
Xlib does not support file descriptor passing or dma-bufs.  The GUI
daemon does not currently use either of these, but it will in the
future.  Switching from Xlib to XCB is a necessary first step in that
direction.
Referencing a function that the GUI daemon no longer uses would be
confusing.
This is another attempt at using FD passing for shared memory, at the
cost of still requiring shmoverride.

The reason I am filing it as a PR is to at least give it a
chance to be reviewed, so that the work done on it has a chance of not
being wasted.
By sending a freshly opened Xen file descriptor at each request, the
offset is guaranteed to be 0.  Furthermore, there is no need to call
IOCTL_GNTDEV_UNMAP_GRANT_REF after munmap() ― just calling munmap() is
sufficient.

The only remaining reason to override munmap() is to handle mfn-based
mappings, which may have an offset that is not a multiple of the page
size.  These require correcting the address before the kernel will
accept the munmap() call.  Fortunately, there is no legitimate reason
for the X.org Server to call munmap() with a non-page-aligned address,
so it is safe to unconditionally align the address and pass the aligned
version to the kernel, adjusting the size accordingly.  Therefore, it is
no longer necessary for shmoverride to maintain any state whatsoever
about the current mappings, simplifying the code enormously.  No mutex
locking is needed, and no list of mapped pages needs to be kept.  The
result is that the code is simpler and less prone to bugs.
System V shared memory is worse than just memory-mapping a file.
@DemiMarie DemiMarie requested a review from marmarek October 13, 2022 20:15
@DemiMarie DemiMarie force-pushed the no-sysv-shm branch 2 times, most recently from f19e18e to 93b3e82 Compare October 13, 2022 21:41
This emulates Xorg's own command-line parser in case the display manager
starts to pass additional options to Xorg.
@qubesos-bot
Copy link

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.1&build=2022101403-4.1&flavor=pull-requests

New failures, excluding unstable

Compared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.1&build=2022092706-4.1&flavor=update

Failed tests

37 failures

Fixed failures

Compared to: https://openqa.qubes-os.org/tests/46840#dependencies

1 fixed
  • system_tests_network_updates
    • TC_11_QvmTemplateMgmtVM_whonix-gw-16: test_010_template_install (error)
      subprocess.CalledProcessError: Command 'systemcheck --cli' returned...

Unstable tests

  • system_tests_basic_vm_qrexec_gui

    TC_00_AppVM_fedora-36/test_223_audio_play_hvm (1/5 times with errors)
    • job 46378 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
  • system_tests_splitgpg

    TC_10_Thunderbird_debian-11/test_000_send_receive_default (1/5 times with errors)
    • job 47171 dogtail.tree.SearchError: descendent of [frame | Write: Test messag...
    TC_10_Thunderbird_whonix-ws-16/test_000_send_receive_default (1/5 times with errors)
    • job 47171 dogtail.tree.SearchError: descendent of [frame | Write: Test messag...
    TC_10_Thunderbird_debian-11/test_010_send_receive_inline_signed_only (1/5 times with errors)
    • job 47171 dogtail.tree.SearchError: descendent of [frame | Write: Test messag...
    TC_10_Thunderbird_whonix-ws-16/test_010_send_receive_inline_signed_only (1/5 times with errors)
    • job 47171 dogtail.tree.SearchError: descendent of [frame | Write: Test messag...
    TC_10_Thunderbird_debian-11/test_020_send_receive_inline_with_attachment (1/5 times with errors)
    • job 47171 dogtail.tree.SearchError: descendent of [frame | Write: Test messag...
    TC_10_Thunderbird_whonix-ws-16/test_020_send_receive_inline_with_attachment (2/5 times with errors)
    • job 46885 dogtail.tree.SearchError: descendent of [application | Thunderbird]...
    • job 47171 dogtail.tree.SearchError: descendent of [frame | Write: Test messag...
  • system_tests_qrexec

    TC_00_Qrexec_whonix-gw-16/test_050_qrexec_simple_eof (1/5 times with errors)
    • job 46374 AssertionError: Timeout, probably EOF wasn't transferred to the VM ...
    TC_00_Qrexec_fedora-36/test_052_qrexec_vm_service_eof (1/5 times with errors)
    • job 46752 AssertionError: Timeout, probably EOF wasn't transferred
    TC_00_Qrexec_fedora-36/test_070_qrexec_vm_simultaneous_write (1/5 times with errors)
    • job 46752 AssertionError: Timeout, probably deadlock
  • system_tests_network_ipv6

    VmIPv6Networking_debian-11/test_520_ipv6_simple_proxyvm_nm (1/5 times with errors)
    • job 47168 AssertionError: 1 != 0 : nm-applet window not found
  • system_tests_network_updates

    TC_11_QvmTemplateMgmtVM_whonix-gw-16/test_000_template_list (2/5 times with errors)
    • job 46764 subprocess.CalledProcessError: Command 'systemcheck --cli' returned...
    • job 47169 subprocess.CalledProcessError: Command 'systemcheck --cli' returned...
    TC_10_QvmTemplate_whonix-gw-16/test_010_template_install (1/5 times with errors)
    • job 46473 AssertionError: libvirt event impl drain timeout
    TC_11_QvmTemplateMgmtVM_whonix-gw-16/test_010_template_install (4/5 times with errors)
    • job 46435 subprocess.CalledProcessError: Command 'systemcheck --cli' returned...
    • job 46764 qvm-template: error: Template 'debian-11-minimal' not found.
    • job 46861 subprocess.CalledProcessError: Command 'systemcheck --cli' returned...
    • job 47169 AssertionError: libvirt event impl drain timeout
  • system_tests_devices

    TC_10_Attach_debian-11/test_000_attach_reattach (1/5 times with errors)
    • job 46369 subprocess.CalledProcessError: Command 'ls /dev/xvdi' returned non-...
  • system_tests_basic_vm_qrexec_gui_btrfs

    TC_00_AppVM_fedora-36-pool/test_000_start_shutdown (1/5 times with errors)
    • job 46371 qubes.exc.QubesVMError: Cannot connect to qrexec agent for 90 secon...
    TC_00_AppVM_fedora-36-pool/test_010_run_xterm (1/5 times with errors)
    • job 46371 raise exceptions.TimeoutError()... asyncio.exceptions.TimeoutError
    TC_00_AppVM_fedora-36-pool/test_011_run_gnome_terminal (1/5 times with errors)
    • job 46371 AssertionError: Timeout while waiting for user@test-inst-vm1 window...
    TC_00_AppVM_debian-11-pool/test_223_audio_play_hvm (1/5 times with errors)
    • job 46371 subprocess.CalledProcessError: Command 'pacmd unload-module module-...
  • system_tests_dispvm

    TC_04_DispVM/test_003_cleanup_destroyed (2/5 times with errors)
    • job 46222 raise exceptions.TimeoutError()... asyncio.exceptions.TimeoutError
    • job 46368 raise exceptions.TimeoutError()... asyncio.exceptions.TimeoutError
    TC_20_DispVM_fedora-36/test_010_simple_dvm_run (2/5 times with errors)
    • job 46222 assert len(self.loop._selector.get_map()) \... AssertionError
    • job 46368 assert len(self.loop._selector.get_map()) \... AssertionError
    TC_20_DispVM_whonix-gw-16/test_010_simple_dvm_run (2/5 times with errors)
    TC_20_DispVM_whonix-ws-16/test_010_simple_dvm_run (2/5 times with errors)
    • job 46222 assert len(self.loop._selector.get_map()) \... AssertionError
    • job 46368 assert len(self.loop._selector.get_map()) \... AssertionError
    TC_20_DispVM_whonix-gw-16/test_020_gui_app (2/5 times with errors)
    TC_20_DispVM_debian-11/test_030_edit_file (2/5 times with errors)
    • job 46222 AssertionError: Timeout while waiting for disp[0-9]* window to show
    • job 46368 AssertionError: Timeout while waiting for disp[0-9]* window to show
    TC_20_DispVM_fedora-36/test_030_edit_file (2/5 times with errors)
    • job 46222 AssertionError: Timeout while waiting for disp[0-9]* window to show
    • job 46368 AssertionError: Timeout while waiting for disp[0-9]* window to show
    TC_20_DispVM_whonix-gw-16/test_030_edit_file (2/5 times with errors)
    TC_20_DispVM_whonix-ws-16/test_030_edit_file (2/5 times with errors)
    • job 46222 AssertionError: Timeout while waiting for disp[0-9]* window to show
    • job 46368 AssertionError: Timeout while waiting for disp[0-9]* window to show
    TC_20_DispVM_debian-11/test_100_open_in_dispvm (2/5 times with errors)
    • job 46222 AssertionError: Timeout while waiting for disp[0-9]* window to show
    • job 46368 AssertionError: './open-file test.txt' failed with ./open-file test...
    TC_20_DispVM_fedora-36/test_100_open_in_dispvm (4/5 times with errors)
    • job 46096 self.assertEqual(test_txt_content.s... AssertionError: b'' != b'test1'
    • job 46222 AssertionError: './open-file test.txt' failed with ./open-file test...
    • job 46368 AssertionError: './open-file test.txt' failed with ./open-file test...
    • job 46488 self.assertEqual(test_txt_content.s... AssertionError: b'' != b'test1'
    TC_20_DispVM_whonix-gw-16/test_100_open_in_dispvm (2/5 times with errors)
    TC_20_DispVM_whonix-ws-16/test_100_open_in_dispvm (3/5 times with errors)
    • job 46222 AssertionError: './open-file test.txt' failed with ./open-file test...
    • job 46368 AssertionError: Timeout while waiting for disp[0-9]* window to show
    • job 46883 AssertionError: libvirt event impl drain timeout
  • system_tests_suspend

    suspend/ (1/5 times with errors)
    suspend/Failed (1/5 times with errors)
    • job 47185 # Test died: no candidate needle with tag(s) 'xscreensaver-prompt' ...
    suspend/Failed (1/5 times with errors)
    • job 47172 # Test died: command 'qvm-run -ap sys-whonix 'LC_ALL=C whonixcheck ...
    suspend/wait_serial (1/5 times with errors)
    • job 47185 # wait_serial expected: "xl info; echo 8Ye1l-\$?-"...
    suspend/wait_serial (1/5 times with errors)
    • job 47185 # wait_serial expected: qr/8Ye1l-\d+-/...
    suspend/wait_serial (1/5 times with errors)
    • job 47172 # wait_serial expected: qr/wG5VX-\d+-/...
  • system_tests_basic_vm_qrexec_gui_ext4

    TC_00_AppVM_whonix-ws-16-pool/test_223_audio_play_hvm (1/5 times with errors)
    • job 46252 AssertionError: only silence detected, no useful audio data
    TC_00_AppVM_whonix-ws-16-pool/test_225_audio_rec_unmuted_hvm (1/5 times with errors)
    • job 46252 AssertionError: only silence detected, no useful audio data
  • system_tests_basic_vm_qrexec_gui_xfs

    TC_00_AppVM_whonix-ws-16-pool/test_225_audio_rec_unmuted_hvm (1/5 times with errors)
    • job 46373 AssertionError: only silence detected, no useful audio data
  • system_tests_basic_vm_qrexec_gui@hw1

    TC_00_AppVM_fedora-36/test_223_audio_play_hvm (1/5 times with errors)
    • job 46378 AssertionError: Timeout waiting for pulseaudio start in test-inst-v...
  • system_tests_gui_tools@hw1

    qubesmanager_vmsettings/ (1/5 times with errors)
    qubesmanager_vmsettings/Failed (1/5 times with errors)
    • job 47164 # Test died: no candidate needle with tag(s) 'vm-settings-services-...
  • system_tests_suspend@hw1

    suspend/ (1/5 times with errors)
    suspend/Failed (1/5 times with errors)
    • job 47185 # Test died: no candidate needle with tag(s) 'xscreensaver-prompt' ...
    suspend/Failed (1/5 times with errors)
    • job 47172 # Test died: command 'qvm-run -ap sys-whonix 'LC_ALL=C whonixcheck ...
    suspend/wait_serial (1/5 times with errors)
    • job 47185 # wait_serial expected: "xl info; echo 8Ye1l-\$?-"...
    suspend/wait_serial (1/5 times with errors)
    • job 47185 # wait_serial expected: qr/8Ye1l-\d+-/...
    suspend/wait_serial (1/5 times with errors)
    • job 47172 # wait_serial expected: qr/wG5VX-\d+-/...
  • system_tests_gui_tools

    qubesmanager_vmsettings/ (1/5 times with errors)
    qubesmanager_vmsettings/Failed (1/5 times with errors)
    • job 47164 # Test died: no candidate needle with tag(s) 'vm-settings-services-...

@marmarek marmarek merged commit 99b01ee into QubesOS:master Oct 15, 2022
@DemiMarie DemiMarie deleted the no-sysv-shm branch October 15, 2022 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants