Bug 264669 - sysutils/wmmemload: fails with stack overflow after build with stack-protector-strong
Summary: sysutils/wmmemload: fails with stack overflow after build with stack-protecto...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: Zsolt Udvari
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-14 13:57 UTC by Arie Bikker
Modified: 2024-10-09 17:31 UTC (History)
2 users (show)

See Also:
mbeis: maintainer-feedback+


Attachments
Patch arraysize receiving argument sysctl (557 bytes, patch)
2022-06-14 13:57 UTC, Arie Bikker
no flags Details | Diff
sysutils/wmmemload: fix aborting at start (492 bytes, patch)
2024-03-10 14:14 UTC, Marco Beishuizen
mbeis: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!