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

xorg.xorgserver: 1.20.14 → 21.1.7 #206805

Merged
merged 1 commit into from
Mar 1, 2023
Merged

Conversation

fabianhjr
Copy link
Member

@fabianhjr fabianhjr commented Dec 19, 2022

Description of changes

Diff:
https://github.com/freedesktop/xorg-xserver/compare/xorg-server-1.20.14...xorg-server-21.1.7

This reverts the revert on #174140

Things done

Built and booted into NixOS unstable on a gcc-12 branch on top of current staging-next. (nvidia proprietary drivers on gnome/mutter, no segfault)

#170856

#206663

However, would appreciate some runtime testing from other users, specially those for known issues.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.05 Release Notes (or backporting 22.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@vcunat
Copy link
Member

vcunat commented Dec 19, 2022

#170856 doesn't sound resolved. The upstream bug remained without comments.

@fabianhjr
Copy link
Member Author

@ofborg eval

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/gui-not-starting-after-upgrade-to-22-05/19534/16

@fabianhjr
Copy link
Member Author

#170856 doesn't sound resolved. The upstream bug remained without comments.

I am concerned with the lack of activity regarding that specific issue ticket/entry; it seems like either the circumstances were very specific (a very specific combination of configs, versions of other libraries, etc) or misconfiguration of screen indexes. (See the example to the associated proposed fix/patch: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/869#note_1283960 )

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    Screen      2  "Screen1" RightOf "Screen0"
EndSection

I think it is likely that a workaround for most users could be adjusting the screen indexes regardless and some more recent issues have emerged due staying on 1.20.z series: #206663

@jyooru
Copy link
Member

jyooru commented Dec 20, 2022

Rebuilding with 56a3884084df5b4dfbcfac17e1fd0f521412c32a causes X to segfault on my system, with the same backtrace as #170856.

[    21.978] (EE) Backtrace:
[    21.979] (EE) 0: /nix/store/cpycrl4bi71cnmzkg14nzifff0xr44af-xorg-server-21.1.5/bin/X (OsSigHandler+0x25) [0x5b45d5]
[    21.981] (EE) 1: /nix/store/ayfr5l52xkqqjn3n4h9jfacgnchz1z7s-glibc-2.35-224/lib/libc.so.6 (__sigaction+0x50) [0x7f063e5d8bf0]
[    21.982] (EE) 2: /nix/store/cpycrl4bi71cnmzkg14nzifff0xr44af-xorg-server-21.1.5/bin/X (InitOutput+0x4e4) [0x4876b4]
[    21.982] (EE) 3: /nix/store/cpycrl4bi71cnmzkg14nzifff0xr44af-xorg-server-21.1.5/bin/X (dix_main+0x194) [0x448684]
[    21.984] (EE) 4: /nix/store/ayfr5l52xkqqjn3n4h9jfacgnchz1z7s-glibc-2.35-224/lib/libc.so.6 (__libc_start_call_main+0x7e) [0x7f063e5c424e]
[    21.986] (EE) 5: /nix/store/ayfr5l52xkqqjn3n4h9jfacgnchz1z7s-glibc-2.35-224/lib/libc.so.6 (__libc_start_main+0x89) [0x7f063e5c4309]
[    21.987] (EE) 6: /nix/store/cpycrl4bi71cnmzkg14nzifff0xr44af-xorg-server-21.1.5/bin/X (_start+0x25) [0x431cc5]
[    21.987] (EE)
[    21.987] (EE) Segmentation fault at address 0x61
[    21.987] (EE)

I'm happy to test out any workarounds, what do I need to do?

@fabianhjr
Copy link
Member Author

fabianhjr commented Dec 20, 2022

Hi, thanks for helping out, could you share the resulting xserver.config file of your NixOS config?

I'm interested in how your config is being rendered in the following nixos/modules/services/x11/xserver.nix part:

782-        Section "ServerLayout"
783-          Identifier "Layout[all]"
784-        ${indent cfg.serverLayoutSection}
785:          # Reference the Screen sections for each driver.  This will
786-          # cause the X server to try each in turn.
787-          ${flip concatMapStrings (filter (d: d.display) cfg.drivers) (d: ''
788:            Screen "Screen-${d.name}[0]"
789-          '')}
790-        EndSection
791-
792:        # For each supported driver, add a "Device" and "Screen"
793-        # section.
794-        ${flip concatMapStrings cfg.drivers (driver: ''
795-
796-          Section "Device"
797-            Identifier "Device-${driver.name}[0]"
798-            Driver "${driver.driverName or driver.name}"
799-          ${indent cfg.deviceSection}
800-          ${indent (driver.deviceSection or "")}
801-          ${indent xrandrDeviceSection}
802-          EndSection
803-          ${optionalString driver.display ''
804-
805:            Section "Screen"
806:              Identifier "Screen-${driver.name}[0]"
807-              Device "Device-${driver.name}[0]"
808-              ${optionalString (cfg.monitorSection != "") ''
809-                Monitor "Monitor[0]"
810-              ''}
811-
812-            ${indent cfg.screenSection}
813-            ${indent (driver.screenSection or "")}
814-
815-              ${optionalString (cfg.defaultDepth != 0) ''
816-                DefaultDepth ${toString cfg.defaultDepth}
817-              ''}
[..]

@jyooru
Copy link
Member

jyooru commented Dec 20, 2022

Sure, I've attached them.

Looks like the bad configuration is missing importing some modules that looks like driver config? Maybe it's an issue in nixpkgs?

1,19d0
< Section "Files"
<
<   FontPath "/nix/store/4hlwha4gl6n5h9mw3h6xvvqn5f4y53sj-unifont-15.0.01/share/fonts"
<   FontPath "/nix/store/nk1ja8pbmaibxvavbbgflgn0884cqd0i-font-cursor-misc-1.0.3/lib/X11/fonts/misc"
<   FontPath "/nix/store/n8ylawwf9pg38v8sgdn8wd3i8dsnx2nh-font-misc-misc-1.1.2/lib/X11/fonts/misc"
<   FontPath "/nix/store/2izw3bigm5g0vsx0rq3mmrbii389p84i-font-adobe-100dpi-1.0.3/lib/X11/fonts/100dpi"
<   FontPath "/nix/store/0mpcys11x9a5ayahv6idh2mqxxhz5652-font-adobe-75dpi-1.0.3/lib/X11/fonts/75dpi"
<   ModulePath "/nix/store/52b3q5ysi4gn116fch9if766rl2b392f-xf86-video-amdgpu-21.0.0/lib/xorg/modules/drivers"
<   ModulePath "/nix/store/p1dp105wddz3zsw3d2zdvi64pbfvv833-xf86-video-ati-5eba006e4129e8015b822f9e1d2f1e613e252cda/lib/xorg/modules/drivers"
<   ModulePath "/nix/store/vrhl14i29c36b23hqshkg1gg5ivc0gbp-xf86-video-nouveau-3ee7cbca8f9144a3bb5be7f71ce70558f548d268/lib/xorg/modules/drivers"
<   ModulePath "/nix/store/7hli12a0wl78ifxsb6gpplwz8q7k7hif-xf86-video-fbdev-0.5.0/lib/xorg/modules/drivers"
<   ModulePath "/nix/store/0xm0zaa6sa8b2k4sbcy6kzwk2a31yf9h-xorg-server-1.20.14/lib/xorg/modules"
<   ModulePath "/nix/store/0xm0zaa6sa8b2k4sbcy6kzwk2a31yf9h-xorg-server-1.20.14/lib/xorg/modules/drivers"
<   ModulePath "/nix/store/0xm0zaa6sa8b2k4sbcy6kzwk2a31yf9h-xorg-server-1.20.14/lib/xorg/modules/extensions"
<   ModulePath "/nix/store/kai7zafpiyyx20lip01s8517kvmj851c-xf86-input-evdev-2.10.6/lib/xorg/modules/input"
<   ModulePath "/nix/store/s6zg7cyynhjm3agv63jkp3wf634yr34l-xf86-input-libinput-1.2.0/lib/xorg/modules/input"
<
< EndSection
<
219d199
<

xserver-bad.txt
xserver-good.txt

@jyooru
Copy link
Member

jyooru commented Dec 20, 2022

Also, I just finished compiling with the patch you mentioned and X still segfaults with the same backtrace.

@fabianhjr
Copy link
Member Author

Thanks for providing the examples; though now I am slightly more confused about what is going on. :S

112-      ''
113:        echo 'Section "Files"' >> $out
114-        echo $fontpath >> $out
115-
116-        for i in ${toString fontsForXServer}; do
117-          if test "''${i:0:''${#NIX_STORE}}" == "$NIX_STORE"; then
118-            for j in $(find $i -name fonts.dir); do
119-              echo "  FontPath \"$(dirname $j)\"" >> $out
120-            done
121-          fi
122-        done
123-
124-        for i in $(find ${toString cfg.modules} -type d); do
125-          if test $(echo $i/*.so* | wc -w) -ne 0; then
126-            echo "  ModulePath \"$i\"" >> $out
127-          fi
128-        done
129-
130-        echo '${cfg.filesSection}' >> $out
131-        echo 'EndSection' >> $out
132-        echo >> $out
133-
134-        echo "$config" >> $out
135-      ''; # */

Could you try setting the following options to include your modules / fonts of the good config?

239:      modules = mkOption {
240-        type = types.listOf types.path;
241-        default = [];
242-        example = literalExpression "[ pkgs.xf86_input_wacom ]";
243-        description = lib.mdDoc "Packages to be added to the module search path of the X server.";
244-      };
53-    fonts = {
54-
55-      # TODO: find another name for it.
56:      fonts = mkOption {
57-        type = types.listOf types.path;
58-        default = [];
59-        example = literalExpression "[ pkgs.dejavu_fonts ]";
60-        description = lib.mdDoc "List of primary font paths.";
61-      };

Though, what weirds me out is that I don't understand how the Section "Files" header and EndSection footer could be missing altogether even if modules or fonts.fonts are null or misconfigured.

@fabianhjr
Copy link
Member Author

Hi @edolstra / @xaverdh, I would appreciate some help with the xserver.conf generation code confused about some weird behaviour with newer versions of xserver.

@xaverdh

This comment was marked as duplicate.

@xaverdh
Copy link
Contributor

xaverdh commented Dec 20, 2022

Though, what weirds me out is that I don't understand how the Section "Files" header and EndSection footer could be missing altogether even if modules or fonts.fonts are null or misconfigured.

@jyooru how exactly did you obtain the xserver.conf files? Can you check the build log of your configuration (e.g. with nix log) and / or its output path, if those lines are really not written?

@xaverdh
Copy link
Contributor

xaverdh commented Dec 20, 2022

@jyooru I have a suspicion that maybe for the new config you just looked at the services.xserver.config attribute somehow..

@jyooru
Copy link
Member

jyooru commented Dec 20, 2022

I'm sorry, I didn't realise they would be different. I got the bad configuration file by evaluating services.xserver.config, without realising that there was more modifications made before it was passed to X. Here's the actual configuration:

xserver-bad.txt

This time, no missing modules.

8,16c8,17
<   ModulePath "/nix/store/52b3q5ysi4gn116fch9if766rl2b392f-xf86-video-amdgpu-21.0.0/lib/xorg/modules/drivers"
<   ModulePath "/nix/store/p1dp105wddz3zsw3d2zdvi64pbfvv833-xf86-video-ati-5eba006e4129e8015b822f9e1d2f1e613e252cda/lib/xorg/modules/drivers"
<   ModulePath "/nix/store/vrhl14i29c36b23hqshkg1gg5ivc0gbp-xf86-video-nouveau-3ee7cbca8f9144a3bb5be7f71ce70558f548d268/lib/xorg/modules/drivers"
<   ModulePath "/nix/store/7hli12a0wl78ifxsb6gpplwz8q7k7hif-xf86-video-fbdev-0.5.0/lib/xorg/modules/drivers"
<   ModulePath "/nix/store/0xm0zaa6sa8b2k4sbcy6kzwk2a31yf9h-xorg-server-1.20.14/lib/xorg/modules"
<   ModulePath "/nix/store/0xm0zaa6sa8b2k4sbcy6kzwk2a31yf9h-xorg-server-1.20.14/lib/xorg/modules/drivers"
<   ModulePath "/nix/store/0xm0zaa6sa8b2k4sbcy6kzwk2a31yf9h-xorg-server-1.20.14/lib/xorg/modules/extensions"
<   ModulePath "/nix/store/kai7zafpiyyx20lip01s8517kvmj851c-xf86-input-evdev-2.10.6/lib/xorg/modules/input"
<   ModulePath "/nix/store/s6zg7cyynhjm3agv63jkp3wf634yr34l-xf86-input-libinput-1.2.0/lib/xorg/modules/input"
---
>   ModulePath "/nix/store/aacfasgbnz6dij3h5ifza52vcgw6xn99-xf86-video-amdgpu-21.0.0/lib/xorg/modules/drivers"
>   ModulePath "/nix/store/y823j138xv2lm4ikq6yczxavvyd7lbry-xf86-video-ati-5eba006e4129e8015b822f9e1d2f1e613e252cda/lib/xorg/modules/drivers"
>   ModulePath "/nix/store/w0qs3l92bzhs62dr2x7rabdvh3g9zbid-xf86-video-nouveau-3ee7cbca8f9144a3bb5be7f71ce70558f548d268/lib/xorg/modules/drivers"
>   ModulePath "/nix/store/ha28fhy72qn7jc9qmfn4xgzwn6wajjcg-xf86-video-fbdev-0.5.0/lib/xorg/modules/drivers"
>   ModulePath "/nix/store/cpycrl4bi71cnmzkg14nzifff0xr44af-xorg-server-21.1.5/lib/xorg/modules"
>   ModulePath "/nix/store/cpycrl4bi71cnmzkg14nzifff0xr44af-xorg-server-21.1.5/lib/xorg/modules/drivers"
>   ModulePath "/nix/store/cpycrl4bi71cnmzkg14nzifff0xr44af-xorg-server-21.1.5/lib/xorg/modules/input"
>   ModulePath "/nix/store/cpycrl4bi71cnmzkg14nzifff0xr44af-xorg-server-21.1.5/lib/xorg/modules/extensions"
>   ModulePath "/nix/store/07qkfryfbfj612m7aln4vsbaam682h5f-xf86-input-evdev-2.10.6/lib/xorg/modules/input"
>   ModulePath "/nix/store/41xhkggwpizl95y3x1g0a42kicz53inw-xf86-input-libinput-1.2.0/lib/xorg/modules/input"

@andresilva
Copy link
Member

How many users are affected by this and how (or when) do we decide to move on regardless? We're now more than a year behind the latest release.

@andresilva andresilva closed this Feb 9, 2023
@andresilva andresilva reopened this Feb 9, 2023
@andresilva
Copy link
Member

Sorry for closing, fat finger 😑

@Atemu
Copy link
Member

Atemu commented Feb 9, 2023

@andresilva Affected by what exactly? The update to Xorg itself would affect all desktop users. The 500-1000 packages you see are pretty much all desktop packages.

@Atemu
Copy link
Member

Atemu commented Feb 9, 2023

Btw, with <1000 rebuilds, this can probably go to master rather than staging. (Mind the potentially required rebase!)

@vcunat
Copy link
Member

vcunat commented Feb 9, 2023

Affected by X failing to start up, surely. See backtraces and references above.

@andresilva
Copy link
Member

andresilva commented Feb 9, 2023

@andresilva Affected by what exactly? The update to Xorg itself would affect all desktop users. The 500-1000 packages you see are pretty much all desktop packages.

I should have been more explicit in my wording. I meant affected by the issue that's preventing us from going forward with this update (see #170856 #206663). The reason I'm raising this is because I'm not seeing any progress upstream on this matter, and in the meantime we need to keep using an outdated version and backporting important fixes.

@fabianhjr
Copy link
Member Author

Yeah but also there are people with issues with the currently available 1.20 that are fixed on the 1.21 releases: #206663

So now it becomes a question of "Should I Stay or Should I Go"

@K900
Copy link
Contributor

K900 commented Feb 27, 2023

The Nouveau crash is very likely in the DDX. I think we should move forward with this combined with #218437.

Copy link
Contributor

@K900 K900 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diff LGTM, works fine on my end (amdgpu) for basic things. I think it's time to just send it and see what happens, we can't sit on an ancient version forever.

@K900
Copy link
Contributor

K900 commented Mar 1, 2023

Should we retarget to master and merge?

@fabianhjr fabianhjr changed the base branch from staging to master March 1, 2023 14:37
@fabianhjr fabianhjr changed the title [staging] xorg.xorgserver: 1.20.14 → 21.1.7 xorg.xorgserver: 1.20.14 → 21.1.7 Mar 1, 2023
@fabianhjr
Copy link
Member Author

@K900, rebased to merge-base origin/staging origin/master and retargetted to main branch

@K900 K900 merged commit be54beb into NixOS:master Mar 1, 2023
@fabianhjr fabianhjr deleted the update-xorg branch March 1, 2023 14:51
@fabianhjr
Copy link
Member Author

For reference, #218437 was merged along this branch.

Thanks @K900!

@mweinelt
Copy link
Member

mweinelt commented Mar 6, 2023

Broke the xorg-xserver build on aarch64-darwin. It requires libcvxt to build and builds fine once passed into buildInputs.

https://hydra.nixos.org/build/211444524

But I do wonder who even consume xorg-xserver on aarch64-darwin. If the answer is noone, why not disable it in the first place?

image

@Atemu
Copy link
Member

Atemu commented Mar 6, 2023

Darwin has XQuartz but I don't think our package still works.

@vcunat
Copy link
Member

vcunat commented Mar 6, 2023

It seems quite a coincidence that it just succeeded once on Hydra just before the update:
https://hydra.nixos.org/job/nixpkgs/trunk/xorg.xorgserver.aarch64-darwin

@vcunat
Copy link
Member

vcunat commented Mar 6, 2023

So simply this? #219852

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.

10 participants