Bug 273277 - sysutils/ncdu2: crashes on start unless built WITH_DEBUG=
Summary: sysutils/ncdu2: crashes on start unless built WITH_DEBUG=
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: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-22 05:50 UTC by Jan Beich
Modified: 2023-09-04 14:02 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2023-08-22 05:50:34 UTC
Zig doesn't support strip(1) until bug 258872. Instead one can use llvm-strip(1) or builtin strip via build.zig e.g., ports 1406a61cc813.

$ ncdu2
pid 12345 comm ncdu2 has trashed its stack, killing
Illegal instruction
Comment 1 Po-Chuan Hsieh freebsd_committer freebsd_triage 2023-09-01 16:25:35 UTC
I've confirmed that it works fine on 12.4 but not on 13.2. I'll use llvm-strip instead. Thanks.
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-09-04 09:10:57 UTC
A commit in branch main references this bug:

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

commit e09856245353723cad581eaabb653a4c97d35460
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-09-04 09:07:32 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-09-04 09:08:04 +0000

    sysutils/ncdu2: Use llvm-strip instead of strip

    - Bump PORTREVISION for package change

    PR:             273277
    Reported by:    jbeich

 sysutils/ncdu2/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 3 Po-Chuan Hsieh freebsd_committer freebsd_triage 2023-09-04 09:21:45 UTC
Committed. Thanks!
Comment 4 Benjamin Takacs 2023-09-04 12:17:10 UTC
(In reply to commit-hook from comment #2)

With this commit ncdu2 will now get unconditionally stripped, which shouldn't happen, for example when setting WITH_DEBUG (see https://docs.freebsd.org/en/books/porters-handbook/makefiles/#install-strip).

So that is at most a partial fix.

Additionally it seems like zig supports a ´--strip´ commandline flag which should result in a stripped binary being build, so using that should be investigated.
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-09-04 13:17:39 UTC
A commit in branch main references this bug:

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

commit 1189ae1e7a82f7d3b06a7d9305630e38f38ab2b2
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-09-04 13:16:29 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-09-04 13:16:48 +0000

    sysutils/ncdu2: Add WITH_DEBUG check

    PR:             273277
    Reported by:    Benjamin Takacs <nimaje+fbz@bureaucracy.de>

 sysutils/ncdu2/Makefile | 2 ++
 1 file changed, 2 insertions(+)
Comment 6 Po-Chuan Hsieh freebsd_committer freebsd_triage 2023-09-04 14:02:12 UTC
(In reply to Benjamin Takacs from comment #4)

I've tried adding --strip but zig 0.10.1 says "Unrecognized argument: --strip". I did not find the official documentation for --strip.