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

Crash when created an excluded file #10890

Closed
1 task done
williamdes opened this issue Apr 23, 2024 · 13 comments · Fixed by #12620
Closed
1 task done

Crash when created an excluded file #10890

williamdes opened this issue Apr 23, 2024 · 13 comments · Fixed by #12620
Labels
defect [core label] linux panic / crash [core label] setting Feedback for preferences, configuration, etc workspace Feedback for workspace management, layout, interactions, etc

Comments

@williamdes
Copy link
Contributor

williamdes commented Apr 23, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

I tried to create a .gitignore file

Thread "main" panicked with "called `Option::unwrap()` on a `None` value" at crates/gpui/src/platform/cosmic_text/text_system.rs:308:14
  "file_scan_exclusions": [
...
    "**/.gitattributes",
    "**/.gitignore",
...
  ],

Environment

Zed: v1.0.0 (Zed Dev 615de38)
OS: Debian 12
Memory: 62.4 GiB
Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

@williamdes williamdes added admin read Pending admin review defect [core label] triage Maintainer needs to classify the issue labels Apr 23, 2024
@Moshyfawn Moshyfawn added workspace Feedback for workspace management, layout, interactions, etc linux panic / crash [core label] setting Feedback for preferences, configuration, etc and removed triage Maintainer needs to classify the issue labels Apr 23, 2024
@JosephTLyons JosephTLyons removed the admin read Pending admin review label Apr 24, 2024
@apricotbucket28
Copy link
Contributor

Hello! Is this still happening? If so, could you share the exact steps to reproduce the issue?

@williamdes
Copy link
Contributor Author

Hello! Is this still happening? If so, could you share the exact steps to reproduce the issue?

Yeah, got it this afternoon

Read the issue, you need to create a file that you excluded from the tree
Right click on folder -> new file and use a file name that is excluded

@apricotbucket28
Copy link
Contributor

apricotbucket28 commented Jun 2, 2024

I cannot reproduce the issue, and it seems very unlikely that this is due to the files being excluded since the crash happens in the text system. Could you share your Zed settings? (mainly font settings and such)
It'd also be helpful if you could record a video 🙂

@williamdes
Copy link
Contributor Author

I cannot reproduce the issue, and it seems very unlikely that this is due to the files being excluded since the crash happens in the text system. Could you share your Zed settings? (mainly font settings and such) It'd also be helpful if you could record a video 🙂

It is totally related.

In fact I added a special name to file_scan_exclusions and tried to create the file and it crashed.

"file_scan_exclusions": [
"**/.make-it-crash"
]
Thread "main" panicked with "called `Option::unwrap()` on a `None` value" at crates/gpui/src/platform/cosmic_text/text_system.rs:297:14
   0: Zed::reliability::init_panic_hook::{closure#0}
             at crates/zed/src/reliability.rs:54:29
   1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/alloc/src/boxed.rs:2034:9
      std::panicking::rust_panic_with_hook
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:783:13
   2: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:649:13
   3: std::sys_common::backtrace::__rust_end_short_backtrace
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/sys_common/backtrace.rs:171:18
   4: rust_begin_unwind
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/std/src/panicking.rs:645:5
   5: core::panicking::panic_fmt
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:72:14
   6: core::panicking::panic
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/panicking.rs:145:5
   7: core::option::unwrap_failed
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/option.rs:1985:5
   8: <core::option::Option<swash::scale::image::Image>>::unwrap
             at /rustc/9b00956e56009bab2aa15d7bff10916599e3d6d6/library/core/src/option.rs:933:21
      <gpui::platform::cosmic_text::text_system::CosmicTextSystemState>::raster_bounds
             at crates/gpui/src/platform/cosmic_text/text_system.rs:297:14
      <gpui::platform::cosmic_text::text_system::CosmicTextSystem as gpui::platform::PlatformTextSystem>::glyph_raster_bounds
             at crates/gpui/src/platform/cosmic_text/text_system.rs:165:9

@SomeoneToIgnore
Copy link
Contributor

SomeoneToIgnore commented Jun 3, 2024

@williamdes , sounds like you have something else in your settings that makes it panic.

As it shows in the backtrace, the crash is related to font rendering, so listening to the previous message and providing your settings, especially

mainly font settings and such

is a way forward.

Here's a video with the latest Preview that does not crash for me (albeit the behavior is still not good):
https://github.com/zed-industries/zed/assets/2690773/036cc3c4-a26a-4a73-b9d8-21ab892c73e6

@williamdes
Copy link
Contributor Author

williamdes commented Jun 3, 2024

Here's a video with the latest Preview that does not crash for me (albeit the behavior is still not good):
https://github.com/zed-industries/zed/assets/2690773/036cc3c4-a26a-4a73-b9d8-21ab892c73e6

Thank you for this video. It crashes on my end.
Here is a video

zed-crash.mp4

@SomeoneToIgnore
Copy link
Contributor

Great, now we have to ask you, for the 3rd time in this issue, to provide your settings.

@williamdes
Copy link
Contributor Author

Great, now we have to ask you, for the 3rd time in this issue, to provide your settings.

Gosh, sorry about that 🤦🏻
Well, I already provided them.
That said, to ensure no other setting was interfering with this I nuked all my settings and kept

{
  "file_scan_exclusions": [
    "**/.gitignore"
  ]
}

The bug does not change

@SomeoneToIgnore

This comment was marked as off-topic.

@SomeoneToIgnore
Copy link
Contributor

Ohh, I see, sorry for misreading the last comment — so there's something system-related then?

I will try to poke at it, but it's quite hard to understand what's not matching the "regular" experience.
This is quite hard to fix with such little info though, so I might have to come back and ask you to try a build/patch, since I'm totally blind here.

@williamdes
Copy link
Contributor Author

Ohh, I see, sorry for misreading the last comment — so there's something system-related then?

I am using XFCE 4.18 on Debian 12 and did not change font stuff.

I will try to poke at it, but it's quite hard to understand what's not matching the "regular" experience.
This is quite hard to fix with such little info though, so I might have to come back and ask you to try a build/patch, since I'm totally blind here.

Yes, sure, I will test it right away

On your video it looked like there is a GUI bug, maybe fix this first and we will see if the crash persists

@SomeoneToIgnore
Copy link
Contributor

There was more than one bug related to the directory creation, and overall the ergonomics required some improvements, so it was a relatively long one: #12620

The fix is coming this Wednesday with Zed 0.139

SomeoneToIgnore added a commit that referenced this issue Jun 4, 2024
Fixes #10890

* removes `unwrap()` that caused panics for text elements with no text,
remaining after edit state is cleared but project entries are not
updated, having the fake, "new entry"
* improves discoverability of the FS errors during file/directory
creation: now those are shown as workspace notifications
* stops printing anyhow backtraces in workspace notifications, printing
the more readable chain of contexts instead
* better indicates when new entries are created as excluded ones


Release Notes:

- Improve excluded entry creation workflow in the project panel
([10890](#10890))
@williamdes
Copy link
Contributor Author

Thank you for the fix !
I downloaded the nightly build and it works 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect [core label] linux panic / crash [core label] setting Feedback for preferences, configuration, etc workspace Feedback for workspace management, layout, interactions, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants