Bug 264669

Summary: sysutils/wmmemload: fails with stack overflow after build with stack-protector-strong
Product: Ports & Packages Reporter: Arie Bikker <src-2016>
Component: Individual Port(s)Assignee: Zsolt Udvari <uzsolt>
Status: Closed FIXED    
Severity: Affects Many People CC: mbeis, uzsolt
Priority: --- Flags: mbeis: maintainer-feedback+
Version: Latest   
Hardware: amd64   
OS: Any   
Attachments:
Description Flags
Patch arraysize receiving argument sysctl
none
sysutils/wmmemload: fix aborting at start mbeis: maintainer-approval+

Description Arie Bikker 2022-06-14 13:57:13 UTC
Created attachment 234678 [details]
Patch arraysize receiving argument sysctl

both binary package and ports compiled version fail

$ wmmemload
Abort

leaving line in /var/log/messages:

Jun 14 15:35:33 azd wmmemload[55487]: stack overflow detected; terminated
Jun 14 15:35:33 azd kernel: pid 55487 (wmmemload), jid 0, uid 1001: exited on signal 6

Problem seems to be fixed size of mib array in src/mem_freebsd.c
For descendants of "vm.swap_info" array size should be 3
Comment 1 Marco Beishuizen 2024-03-10 14:14:48 UTC
Created attachment 249074 [details]
sysutils/wmmemload: fix aborting at start
Comment 2 Marco Beishuizen 2024-03-10 14:18:01 UTC
The patch from Arie didn't build with the "char mib_base = "vm.swap_info";" line in it so removed that and left the increase from 2 > 3 of "int mib[]"
Comment 3 Zsolt Udvari freebsd_committer freebsd_triage 2024-04-27 18:24:15 UTC
Could you please create a patch on the ports tree?
See https://docs.freebsd.org/en/books/porters-handbook/book/#slow-patch
Comment 4 Zsolt Udvari freebsd_committer freebsd_triage 2024-09-21 17:20:41 UTC
Friendly ping.
Comment 5 Marco Beishuizen 2024-09-22 17:04:22 UTC
See attachments above for the patch.
Comment 6 Zsolt Udvari freebsd_committer freebsd_triage 2024-09-22 17:52:54 UTC
Marco, which path(es) should apply? Could you please create a patch against ports tree? See https://docs.freebsd.org/en/books/porters-handbook/book/#slow-patch
Thanks!
Comment 7 Marco Beishuizen 2024-10-09 16:19:59 UTC
The patch I attached needs to be applied. I have trouble giving the patch the correct name, now it doesn't apply.
Comment 8 commit-hook freebsd_committer freebsd_triage 2024-10-09 17:30:00 UTC
A commit in branch main references this bug:

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

commit d357e43d0927dc1d85870cfea1473f4fd4b17e81
Author:     Marco Beishuizen <mbeis@xs4all.nl>
AuthorDate: 2024-10-09 17:26:58 +0000
Commit:     Zsolt Udvari <uzsolt@FreeBSD.org>
CommitDate: 2024-10-09 17:29:02 +0000

    sysutils/wmmemload: Fix stack overflow error

    Add x11 and xext to USE_XORG.
    Add LICENSE_FILE.
    Switch to DISTVERSION.

    PR:             264669
    Reported by:    Arie Bikker <src-2016@bikker.homeunix.net>
    Approved by:    submitter is maintainer

 sysutils/wmmemload/Makefile                       | 11 ++++++-----
 sysutils/wmmemload/files/patch-src_mem__freebsd.c |  9 +++++++++
 2 files changed, 15 insertions(+), 5 deletions(-)
Comment 9 Zsolt Udvari freebsd_committer freebsd_triage 2024-10-09 17:31:30 UTC
Committed, thanks!