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

Cosmic Appreance Settings Crashes #440

Closed
asosnovsky opened this issue Oct 25, 2024 · 16 comments
Closed

Cosmic Appreance Settings Crashes #440

asosnovsky opened this issue Oct 25, 2024 · 16 comments

Comments

@asosnovsky
Copy link

All of the other settings seem to work fine, but for some reason when I go to the "appereance" section it crashes and exits.

Here are the logs I gathered when launching the settings from terminal:

 ~ cosmic-settings
   WARN  Key-Binding 'Period' only matched case insensitive for "period"
    at /build/cargo-vendor-dir/cosmic-settings-config-0.1.0/src/shortcuts/sym.rs:26 on main

   WARN  Key-Binding 'Comma' only matched case insensitive for "comma"
    at /build/cargo-vendor-dir/cosmic-settings-config-0.1.0/src/shortcuts/sym.rs:26 on main

   WARN  Key-Binding 'Period' only matched case insensitive for "period"
    at /build/cargo-vendor-dir/cosmic-settings-config-0.1.0/src/shortcuts/sym.rs:26 on main

   WARN  Key-Binding 'Comma' only matched case insensitive for "comma"
    at /build/cargo-vendor-dir/cosmic-settings-config-0.1.0/src/shortcuts/sym.rs:26 on main

  ERROR  shortcuts custom config error: GetKey("custom", Os { code: 2, kind: NotFound, message: "No such file or directory" })
    at /build/cargo-vendor-dir/cosmic-settings-config-0.1.0/src/shortcuts/mod.rs:43 on main

  ERROR  Failed to get the contrast Portal(NotFound("Requested setting not found"))
    at /build/cargo-vendor-dir/libcosmic-0.1.0/src/theme/portal.rs:47 on tokio-runtime-worker

The application panicked (crashed).
Message:  Size not found for icon
Location: /build/cargo-vendor-dir/freedesktop-icons-0.2.6/src/theme/parse.rs:54

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: PoisonError { .. }
Location: /build/cargo-vendor-dir/libcosmic-0.1.0/src/widget/icon/named.rs:78

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: PoisonError { .. }
Location: /build/cargo-vendor-dir/libcosmic-0.1.0/src/icon_theme.rs:17

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: PoisonError { .. }
Location: /build/cargo-vendor-dir/libcosmic-0.1.0/src/icon_theme.rs:17

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Here is some info:

cat flake.lock | jq '.nodes["nixos-cosmic"]'
{
  "inputs": {
    "flake-compat": "flake-compat",
    "nixpkgs": [
      "nixpkgs"
    ],
    "nixpkgs-stable": "nixpkgs-stable",
    "rust-overlay": "rust-overlay"
  },
  "locked": {
    "lastModified": 1729857853,
    "narHash": "sha256-IVaFOTG4i2K0YWKrJui09YCAEWyTSK+zaUTUvj/SbC4=",
    "owner": "lilyinstarlight",
    "repo": "nixos-cosmic",
    "rev": "04408bf4afe2bf2b15227c43914130c8bdf4ed3c",
    "type": "github"
  },
  "original": {
    "owner": "lilyinstarlight",
    "repo": "nixos-cosmic",
    "type": "github"
  }
}
cat flake.lock | jq '.nodes["nixpkgs"]'
{
  "locked": {
    "lastModified": 1729449015,
    "narHash": "sha256-Gf04dXB0n4q0A9G5nTGH3zuMGr6jtJppqdeljxua1fo=",
    "owner": "NixOS",
    "repo": "nixpkgs",
    "rev": "89172919243df199fe237ba0f776c3e3e3d72367",
    "type": "github"
  },
  "original": {
    "owner": "NixOS",
    "ref": "nixos-24.05",
    "repo": "nixpkgs",
    "type": "github"
  }
}
@lilyinstarlight
Copy link
Owner

I cannot replicate this issue at all on latest nixos-unstable or nixos-24.05. Is your config publicly available so I can poke at it?

@asosnovsky
Copy link
Author

asosnovsky commented Oct 28, 2024

@lilyinstarlight yes it is https://github.com/asosnovsky/nixos-setup/tree/main

This host is the one for my laptop: https://github.com/asosnovsky/nixos-setup/blob/main/hosts/fwbook.nix

The desktop config https://github.com/asosnovsky/nixos-setup/blob/main/modules/nixos/desktop/cosmic.nix

FYI I am running it side by side with Plasma6, and using GDM. Though I did try the cosmic-gretter and got the same results.

Also just ran the cosmic-settings with the RUST_BACKTRACE flag set to full, hopefully it helps

 cosmic-settings
   WARN  Key-Binding 'Period' only matched case insensitive for "period"
    at /build/cargo-vendor-dir/cosmic-settings-config-0.1.0/src/shortcuts/sym.rs:26 on main

   WARN  Key-Binding 'Comma' only matched case insensitive for "comma"
    at /build/cargo-vendor-dir/cosmic-settings-config-0.1.0/src/shortcuts/sym.rs:26 on main

   WARN  Key-Binding 'Period' only matched case insensitive for "period"
    at /build/cargo-vendor-dir/cosmic-settings-config-0.1.0/src/shortcuts/sym.rs:26 on main

   WARN  Key-Binding 'Comma' only matched case insensitive for "comma"
    at /build/cargo-vendor-dir/cosmic-settings-config-0.1.0/src/shortcuts/sym.rs:26 on main

  ERROR  Failed to get the contrast Portal(NotFound("Requested setting not found"))
    at /build/cargo-vendor-dir/libcosmic-0.1.0/src/theme/portal.rs:47 on tokio-runtime-worker

The application panicked (crashed).
Message:  Size not found for icon
Location: /build/cargo-vendor-dir/freedesktop-icons-0.2.6/src/theme/parse.rs:54

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 7 frames hidden ⋮
   8: core::option::expect_failed::h6d726c0eb3b486db
      at <unknown source file>:<unknown line>
   9: freedesktop_icons::theme::parse::<impl freedesktop_icons::theme::Theme>::get_directory::hf1b248db6c64ece3
      at <unknown source file>:<unknown line>
  10: <alloc::vec::into_iter::IntoIter<T,A> as core::iter::traits::iterator::Iterator>::try_fold::h46e401fc1277fb46
      at <unknown source file>:<unknown line>
  11: freedesktop_icons::theme::Theme::try_get_icon::h046d43937c4ab4de
      at <unknown source file>:<unknown line>
  12: freedesktop_icons::LookupBuilder::find::h5369c8c5d6b7d4cd
      at <unknown source file>:<unknown line>
  13: cosmic::widget::icon::named::Named::path::h04aebfb475aecec5
      at <unknown source file>:<unknown line>
  14: core::iter::traits::iterator::Iterator::find_map::check::{{closure}}::h94dacfc0bc7e00de
      at <unknown source file>:<unknown line>
  15: <core::iter::adapters::chain::Chain<A,B> as core::iter::traits::iterator::Iterator>::try_fold::h898356efcd9a238e
      at <unknown source file>:<unknown line>
  16: cosmic_settings::pages::desktop::appearance::icon_themes::preview_handles::hcdb9725826fe7cc6
      at <unknown source file>:<unknown line>
  17: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll::h1efea1007c7efe98
      at <unknown source file>:<unknown line>
  18: tokio::runtime::task::core::Core<T,S>::poll::h886e189bc61594e7
      at <unknown source file>:<unknown line>
  19: tokio::runtime::task::harness::Harness<T,S>::poll::h553e312cfad0d72d
      at <unknown source file>:<unknown line>
  20: tokio::runtime::blocking::pool::Inner::run::hc7465773c142cfb4
      at <unknown source file>:<unknown line>
  21: std::sys::backtrace::__rust_begin_short_backtrace::he8b4447bca4bab38
      at <unknown source file>:<unknown line>
  22: core::ops::function::FnOnce::call_once{{vtable.shim}}::h0d75e94aae96b777
      at <unknown source file>:<unknown line>
  23: std::sys::pal::unix::thread::Thread::new::thread_start::hcdbd1049068002f4
      at <unknown source file>:<unknown line>
  24: start_thread<unknown>
      at <unknown source file>:<unknown line>
  25: clone3<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: PoisonError { .. }
Location: /build/cargo-vendor-dir/libcosmic-0.1.0/src/widget/icon/named.rs:78

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 8 frames hidden ⋮
   9: cosmic::widget::icon::named::Named::path::h04aebfb475aecec5
      at <unknown source file>:<unknown line>
  10: cosmic::widget::icon::Icon::view::h792cd47dbb479df8
      at <unknown source file>:<unknown line>
  11: cosmic::widget::segmented_button::widget::draw_icon::h9a568085e7bec2f7
      at <unknown source file>:<unknown line>
  12: <cosmic::widget::segmented_button::widget::SegmentedButton<Variant,SelectionMode,Message> as iced_core::widget::Widget<Message,cosmic::theme::Theme,iced_renderer::fallback::Renderer<iced_wgpu::Renderer,iced_tiny_skia::Renderer>>>::draw::h29c372a66702fac5
      at <unknown source file>:<unknown line>
  13: <iced_widget::scrollable::Scrollable<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::h8a940c03bf281dfc
      at <unknown source file>:<unknown line>
  14: <iced_widget::container::Container<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::heb5df1fee80e7791
      at <unknown source file>:<unknown line>
  15: <cosmic::widget::id_container::IdContainer<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::h93670424cb808c91
      at <unknown source file>:<unknown line>
  16: <iced_widget::row::Row<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::he9f56590d5202e88
      at <unknown source file>:<unknown line>
  17: <iced_widget::column::Column<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::h4b7a4d1e2687b1a7
      at <unknown source file>:<unknown line>
  18: <iced_widget::container::Container<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::heb5df1fee80e7791
      at <unknown source file>:<unknown line>
  19: <cosmic::widget::id_container::IdContainer<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::h93670424cb808c91
      at <unknown source file>:<unknown line>
  20: <iced_widget::column::Column<Message,Theme,Renderer> as iced_core::widget::Widget<Message,Theme,Renderer>>::draw::h4b7a4d1e2687b1a7
      at <unknown source file>:<unknown line>
  21: iced_runtime::user_interface::UserInterface<Message,Theme,Renderer>::draw::h0b792f12f9396881
      at <unknown source file>:<unknown line>
  22: iced_winit::program::run_instance::{{closure}}::hbb9cf2ffde13d371
      at <unknown source file>:<unknown line>
  23: iced_winit::program::run::Runner<Message,F,C>::process_event::h98952eaa2be22c71
      at <unknown source file>:<unknown line>
  24: winit::platform_impl::linux::wayland::event_loop::EventLoop::single_iteration::h14811af91d5f0b11
      at <unknown source file>:<unknown line>
  25: winit::platform_impl::linux::wayland::event_loop::EventLoop::run_app::he589d51c16b2c23a
      at <unknown source file>:<unknown line>
  26: iced_winit::program::run::h29de4843dc59add9
      at <unknown source file>:<unknown line>
  27: iced::program::Program::run_with::h30b828701d6b5f40
      at <unknown source file>:<unknown line>
  28: cosmic::app::run_single_instance::h4b7cabc6aec8bbc4
      at <unknown source file>:<unknown line>
  29: cosmic_settings::main::hee4f0c113de68c89
      at <unknown source file>:<unknown line>
  30: std::sys::backtrace::__rust_begin_short_backtrace::h65d869db3c64c7f1
      at <unknown source file>:<unknown line>
  31: std::rt::lang_start::{{closure}}::h6f6646432ded0b53
      at <unknown source file>:<unknown line>
  32: std::rt::lang_start_internal::h4d90db0530245041
      at <unknown source file>:<unknown line>
  33: main<unknown>
      at <unknown source file>:<unknown line>
  34: __libc_start_call_main<unknown>
      at <unknown source file>:<unknown line>
  35: __libc_start_main@GLIBC_2.2.5<unknown>
      at <unknown source file>:<unknown line>
  36: _start<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: PoisonError { .. }
Location: /build/cargo-vendor-dir/libcosmic-0.1.0/src/icon_theme.rs:17

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 8 frames hidden ⋮
   9: cosmic::icon_theme::default::h2a8821713343abe4
      at <unknown source file>:<unknown line>
  10: cosmic_settings::pages::desktop::appearance::icon_themes::preview_handles::hcdb9725826fe7cc6
      at <unknown source file>:<unknown line>
  11: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll::h1efea1007c7efe98
      at <unknown source file>:<unknown line>
  12: tokio::runtime::task::core::Core<T,S>::poll::h886e189bc61594e7
      at <unknown source file>:<unknown line>
  13: tokio::runtime::task::harness::Harness<T,S>::poll::h553e312cfad0d72d
      at <unknown source file>:<unknown line>
  14: tokio::runtime::blocking::pool::Inner::run::hc7465773c142cfb4
      at <unknown source file>:<unknown line>
  15: std::sys::backtrace::__rust_begin_short_backtrace::he8b4447bca4bab38
      at <unknown source file>:<unknown line>
  16: core::ops::function::FnOnce::call_once{{vtable.shim}}::h0d75e94aae96b777
      at <unknown source file>:<unknown line>
  17: std::sys::pal::unix::thread::Thread::new::thread_start::hcdbd1049068002f4
      at <unknown source file>:<unknown line>
  18: start_thread<unknown>
      at <unknown source file>:<unknown line>
  19: clone3<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.

@asosnovsky
Copy link
Author

@lilyinstarlight any updates? I think the root cause must be just that when this .unwrap https://github.com/pop-os/libcosmic/blob/36b3cfa13aeac6e5cdf7e76ef826ed7d66aaebfe/src/icon_theme.rs#L17 is called it corrupts the locks which then crashes the whole thing.

I am guessing that I am missing some default styles for cosmic? Not sure why or how... any chance the log message could at least point me to the file I need to add?

@lilyinstarlight
Copy link
Owner

lilyinstarlight commented Nov 2, 2024

You don't need to add any files, the packages and module handle everything. I'll try to poke at your config today or tomorrow to see what's wrong with it

@lilyinstarlight
Copy link
Owner

lilyinstarlight commented Nov 2, 2024

To clarify, the log says even at the start of this thread (which I was suspicious of) that you're missing COSMIC schemas. That does not happen in the configurations provided by the module in this repository, so I'm worried something on your end is mucking something up after this module is applied. I'm trying to build your config now and manually inspect the toplevel

Also the application is crashing elsewhere from that line as well. Look at the earlier backtraces, another thread crashed first and the main thread only failed there when a different thread died while holding the lock (and .unwrap() doesn't corrupt anything, it specifically calls abort() because that function is the programmer's way of saying "if this is an error then kill the application" in Rust)

@asosnovsky
Copy link
Author

@lilyinstarlight that makes sense. I also suspected something is strange with my gtk theming. I have a feeling that I messed up something when installing a custom theme via KDE plasma a few months back (unfortunately this was not done declaratively).

What's the appropriate way to reset all the changes to my gtk theming? Is there a folder under .config I can clear?

@Thatoo
Copy link
Contributor

Thatoo commented Nov 2, 2024

I should say that, if it has never crash, this setting panel (Desktop > Appearance) takes quiet some time to display compare to all other settings panels. Is it normal?

@lilyinstarlight
Copy link
Owner

What's the appropriate way to reset all the changes to my gtk theming? Is there a folder under .config I can clear?

Hmmmm spooky

If you're sure there's nothing you need out of these directories, you could rm -r ~/.config/gtk-* ~/.local/share/{themes,icons} I suppose. But perhaps it would be safer to make a backup of them (e.g. mkdir ~/themebackup && mv ~/.config/gtk-* ~/.local/share/{themes,icons} ~/themebackup/)

@lilyinstarlight
Copy link
Owner

I should say that, if it has never crash, this setting panel (Desktop > Appearance) takes quiet some time to display compare to all other settings panels. Is it normal?

How much is "quite some time"? (also this is likely unrelated to this issue so if you could open a new issue or just ping me on Matrix if you're not sure it's an issue that would be helpful <3)

@asosnovsky
Copy link
Author

asosnovsky commented Nov 3, 2024

@lilyinstarlight clearing out my icons folder in share seems to have resolved this. It seems that the icons in this theme https://github.com/vinceliuice/WhiteSur-gtk-theme cause the crash somehow.

I can also confirm what @Thatoo where opening the appreance sections takes a noticable 2-3 seconds before I can change any settings.

Also I noticed that some buttons like "Apply this theme to GNOME apps" just don't click.

also these still show up when I laucnh from terminal:

   WARN  Key-Binding 'Period' only matched case insensitive for "period"
    at /build/cargo-vendor-dir/cosmic-settings-config-0.1.0/src/shortcuts/sym.rs:26 on main

   WARN  Key-Binding 'Comma' only matched case insensitive for "comma"
    at /build/cargo-vendor-dir/cosmic-settings-config-0.1.0/src/shortcuts/sym.rs:26 on main

   WARN  Key-Binding 'Period' only matched case insensitive for "period"
    at /build/cargo-vendor-dir/cosmic-settings-config-0.1.0/src/shortcuts/sym.rs:26 on main

   WARN  Key-Binding 'Comma' only matched case insensitive for "comma"
    at /build/cargo-vendor-dir/cosmic-settings-config-0.1.0/src/shortcuts/sym.rs:26 on main

  ERROR  Failed to get the contrast Portal(NotFound("Requested setting not found"))
    at /build/cargo-vendor-dir/libcosmic-0.1.0/src/theme/portal.rs:47 on tokio-runtime-worker

The last one is really what still concerns me and I suspect might be causing the long delay in start time.

@Elias-Graf
Copy link

Elias-Graf commented Jan 1, 2025

How much is "quite some time"? (also this is likely unrelated to this issue so if you could open a new issue or just ping me on Matrix if you're not sure it's an issue that would be helpful <3)

I used to experience this delay too (about 3–8 seconds to load the page), but I simply assumed, it was some weird stuff with the daemon. Now, as of the latest build, the appearance settings seemed to load like every other page.

@Thatoo
Copy link
Contributor

Thatoo commented Jan 2, 2025

I keep having this delay even after updating right now.

@Elias-Graf
Copy link

Yup, same, I just checked again after rebooting from yesterday, and the first time I open it, it takes a solid 5 seconds to load the page. After that, it seems to open immediately.

@Thatoo
Copy link
Contributor

Thatoo commented Jan 18, 2025

Since last updates, cosmic appearance settings don't crash and display very fast now. I don't experience any issue anymore. Maybe this issue could be closed now.

What do yout think @asosnovsky and @Elias-Graf ?

@Elias-Graf
Copy link

Quickly tested it on two machines without issue.

@asosnovsky
Copy link
Author

I can confirm it’s working fine for me as well!

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

No branches or pull requests

4 participants