Re: Mbuf double-free guilty party detection patch

From: Thierry Herbelot <thierry_at_herbelot.com>
Date: Sun, 26 Jun 2005 11:30:58 +0200
I wrote too soon :

"better" error messages :
This memory last freed by: c0663782
Memory modified after free 0xc20a9500(256) val=0 _at_ 0xc20a9540
This memory last freed by: c0663782
Memory modified after free 0xc20a9500(256) val=3 _at_ 0xc20a9544
This memory last freed by: c066a3b0
Memory modified after free 0xc20a9400(256) val=0 _at_ 0xc20a9400
This memory last freed by: c066a3b0
Memory modified after free 0xc20a9400(256) val=0 _at_ 0xc20a9404
This memory last freed by: c066a3b0

(these are the only two meaningful addresses in the log)

multi-cur# addr2line -e /usr/src/sys/i386/compile/GENERIC/kernel.debug 
0xc0663782
../../../kern/uipc_mbuf.c:167

which is :
    158 /*
    159  * Free an entire chain of mbufs and associated external buffers, if
    160  * applicable.
    161  */
    162 void
    163 m_freem(struct mbuf *mb)
    164 {
    165
    166         while (mb != NULL)
    167                 mb = m_free(mb);
    168 }

multi-cur# addr2line -e /usr/src/sys/i386/compile/GENERIC/kernel.debug 
0xc066a3b0
../../../kern/uipc_socket2.c:1158

which is :
   1147                 if (m->m_len > len) {
   1148                         m->m_len -= len;
   1149                         m->m_data += len;
   1150                         sb->sb_cc -= len;
   1151                         if (m->m_type != MT_DATA && m->m_type != 
MT_HEADER &&
   1152                             m->m_type != MT_OOBDATA)
   1153                                 sb->sb_ctl -= len;
   1154                         break;
   1155                 }
   1156                 len -= m->m_len;
   1157                 sbfree(sb, m);
   1158                 m = m_free(m);

the test case is : building the kernel while tar-ing the src tree over two 
separate ssh session.

	TfH
Received on Sun Jun 26 2005 - 07:31:10 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:37 UTC