Skip to content

espanso: runtime crash on aarch64-darwin #247162

Closed

Description

@n8henrie

Describe the bug

Espanso builds on aarch64-darwin but crashes at runtime.

Steps To Reproduce

I've tried removing caches, the socket, and the config directory.

$ RUST_BACKTRACE=full nix shell --impure github:nixos/nixpkgs/master#espanso -c espanso launcher
12:21:00 [daemon(82385)] [INFO] reading configs from: "/Users/n8henrie/.config/espanso"
12:21:00 [daemon(82385)] [INFO] reading packages from: "/Users/n8henrie/.config/espanso/match/packages"
12:21:00 [daemon(82385)] [INFO] using runtime dir: "/Users/n8henrie/Library/Caches/espanso"
12:21:00 [daemon(82385)] [INFO] system info: Darwin v13.4.1 - kernel: 22.5.0
12:21:00 [daemon(82385)] [INFO] watching for changes in path: "/Users/n8henrie/.config/espanso"
12:21:00 [daemon(82385)] [INFO] espanso version: 2.1.8
12:21:00 [daemon(82385)] [INFO] spawning the worker process...
12:21:00 [daemon(82385)] [INFO] binded to IPC unix socket: /Users/n8henrie/Library/Caches/espanso/espansodaemonv2.sock
12:21:00 [worker(82386)] [INFO] reading configs from: "/Users/n8henrie/.config/espanso"
12:21:00 [worker(82386)] [INFO] reading packages from: "/Users/n8henrie/.config/espanso/match/packages"
12:21:00 [worker(82386)] [INFO] using runtime dir: "/Users/n8henrie/Library/Caches/espanso"
12:21:00 [worker(82386)] [INFO] system info: Darwin v13.4.1 - kernel: 22.5.0
12:21:00 [worker(82386)] [INFO] binded to IPC unix socket: /Users/n8henrie/Library/Caches/espanso/espansoworkerv2.sock
12:21:00 [worker(82386)] [INFO] using CocoaAppInfoProvider
12:21:00 [worker(82386)] [INFO] monitoring the status of the daemon process
12:21:00 [worker(82386)] [INFO] monitoring the status of secure input
12:21:00 [worker(82386)] [INFO] using CocoaSource
12:21:00 [daemon(82385)] [ERROR] received unexpected exit code from worker 90, exiting
thread 'main' panicked at 'failed to launch daemon: unexpected error, 'espanso daemon' returned a non-zero exit code.', espanso/src/cli/launcher/mod.rs:213:45
stack backtrace:
   0:        0x1009c3e48 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hdbda7bad23d0989b
   1:        0x1009f2790 - core::fmt::write::ha7185724a9074a24
   2:        0x1009d40d0 - std::io::Write::write_fmt::h39b76246c43beee5
   3:        0x1009c3c58 - std::sys_common::backtrace::print::h9ab79e95a8514b2a
   4:        0x1009d1360 - std::panicking::default_hook::{{closure}}::h70d1ee0541384b30
   5:        0x1009d1028 - std::panicking::default_hook::h0c694e5a46d81a66
   6:        0x1009d1970 - std::panicking::rust_panic_with_hook::h7c5b1bba2687e431
   7:        0x1009c4134 - std::panicking::begin_panic_handler::{{closure}}::h987019bf6abca606
   8:        0x1009c3f40 - std::sys_common::backtrace::__rust_end_short_backtrace::hfb3419c4c717fc35
   9:        0x1009d158c - _rust_begin_unwind
  10:        0x100a20838 - core::panicking::panic_fmt::h5f01a4ff4c7b4c75
  11:        0x100a20c04 - core::result::unwrap_failed::he6fa6ecd36446cc9
  12:        0x1005cd7c4 - espanso::cli::launcher::launcher_main::he40a224b906047c7
  13:        0x1005b0550 - espanso::main::h0474c4c09d7623ed
  14:        0x10057a5d4 - std::sys_common::backtrace::__rust_begin_short_backtrace::h92876866a6e51a8e
  15:        0x10055a5b8 - std::rt::lang_start::{{closure}}::h80015b9063749177
  16:        0x1009d14b0 - std::panicking::try::h6910f825b820c47a
  17:        0x1009d85a4 - std::rt::lang_start_internal::hce9a5566c4a2c217
  18:        0x1005b1a40 - _main

Expected behavior

nix-installed espanso should run without crashing

Additional context

Espanso 2.1.8 builds and runs from source without crashing

Notify maintainers

@kimat
@Thehedgeh0g

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 22.5.0, macOS 13.4.1`
 - multi-user?: `no`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.3`
 - channels(n8henrie): `""`
 - channels(root): `""`
 - nixpkgs: `not found`

Activity

  1. added
    0.kind: bug
    on Aug 4, 2023
  2. nixos-discourse commented on Aug 5, 2023

    @nixos-discourse
  3. n8henrie commented on Apr 4, 2024

    @n8henrie
    ContributorAuthor

    Looking more closely at the crash logs in Console.app and adding a lot of debug print statements, it seems to be crashing at this line of unsafe code: https://github.com/espanso/espanso/blob/db97658d1d80697a635b57801696c594eacf057b/espanso-detect/src/mac/mod.rs#L253

  4. n8henrie commented on Apr 7, 2024

    @n8henrie
    ContributorAuthor

    With more print debugging, it seems to crash right at this dispatch_async call.

  5. nixos-discourse commented on Apr 8, 2024

    @nixos-discourse
  6. n8henrie commented on Apr 13, 2024

    @n8henrie
    ContributorAuthor

    Upstream issue: espanso/espanso#1945

    Does anyone know why this compiles and runs fine with the host toolchain on aarch64-darwin but crashes (at runtime) when compiled with nix?

    Some kind of different compile flags I'm sure.

  7. nixos-discourse commented on Apr 13, 2024

    @nixos-discourse
  8. nixos-discourse commented on Apr 13, 2024

    @nixos-discourse
  9. n8henrie commented on Jul 25, 2024

    @n8henrie
    ContributorAuthor

    This was fixed by updating espanso to a non-tagged version.

  10. added a commit that references this issue on Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions