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 without any fonts #18

Open
jbeich opened this issue Jul 22, 2023 · 1 comment
Open

Crash without any fonts #18

jbeich opened this issue Jul 22, 2023 · 1 comment

Comments

@jbeich
Copy link

jbeich commented Jul 22, 2023

Trying to run in a clean jail crashes Watershot instead of showing the following error:

.expect("Failed to find font");

Note,font_family: "nonexistent" in ~/.config/watershot.ron still doesn't trigger the error.

$ fc-list
$ watershot
Segmentation fault

* thread #1, name = 'watershot', stop reason = signal SIGSEGV: invalid address (fault address: 0x10)
    frame #0: 0x00000aa93c70fecc libfontconfig.so.1`FcRefIsConst(r=0x0000000000000010) at fcatomic.h:169:71
   166  static inline int    FcRefDec      (FcRef *r) { return fc_atomic_int_add (r->count, -1); }
   167  static inline int    FcRefAdd      (FcRef *r, int v) { return fc_atomic_int_add (r->count, v); }
   168  static inline void   FcRefSetConst (FcRef *r) { r->count = FC_REF_CONSTANT_VALUE; }
-> 169  static inline FcBool FcRefIsConst  (const FcRef *r) { return r->count == FC_REF_CONSTANT_VALUE; }
   170
   171  #endif /* _FCATOMIC_H_ */
(lldb) bt
* thread #1, name = 'watershot', stop reason = signal SIGSEGV: invalid address (fault address: 0x10)
  * frame #0: 0x00000aa93c70fecc libfontconfig.so.1`FcRefIsConst(r=0x0000000000000010) at fcatomic.h:169:71
    frame #1: 0x00000aa93c712349 libfontconfig.so.1`IA__FcPatternReference(p=0x0000000000000000) at fcpat.c:1218:10
    frame #2: 0x00000aa119b8976e watershot`fontconfig::Pattern::from_pattern::h27d2b79756aa8a86(fc=0x00000aa93aa40308, pat=0x0000000000000000) at lib.rs:197:9
    frame #3: 0x00000aa119b89aa1 watershot`fontconfig::Pattern::font_match::h5514b8e8980d9251(self=0x00000aa93aa3fdf8) at lib.rs:292:13
    frame #4: 0x00000aa119b892a5 watershot`fontconfig::Font::find::h49d5c33175243cca(fc=0x00000aa93aa40308, family=(data_ptr = "monospaceoⶢ\U0000000e", length = 9), style=Option<&str> @ 0x00000aa93aa3fde8) at lib.rs:152:26
    frame #5: 0x00000aa119b88fca watershot`fontconfig::Fontconfig::find::hfd07258ab079598d(self=0x00000aa93aa40308, family=(data_ptr = "monospaceoⶢ\U0000000e", length = 9), style=Option<&str> @ 0x00000aa93aa3ff28) at lib.rs:118:9
    frame #6: 0x00000aa11917e16d watershot`watershot::runtime_data::RuntimeData::new::hce5681281c457f20(qh=0x00000aa93aa412b0, globals=0x00000aa93aa411c0, args=(copy = false, stdout = false, grim = core::option::Option<alloc::string::String> @ 0x00000aa93aa418d8, save = core::option::Option<watershot::types::SaveLocation> @ 0x00000aa93aa418b8)) at runtime_data.rs:81:23
    frame #7: 0x00000aa1191ce163 watershot`watershot::gui::h945d8e0e356f1264(args=0x00000aa93aa434c0) at main.rs:102:28
    frame #8: 0x00000aa1191ccc89 watershot`watershot::main::hea9f55f4eb1c4f64 at main.rs:33:26
    frame #9: 0x00000aa1191ee49b watershot`core::ops::function::FnOnce::call_once::h6a4c4bb0bfd20375((null)=(watershot`watershot::main::hea9f55f4eb1c4f64 at main.rs:29), (null)=<unavailable>) at function.rs:250:5
    frame #10: 0x00000aa11923e86e watershot`std::sys_common::backtrace::__rust_begin_short_backtrace::h4f6dbe38327542d6(f=(watershot`watershot::main::hea9f55f4eb1c4f64 at main.rs:29)) at backtrace.rs:135:18
    frame #11: 0x00000aa1191cfcc1 watershot`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::h9903a531f48c65c6 at rt.rs:166:18
    frame #12: 0x00000aa11a07f877 watershot`std::panicking::try::h09ab0ca6a50f9591 + 23
    frame #13: 0x00000aa11a09badb watershot`std::rt::lang_start_internal::h3e0793a574932966 + 43
    frame #14: 0x00000aa1191cfc9a watershot`std::rt::lang_start::h5e046485b1630588(main=(watershot`watershot::main::hea9f55f4eb1c4f64 at main.rs:29), argc=1, argv=0x00000aa93aa43da8, sigpipe='\0') at rt.rs:165:17
    frame #15: 0x00000aa1191cee3e watershot`main + 30
    frame #16: 0x00000aa11916f48d watershot`_start(ap=<unavailable>, cleanup=<unavailable>) at crt1_c.c:75:7
@Kirottu
Copy link
Owner

Kirottu commented Jul 23, 2023

That's very weird, if I point it to a nonexistent font it just loads the default. But you do most certainly need fonts to run Watershot and it seems like that segfault originates from the fontconfig lib that I use anyway.

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

2 participants