public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
From: Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>
To: The list for a Better Approach To Mobile Ad-hoc Networking
	<b.a.t.m.a.n@open-mesh.net>
Subject: Re: [B.A.T.M.A.N.] Batman gateway lock ups
Date: Tue, 9 Sep 2008 13:26:47 +0200	[thread overview]
Message-ID: <20080909112647.GA747@pandem0nium> (raw)
In-Reply-To: <200809082318.54082.sven.eckelmann@gmx.de>

[-- Attachment #1: Type: text/plain, Size: 2826 bytes --]

Hey Sven,

thanks for you analysis!!

On Mon, Sep 08, 2008 at 11:18:42PM +0200, Sven Eckelmann wrote:
> Ok, I got the /proc/modules file now. Current situation is following: it 
> crashes inside the the batman module add position 0x00000aa4
> 
>     a60:	3c020000 	lui	v0,0x0
>      a64:	8c500024 	lw	s0,36(v0)
>      a68:	24420024 	addiu	v0,v0,36
>      a6c:	12020014 	beq	s0,v0,ac0 <cleanup_module+0x610>
>      a70:	3c040000 	lui	a0,0x0
>      a74:	3c050000 	lui	a1,0x0
>      a78:	3c020000 	lui	v0,0x0
>      a7c:	24840000 	addiu	a0,a0,0
>      a80:	24a50088 	addiu	a1,a1,136
>      a84:	24420000 	addiu	v0,v0,0
>      a88:	0040f809 	jalr	v0
>      a8c:	24060283 	li	a2,643
>      a90:	8e040004 	lw	a0,4(s0)
>      a94:	8e030000 	lw	v1,0(s0)
>      a98:	3c020010 	lui	v0,0x10
>      a9c:	34420100 	ori	v0,v0,0x100
>      aa0:	8e110008 	lw	s1,8(s0)
>      aa4:	ac830000 	sw	v1,0(a0)
>      aa8:	ae020000 	sw	v0,0(s0)
>      aac:	3c020020 	lui	v0,0x20
>      ab0:	34420200 	ori	v0,v0,0x200
>      ab4:	ac640004 	sw	a0,4(v1)
> 
> This is part of the compiled version of packet_recv_thread. Due the 
> optimizations done I cannot say were exactly the problem lies.
> 
> I think the code of get_ip_addr() got inlined in packet_recv_thread and we 
> need to search for the crash inside of it at list_del(&entry->list);
> I would also say that the really crash is inside __list_del where prev and 
> next will be set. To check it, look at LIST_POISON1 and LIST_POISON1 inside of 
> poison.h of the current linux kernel. You will notice that the values are 
> 0x00100100 and 0x00200200 == address of the failed paging request. The list 
> poison stuff will be done in in list_del after calling __list_del (it is the 
> sequence lui, ori, sw in the asm snipped). So could it be that we have a 
> poisened entry inside the list?
> This could for example happen when we get scheduled (please notice that the 
> optimizer exchanged many instrictions) while another part of the program is 
> deleting entries. I haven't checked the rest of the code if that really could 
> happen, but that is my current idea.

Mhm, as far as i looked into the issue, there are the following 
points where free_client_list is accessed:

init_module() - INIT_LIST_HEAD()
* called on startup

get_ip_addr() - list_del():
* "secured" with a hash_lock spinlock

cleanup_module() - list_del():
* only called when unloading the module

batgat_ioctl() - list_del()
* from IOCREMDEV. This is called when batman shuts down.

packet_recv_thread - list_add():
* also secured in a hash_lock spinlock.

So it seems there should be no concurrency without user interaction 
(module or batman shutdown).
But i don't have a good idea yet where the problem comes from  ... :/

best regards,
	Simon

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2008-09-09 11:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-05 15:01 [B.A.T.M.A.N.] Batman gateway lock ups Outback Dingo
2008-09-08  7:08 ` Sven Eckelmann
2008-09-08 21:18 ` Sven Eckelmann
2008-09-08 21:45   ` Sven Eckelmann
2008-09-09  8:03     ` Sven Eckelmann
2008-09-09 11:26   ` Simon Wunderlich [this message]
2008-09-09 22:45     ` Sven Eckelmann
2008-09-10  9:50       ` Sven Eckelmann
2009-07-21 20:48 ` Simon Wunderlich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080909112647.GA747@pandem0nium \
    --to=simon.wunderlich@s2003.tu-chemnitz.de \
    --cc=b.a.t.m.a.n@open-mesh.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox