Bug 262863 - www/amfora: post-install hint on how to resolve crash on startup if TERM not recognized [#300]
Summary: www/amfora: post-install hint on how to resolve crash on startup if TERM not ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Lewis Cook
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-27 14:20 UTC by Alex Savage
Modified: 2022-04-05 22:15 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (lcook)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Savage 2022-03-27 14:20:08 UTC
A Go dependency compiled into amfora will crash at startup when it doesn’t recognize the terminal type declared in TERM. Investigated with amfora’s author, and reported to the upstream dependencies. (See https://github.com/makeworld-the-better-one/amfora/issues/300 and mentions there.)

In my case specifically for running under tmux, installing the ncurses port resolved the crash. This has to do with missing terminfo data, though installing the terminfo-db port alone did not help.

Steps to reproduce:
1. On a clean FreeBSD 13.0-RELEASE system, install amfora and tmux from ports or pkg
2. Run tmux, or export TERM=tmux-256color
3. Run amfora

Expected results:
Amfora starts

Actual results:
Go runtime crashes and prints a stack trace

Suggested workaround: Call out that additional data from ncurses may be needed in a post-install message; or, add ncurses as a dependency to cover any terminfo that may not be bundled as expected.

My system: 13.0-RELEASE-p6 FreeBSD 13.0-RELEASE-p6 #0: Mon Jan 10 06:33:27 UTC 2022     root@arm64-builder.daemonology.net:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC  arm64

% amfora -v
Amfora v1.9.2
Commit: 61d8645
Built by: unknown
Comment 1 commit-hook freebsd_committer freebsd_triage 2022-04-05 22:09:46 UTC
A commit in branch main references this bug:

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

commit f204688efbf27343f71126c021b3a7bd5c370959
Author:     Lewis Cook <lcook@FreeBSD.org>
AuthorDate: 2022-04-05 20:59:45 +0000
Commit:     Lewis Cook <lcook@FreeBSD.org>
CommitDate: 2022-04-05 21:08:17 +0000

    www/amfora: Resolve crash on startup if TERM not recognized

    PR:             262863
    Reported by:    Alex Savage <keen.year0891@fastmail.com>
    MFH:            2022Q2

 www/amfora/Makefile                                |  2 +-
 ..._gdamore_tcell_v2_terminfo_t_tmux_term.go (new) | 68 ++++++++++++++++++++++
 2 files changed, 69 insertions(+), 1 deletion(-)
Comment 2 Lewis Cook freebsd_committer freebsd_triage 2022-04-05 22:15:30 UTC
Thanks for the report, Alex.

I've applied an upstream fix[1] in regards to `TERM=tmux-256color` crashing amfora and will back-port to the 2022Q2 branch.  Should you have any further issues, please re-open the issue.

Cheers.

[1] https://github.com/gdamore/tcell/commit/d699c7e5101acf73122e221616de4962d4be3b8e
Comment 3 commit-hook freebsd_committer freebsd_triage 2022-04-05 22:15:48 UTC
A commit in branch 2022Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=32d6a340fb983b5197dc362b014451a44f464b55

commit 32d6a340fb983b5197dc362b014451a44f464b55
Author:     Lewis Cook <lcook@FreeBSD.org>
AuthorDate: 2022-04-05 20:59:45 +0000
Commit:     Lewis Cook <lcook@FreeBSD.org>
CommitDate: 2022-04-05 21:13:31 +0000

    www/amfora: Resolve crash on startup if TERM not recognized

    PR:             262863
    Reported by:    Alex Savage <keen.year0891@fastmail.com>
    MFH:            2022Q2

    (cherry picked from commit f204688efbf27343f71126c021b3a7bd5c370959)

 www/amfora/Makefile                                |  2 +-
 ..._gdamore_tcell_v2_terminfo_t_tmux_term.go (new) | 68 ++++++++++++++++++++++
 2 files changed, 69 insertions(+), 1 deletion(-)