Subject: Re: NetBSD/xen network problems (need help)
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Andreas Wrede <andreas@planix.com>
List: port-xen
Date: 03/14/2006 16:38:14
On 13-Mar-06, at 5:50 PM, Manuel Bouyer wrote:

> On Mon, Mar 13, 2006 at 05:01:00PM -0500, Andreas Wrede wrote:
>>
>> On 13-Mar-06, at 3:45 PM, Manuel Bouyer wrote:
>>>>
>>>> panic: m_makewritable: length changed
>>>
>>> Not that I know. But AFAIK it's not an issue with m_makewritable 
>>> () or
>>> m_copyback0(), not in Xen itself (it just happens that Xen can
>>> triggers
>>> it). Can you add some debug checks in m_copyback0() and
>>> m_makewritable()
>>> to see what's really happening here ?
>>
>> I'll try but that's somewhat over my head, some guidance would be
>> appreciated. The panic occurs regularly during a nightly backup-run
>> but so far, I cannot produce it at will yet.
>
> The first thing I would do is print the new mbuf chain in  
> m_makewritable.
> We have:
>         for (n = *mp; n; n = n->m_next)
> 		reslen += n->m_len;
> 	if (origlen != reslen)
> 		panic("m_makewritable: length changed");
>
> I would change it to:
>         for (n = *mp; n; n = n->m_next)
> 		reslen += n->m_len;
> 	if (origlen != reslen) {
> 		for (n = *mp; n; n = n->m_next)
> 			printf("mbuf len %d type %d flags %d\n",
> 			    n->m_next, n->m_type, n->m_flags);
> 		printf("m_makewritable origlen %d newlen %d\n",
> 		    origlen, reslen);
> 		panic("m_makewritable: length changed");
> 	}
>
> -- 
> Manuel Bouyer <bouyer@antioche.eu.org>
>      NetBSD: 26 ans d'experience feront toujours la difference
> --
>

I can now produce the panic most of the time by running rdiff-backup.  
It's interesting to note that these panics started after the machine  
(my development box) was converted to xen. This was done by adding a  
hard disk, booting xen0 from it and configuring the "old" machine as  
a xenU domain. The old configuration is unaltered, with both hard  
disks mapped one-to-one to the guest domain. Only difference (from  
the xenU guest) is that it is running with 595 Mb of memory instead  
of 1024. The same backup that triggers the panic under xen every  
night has been running for months on the native machine without  
problems.

mbuf len 186 type 1 flags 0x0402
m_makewritable origlen 52 newlen 186 error 0
panic: m_makewritable: length changed

and another one with YAMAMOTO Takashi's m_print:

MBUF 0xc14d6500
   data=0xc14d654a, len=182, type=1, flags=0x202<PKTHDR,MCASE>
   owner=0x46205353, next=0x0, nextpkt=0x0
   leadingspace=18, trailingspace=0, readonly=0
   pktlen=182, rcvif=0xc12ba000, csum_flags=0x0, csum_data=0x0,  
segsz=1397050953
m_makewritable origlen 112 newlen 182 error 0
panic: m_makewritable: length changed

(error 0 is the value returned from the call to m_copyback0)


-- 
     aew