Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jul 2024 23:04:08 +0000
From:      bugzilla-noreply@freebsd.org
To:        net@FreeBSD.org
Subject:   [Bug 279875] sockstat: segmentation fault
Message-ID:  <bug-279875-7501-qwYBDpu1J5@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-279875-7501@https.bugs.freebsd.org/bugzilla/>
References:  <bug-279875-7501@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D279875

--- Comment #5 from Konstantin Belousov <kib@FreeBSD.org> ---
Do you have set something that prevents visibility of processes/jails?
Like see_other_uids etc?

Anyway, please apply this debugging patch and report if the program still
SIGSEGVs with it.

diff --git a/usr.bin/sockstat/sockstat.c b/usr.bin/sockstat/sockstat.c
index 73b1f00a4481..20a0a5e65e0a 100644
--- a/usr.bin/sockstat/sockstat.c
+++ b/usr.bin/sockstat/sockstat.c
@@ -1164,6 +1164,7 @@ displaysock(struct sock *s, int pos)
                                        f =3D RB_FIND(files_t, &ftree,
                                            &(struct file){ .xf_data =3D
                                            p->socket });
+                                       if (f !=3D NULL)
                                        pos +=3D xprintf("[%lu %d]",
                                            (u_long)f->xf_pid, f->xf_fd);
                                } else
@@ -1183,6 +1184,7 @@ displaysock(struct sock *s, int pos)
                                        f =3D RB_FIND(files_t, &ftree,
                                            &(struct file){ .xf_data =3D
                                            p->socket });
+                                       if (f !=3D NULL);
                                        pos +=3D xprintf("%s[%lu %d]",
                                            fref ? "" : ",",
                                            (u_long)f->xf_pid, f->xf_fd);

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-279875-7501-qwYBDpu1J5>