Bug 274852 - editors/lapce: Update to 0.3.1 / Crashes with core dump
Summary: editors/lapce: Update to 0.3.1 / Crashes with core dump
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Nuno Teixeira
URL: https://github.com/lapce/lapce/releas...
Keywords:
Depends on:
Blocks: 276033
  Show dependency treegraph
 
Reported: 2023-11-01 17:31 UTC by Nuno Teixeira
Modified: 2023-12-31 14:03 UTC (History)
2 users (show)

See Also:


Attachments
Update to 0.3.0 (222.15 KB, patch)
2023-11-01 17:31 UTC, Nuno Teixeira
no flags Details | Diff
Update to 0.3.1 (222.76 KB, patch)
2023-12-24 19:00 UTC, Nuno Teixeira
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nuno Teixeira freebsd_committer freebsd_triage 2023-11-01 17:31:19 UTC
Created attachment 246050 [details]
Update to 0.3.0

Current status:

- Builds OK: 15, 140, 132, 124 amd64 (broken on i386)
- Build fails on aarch64:

[drm-sys 0.4.0] No prebuilt bindings for target OS `freebsd` and/or architecture `aarch64`. Try `use_bindgen` feature.

Did not tried bindgen yet.
https://docs.rs/crate/drm-sys/0.5.0/source/README.md

- Run test on 15 CURRENT:

pid 36034 (lapce), jid 0, uid 1001: exited on signal 6 (core dumped)
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2023-11-01 20:15:57 UTC
Have you tried for the sake of debugging to disable the optimzation we additionally add?
LTO_UNSAFE=yes

https://cgit.freebsd.org/ports/commit/Mk/Uses/cargo.mk?id=967022fd812cf67dec264ee4e53bd016b69e7a2b

Some optimization is also defined by upstream,
https://github.com/lapce/lapce/blob/master/Cargo.toml#L96 which you might also want to adjust
Comment 2 Nuno Teixeira freebsd_committer freebsd_triage 2023-11-01 22:30:10 UTC
(In reply to Daniel Engberg from comment #1)

LTO_UNSAFE=yes reduced build from 26min -> 9min (same with LTO_UNSAFE=yes + Cargo.toml lto=false).

Now running it lapce doesn't core dump and don't log anything on /var/log/messages.

What I see with and without LTO is a very quick window that we can't see because is to fast to disappear.

Hum, need to learn about debugging rust.

Thanks!
Comment 3 Nuno Teixeira freebsd_committer freebsd_triage 2023-11-02 08:51:29 UTC
(In reply to Nuno Teixeira from comment #2)

Without LTO:

---
env RUST_BACKTRACE=full lapce -w
thread 'main' panicked at /wrkdirs/usr/ports/editors/lapce/work/cosmic-text-5bfa288f19970a0b482ad75d5f460ad2c4e08900/src/buffer_line.rs:192:41:
no default font found
stack backtrace:
   0:     0x26a6681c863b - <unknown>
   1:     0x26a6681fff1c - <unknown>
   2:     0x26a6681bad0e - <unknown>
   3:     0x26a6681c8414 - <unknown>
   4:     0x26a6681afbe3 - <unknown>
   5:     0x26a6681af84f - <unknown>
   6:     0x26a6681b0e47 - <unknown>
   7:     0x26a6681c93b7 - <unknown>
   8:     0x26a6681c8846 - <unknown>
   9:     0x26a6681b0a72 - <unknown>
  10:     0x26a6682061e3 - <unknown>
  11:     0x26a6682124a3 - <unknown>
  12:     0x26a667f326ab - <unknown>
  13:     0x26a667f32758 - <unknown>
  14:     0x26a667f47667 - <unknown>
  15:     0x26a667f47e59 - <unknown>
  16:     0x26a667f473da - <unknown>
  17:     0x26a66660d0ec - <unknown>
  18:     0x26a665ffffa5 - <unknown>
  19:     0x26a66819bccb - <unknown>
  20:     0x26a66819f6f9 - <unknown>
  21:     0x26a665f247aa - <unknown>
  22:     0x26a66639cfee - <unknown>
  23:     0x26a665bd3f03 - <unknown>
  24:     0x26a665ca02d8 - <unknown>
  25:     0x26a665b92ad2 - <unknown>
  26:     0x26a665b510f9 - <unknown>
  27:     0x26a66775109f - <unknown>
  28:     0x26a6677db541 - <unknown>
  29:     0x26a667760e2e - <unknown>
  30:     0x26a665bb8f18 - <unknown>
  31:     0x26a665b2b7b3 - <unknown>
  32:     0x26a665b2b7c9 - <unknown>
  33:     0x26a6681afd57 - <unknown>
  34:     0x26a6681bf5bb - <unknown>
  35:     0x26a665b2b825 - <unknown>
  36:     0x26ae8da5be5a - __libc_start1
                               at /usr/src/lib/libc/csu/libc_start1.c:157:7
  37:     0x26a665b2b72d - <unknown>
---
Comment 4 Nuno Teixeira freebsd_committer freebsd_triage 2023-12-24 19:00:31 UTC
Created attachment 247229 [details]
Update to 0.3.1

- no lto
- no strip binaries
Comment 5 Nuno Teixeira freebsd_committer freebsd_triage 2023-12-24 19:01:59 UTC
Almost there:

"There is nothing that needs to be done in fontdb, you need to have some kind of fonts installed on your system. If you use fontconfig, it will deal with that, if you don't then paths like below should contain fonts

                self.load_fonts_dir("/usr/share/fonts/");
                self.load_fonts_dir("/usr/local/share/fonts/");

my guess is that you don't have any fonts installed that would suffice for lapce"

https://github.com/lapce/lapce/issues/2748#issuecomment-1868571818
Comment 6 Mikael Urankar freebsd_committer freebsd_triage 2023-12-30 19:21:53 UTC
any update on this issue?
Comment 7 Nuno Teixeira freebsd_committer freebsd_triage 2023-12-30 19:32:37 UTC
(In reply to Mikael Urankar from comment #6)

Still trying on https://github.com/RazrFalcon/fontdb/issues/61

Some chat about it on matrix too.
Comment 8 Nuno Teixeira freebsd_committer freebsd_triage 2023-12-31 09:29:26 UTC
cosmic-text needs to be patched because 'freebsd' target isn't listed there.
Because of it, it uses 'other.rs' instead of 'unix.rs'.

Temporary patch.
I will now see if fondb still needs to be patched to "/usr/local/etc/fonts/fonts.conf" or if it manage to find it auto.

--- ../cosmic-text-f7a20704d6ebbe8fb82d0bb579c37c53e7ae9747/src/font/fallback/mod.rs.orig       2023-12-31 09:09:22.570192000 +0000
+++ ../cosmic-text-f7a20704d6ebbe8fb82d0bb579c37c53e7ae9747/src/font/fallback/mod.rs    2023-12-31 09:09:48.358365000 +0000
@@ -11,7 +11,7 @@
 use self::platform::*;

 #[cfg(not(any(target_os = "linux", target_os = "macos", target_os = "windows",)))]
-#[path = "other.rs"]
+#[path = "unix.rs"]
 mod platform;

 #[cfg(target_os = "macos")]
Comment 9 Nuno Teixeira freebsd_committer freebsd_triage 2023-12-31 09:40:35 UTC
(In reply to Nuno Teixeira from comment #8)
> I will now see if fondb still needs to be patched to "/usr/local/etc/font
> /fonts.conf" or if it manage to find it auto.

Yes, it does to be patched.
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-12-31 14:01:31 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=11534112ba321c85131d1e3127faca0d50959d0a

commit 11534112ba321c85131d1e3127faca0d50959d0a
Author:     Nuno Teixeira <eduardo@FreeBSD.org>
AuthorDate: 2023-12-31 13:58:53 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2023-12-31 14:01:03 +0000

    editors/lapce: Update to 0.3.1

    ChangeLog:      https://github.com/lapce/lapce/blob/master/CHANGELOG.md
    PR:             274852

 editors/lapce/Makefile                             |   30 +-
 editors/lapce/Makefile.crates                      |  814 +++++-----
 editors/lapce/distinfo                             | 1634 +++++++++++---------
 editors/lapce/files/patch-Cargo.lock (new)         |   28 +
 ...tch-cargo-crates_fontdb-0.16.0_src_lib.rs (new) |   13 +
 ...nterprocess-1.1.1_src_os_unix_imports.rs (gone) |   23 -
 ...ocess-1.1.1_src_os_unix_local__socket.rs (gone) |   18 -
 ...interprocess-1.1.1_src_os_unix_signal.rs (gone) |   15 -
 ...terprocess-1.1.1_src_os_unix_udsocket.rs (gone) |  141 --
 ...h-cargo-crates_wasmtime-1.0.2_Cargo.toml (gone) |   10 -
 ...e-runtime-1.0.2_src_traphandlers_unix.rs (gone) |   15 -
 editors/lapce/files/patch-cosmic (new)             |   11 +
 editors/lapce/files/patch-lapce-proxy_Cargo.toml   |   21 +-
 13 files changed, 1422 insertions(+), 1351 deletions(-)
Comment 11 Nuno Teixeira freebsd_committer freebsd_triage 2023-12-31 14:03:09 UTC
Committed, thanks.