Bug 292228 - netstat --libxo segfaults
Summary: netstat --libxo segfaults
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 15.0-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: Alan Somers
URL: https://reviews.freebsd.org/D54567
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-06 21:41 UTC by Alan Somers
Modified: 2026-01-20 22:32 UTC (History)
0 users

See Also:
asomers: mfc-stable15+
asomers: mfc-stable14+
asomers: mfc-stable13-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer freebsd_triage 2026-01-06 21:41:28 UTC
The command "netstat -4nc -p tcp --libxo=xml" segfaults on some systems.  I've seen it segfault on 16.0-CURRENT and 15.0-RELEASE-p1, but pass on 15.0-BETA3 and 14.3-RELEASE-pXX.  And yet it works in Cirrus CI.  I need to investigate more to find the root cause.

> netstat -4nc -p tcp --libxo=xml
<statistics>fish: Job 1, 'netstat -4nc -p tcp --libxo=xml' terminated by signal SIGSEGV (Address boundary error)
Comment 1 commit-hook freebsd_committer freebsd_triage 2026-01-07 14:35:44 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=3b6615ec0332f901fcc9e9307f78717424f09c1e

commit 3b6615ec0332f901fcc9e9307f78717424f09c1e
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2026-01-06 22:19:57 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2026-01-07 14:35:13 +0000

    netstat: fix a segfault with --libxo

    Fix a segfault when printing the "protocol" field.  The field-format and
    encoding-format were expecting different numbers of arguments.

    Also, fix the width of the tcp-state field in encoded output.

    PR:             292228
    Fixes:          c2b08c13c20 netstat: add support for UDP-Lite endpoints
    MFC after:      1 week
    Sponsored by:   ConnectWise
    Reviewed by:    tuexen, js, des
    Differential Revision: https://reviews.freebsd.org/D54567

 usr.bin/netstat/inet.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
Comment 2 commit-hook freebsd_committer freebsd_triage 2026-01-20 17:16:36 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=b3647e2a408e8a0246ec2240a152f8c41c3482cb

commit b3647e2a408e8a0246ec2240a152f8c41c3482cb
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2026-01-06 22:19:57 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2026-01-20 17:15:13 +0000

    netstat: fix a segfault with --libxo

    Fix a segfault when printing the "protocol" field.  The field-format and
    encoding-format were expecting different numbers of arguments.

    Also, fix the width of the tcp-state field in encoded output.

    PR:             292228
    Fixes:          c2b08c13c20 netstat: add support for UDP-Lite endpoints
    Sponsored by:   ConnectWise
    Reviewed by:    tuexen, js, des
    Differential Revision: https://reviews.freebsd.org/D54567

    (cherry picked from commit 3b6615ec0332f901fcc9e9307f78717424f09c1e)

 usr.bin/netstat/inet.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2026-01-20 22:32:17 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=1ad466ca83852694d7ecee441dc94faf61c27bd4

commit 1ad466ca83852694d7ecee441dc94faf61c27bd4
Author:     Alan Somers <asomers@FreeBSD.org>
AuthorDate: 2026-01-06 22:19:57 +0000
Commit:     Alan Somers <asomers@FreeBSD.org>
CommitDate: 2026-01-20 22:31:30 +0000

    netstat: fix a segfault with --libxo

    Fix a segfault when printing the "protocol" field.  The field-format and
    encoding-format were expecting different numbers of arguments.

    Also, fix the width of the tcp-state field in encoded output.

    PR:             292228
    Fixes:          c2b08c13c20 netstat: add support for UDP-Lite endpoints
    Sponsored by:   ConnectWise
    Reviewed by:    tuexen, js, des
    Differential Revision: https://reviews.freebsd.org/D54567

    (cherry picked from commit 3b6615ec0332f901fcc9e9307f78717424f09c1e)

 usr.bin/netstat/inet.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)