Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Apr 2009 09:57:13 +0200
From:      "Blapp, Martin" <Martin.Blapp@t-systems.ch>
To:        "freebsd-stable@freebsd.org" <freebsd-stable@freebsd.org>
Subject:   AW: FreeBSD 7.2-BETA1 tcp retransmit crash
Message-ID:  <509A7CA1EA3EA046B1A5BA2FCFDB3C8EC764853902@TSS-EXCH01.t-systems.ch>
In-Reply-To: <20090405180621.F15361@maildrop.int.zabbadoz.net>
References:  <509A7CA1EA3EA046B1A5BA2FCFDB3C8EC764853900@TSS-EXCH01.t-systems.ch> <20090405163705.U15361@maildrop.int.zabbadoz.net>, <20090405180621.F15361@maildrop.int.zabbadoz.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

(kgdb) frame 7
#7  0xc07c6cb0 in sbsndptr (sb=3D0xc342ede4, off=3D112, len=3D113, moff=3D0=
xc2f9ca04) at /usr/src/sys/kern/uipc_sockbuf.c:939

This is also interesting. Is this an OffByOne somewhere ?

As I said it's just a workaround, and for now it didn't crash anymore :-)

I could modify this patch to see what happens exactly, dumpping the mbuf.
The workaround I currently use is just skipping and dropping this mbuf:

--- sys/kern/uipc_sockbuf.c.orig        2009-04-05 18:01:35.000000000 +0200
+++ sys/kern/uipc_sockbuf.c     2009-04-05 18:01:46.000000000 +0200
@@ -930,6 +930,13 @@
                return (sb->sb_mb);
        }

+       /*
+        * Try to avoid some retransmit panics
+        */
+       if (sb->sb_sndptr =3D=3D NULL && sb->sb_mb =3D=3D NULL) {
+               return (NULL);
+       }
+
        /* Return closest mbuf in chain for current offset. */
        *moff =3D off - sb->sb_sndptroff;
        m =3D ret =3D sb->sb_sndptr ? sb->sb_sndptr : sb->sb_mb;
--- sys/netinet/tcp_output.c.orig       2009-04-05 18:01:29.000000000 +0200
+++ sys/netinet/tcp_output.c    2009-04-05 18:04:17.000000000 +0200
@@ -797,6 +797,17 @@
                 */
                mb =3D sbsndptr(&so->so_snd, off, len, &moff);

+
+               /*
+                * Avoid panics. Mask the error with ENETDOWN
+                */
+               if (mb =3D=3D NULL) {
+                       SOCKBUF_UNLOCK(&so->so_snd);
+                       (void) m_free(m);
+                       error =3D ENETDOWN;
+                       goto out;
+               }
+
                if (len <=3D MHLEN - hdrlen - max_linkhdr) {
                        m_copydata(mb, moff, (int)len,
                            mtod(m, caddr_t) + hdrlen);





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?509A7CA1EA3EA046B1A5BA2FCFDB3C8EC764853902>