public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Oops in kthread
@ 2006-05-20 12:37 Liu haixiang
  2006-05-20 13:25 ` Balbir Singh
  2006-05-20 13:44 ` Arjan van de Ven
  0 siblings, 2 replies; 6+ messages in thread
From: Liu haixiang @ 2006-05-20 12:37 UTC (permalink / raw)
  To: linux-kernel

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

Hi All,

Today I debug one kernel thread created by kthread_run. And after
several hours run, there is one Oops coming from kthread. Please see
below mesage:
====================
Unable to handle kernel NULL pointer dereference at virtual address 00000000
pc = 00000000
*pde = 00000000
Oops: 0000 [#1]

Pid : 261, Comm:      CallbackManager
PC is at 0x0
PC  : 00000000 SP  : 869bbf8c SR  : 40008100 TEA : c016db88    Tainted: P
R0  : 00000000 R1  : 00000000 R2  : 005770c5 R3  : 40008101
R4  : 8b000006 R5  : 00000003 R6  : 07b1ce60 R7  : 00000079
R8  : c01c0800 R9  : 07b1ce60 R10 : 00000003 R11 : 00000000
R12 : 0000004c R13 : 00000000 R14 : 00000079
MACH: 0000025c MACL: 000001c8 GBR : 00000000 PR  : c01b514a

Call trace:
[<8442d184>] kthread+0xe4/0x140
[<c01b4f80>] CallbackManager+0x0/0x2c0 [fdma]
[<8440f4c0>] complete+0x0/0xc0
[<8442d080>] kthread_should_stop+0x0/0x20
[<84403004>] kernel_thread_helper+0x4/0x20

Then I do objdump the kernel/kthread.c. Please see attached dumped
contents. And find the offset 0xe4. The assembly line code is:
e4:	08 20       	tst	r0,r0

Does anybody can explain to me which C code in kthread create this
Oops?Is there any easy way to translate assembly code to C?

best regards

Liu haixiang

[-- Attachment #2: kthread-objdump.txt --]
[-- Type: text/plain, Size: 20282 bytes --]


kthread.o:     file format elf32-sh-linux

Disassembly of section .text:

00000000 <kthread_should_stop>:
   0:	f2 01       	stc	r7_bank,r1
   2:	12 62       	mov.l	@r1,r2
   4:	02 d1       	mov.l	10 <kthread_should_stop+0x10>,r1	! 0x4
   6:	12 61       	mov.l	@r1,r1
   8:	20 31       	cmp/eq	r2,r1
   a:	0b 00       	rts	
   c:	29 00       	movt	r0
   e:	09 00       	nop	
  10:	04 00       	mov.b	r0,@(r0,r0)
  12:	00 00       	.word 0x0000
  14:	09 00       	nop	
  16:	09 00       	nop	
  18:	09 00       	nop	
  1a:	09 00       	nop	
  1c:	09 00       	nop	
  1e:	09 00       	nop	

00000020 <kthread>:
  20:	86 2f       	mov.l	r8,@-r15
  22:	fc e1       	mov	#-4,r1
  24:	96 2f       	mov.l	r9,@-r15
  26:	a6 2f       	mov.l	r10,@-r15
  28:	b6 2f       	mov.l	r11,@-r15
  2a:	43 6b       	mov	r4,r11
  2c:	c6 2f       	mov.l	r12,@-r15
  2e:	d6 2f       	mov.l	r13,@-r15
  30:	e6 2f       	mov.l	r14,@-r15
  32:	22 4f       	sts.l	pr,@-r15
  34:	f2 09       	stc	r7_bank,r9
  36:	f4 7f       	add	#-12,r15
  38:	78 9d       	mov.w	12c <kthread+0x10c>,r13	! 0x23c
  3a:	12 1f       	mov.l	r1,@(8,r15)
  3c:	3d d1       	mov.l	134 <kthread+0x114>,r1	! 0x0 <kthread_should_stop>
  3e:	92 68       	mov.l	@r9,r8
  40:	83 64       	mov	r8,r4
  42:	0b 41       	jsr	@r1
  44:	83 6a       	mov	r8,r10
  46:	3c de       	mov.l	138 <kthread+0x118>,r14	! 0x23c
  48:	dc 3a       	add	r13,r10
  4a:	eb 52       	mov.l	@(44,r14),r2
  4c:	2b 1a       	mov.l	r2,@(44,r10)
  4e:	02 01       	stc	sr,r1
  50:	13 60       	mov	r1,r0
  52:	f0 cb       	or	#-16,r0
  54:	0e 40       	ldc	r0,sr
  56:	13 60       	mov	r1,r0
  58:	f0 c9       	and	#-16,r0
  5a:	68 9c       	mov.w	12e <kthread+0x10e>,r12	! 0xf0
  5c:	f0 c9       	and	#-16,r0
  5e:	22 61       	mov.l	@r2,r1
  60:	c0 30       	cmp/eq	r12,r0
  62:	01 71       	add	#1,r1
  64:	06 8d       	bt.s	74 <kthread+0x54>
  66:	12 22       	mov.l	r1,@r2
  68:	62 91       	mov.w	130 <kthread+0x110>,r1	! 0xff0f
  6a:	02 02       	stc	sr,r2
  6c:	19 22       	and	r1,r2
  6e:	e2 01       	stc	r6_bank,r1
  70:	1b 22       	or	r1,r2
  72:	0e 42       	ldc	r2,sr
  74:	31 d1       	mov.l	13c <kthread+0x11c>,r1	! 0x0 <kthread_should_stop>
  76:	0b 41       	jsr	@r1
  78:	83 64       	mov	r8,r4
  7a:	92 61       	mov.l	@r9,r1
  7c:	ec 52       	mov.l	@(48,r14),r2
  7e:	dc 31       	add	r13,r1
  80:	2c 11       	mov.l	r2,@(48,r1)
  82:	ac 52       	mov.l	@(48,r10),r2
  84:	02 01       	stc	sr,r1
  86:	13 60       	mov	r1,r0
  88:	f0 cb       	or	#-16,r0
  8a:	0e 40       	ldc	r0,sr
  8c:	13 60       	mov	r1,r0
  8e:	f0 c9       	and	#-16,r0
  90:	22 61       	mov.l	@r2,r1
  92:	f0 c9       	and	#-16,r0
  94:	c0 30       	cmp/eq	r12,r0
  96:	01 71       	add	#1,r1
  98:	06 8d       	bt.s	a8 <kthread+0x88>
  9a:	12 22       	mov.l	r1,@r2
  9c:	48 91       	mov.w	130 <kthread+0x110>,r1	! 0xff0f
  9e:	02 02       	stc	sr,r2
  a0:	19 22       	and	r1,r2
  a2:	e2 01       	stc	r6_bank,r1
  a4:	1b 22       	or	r1,r2
  a6:	0e 42       	ldc	r2,sr
  a8:	25 d0       	mov.l	140 <kthread+0x120>,r0	! 0x0 <kthread_should_stop>
  aa:	ff e1       	mov	#-1,r1
  ac:	f3 65       	mov	r15,r5
  ae:	00 e6       	mov	#0,r6
  b0:	b2 6c       	mov.l	@r11,r12
  b2:	00 e4       	mov	#0,r4
  b4:	b1 5a       	mov.l	@(4,r11),r10
  b6:	11 1f       	mov.l	r1,@(4,r15)
  b8:	0b 40       	jsr	@r0
  ba:	12 2f       	mov.l	r1,@r15
  bc:	21 d1       	mov.l	144 <kthread+0x124>,r1	! 0x0 <kthread_should_stop>
  be:	22 d8       	mov.l	148 <kthread+0x128>,r8	! 0x0 <kthread_should_stop>
  c0:	0b 41       	jsr	@r1
  c2:	92 64       	mov.l	@r9,r4
  c4:	92 62       	mov.l	@r9,r2
  c6:	01 e1       	mov	#1,r1
  c8:	20 d9       	mov.l	14c <kthread+0x12c>,r9	! 0x0 <kthread_should_stop>
  ca:	b3 64       	mov	r11,r4
  cc:	12 22       	mov.l	r1,@r2
  ce:	0b 49       	jsr	@r9
  d0:	08 74       	add	#8,r4
  d2:	1f d1       	mov.l	150 <kthread+0x130>,r1	! 0x0 <kthread_should_stop>
  d4:	0b 41       	jsr	@r1
  d6:	09 00       	nop	
  d8:	0b 48       	jsr	@r8
  da:	09 00       	nop	
  dc:	08 20       	tst	r0,r0
  de:	0f 89       	bt	100 <kthread+0xe0>
  e0:	0b 48       	jsr	@r8
  e2:	09 00       	nop	
  e4:	08 20       	tst	r0,r0
  e6:	11 8b       	bf	10c <kthread+0xec>
  e8:	00 e0       	mov	#0,r0
  ea:	0c 7f       	add	#12,r15
  ec:	26 4f       	lds.l	@r15+,pr
  ee:	f6 6e       	mov.l	@r15+,r14
  f0:	f6 6d       	mov.l	@r15+,r13
  f2:	f6 6c       	mov.l	@r15+,r12
  f4:	f6 6b       	mov.l	@r15+,r11
  f6:	f6 6a       	mov.l	@r15+,r10
  f8:	f6 69       	mov.l	@r15+,r9
  fa:	0b 00       	rts	
  fc:	f6 68       	mov.l	@r15+,r8
  fe:	09 00       	nop	
 100:	0b 4c       	jsr	@r12
 102:	a3 64       	mov	r10,r4
 104:	0b 48       	jsr	@r8
 106:	02 1f       	mov.l	r0,@(8,r15)
 108:	08 20       	tst	r0,r0
 10a:	ed 89       	bt	e8 <kthread+0xc8>
 10c:	f2 51       	mov.l	@(8,r15),r1
 10e:	11 d4       	mov.l	154 <kthread+0x134>,r4	! 0x4
 110:	11 14       	mov.l	r1,@(4,r4)
 112:	0b 49       	jsr	@r9
 114:	08 74       	add	#8,r4
 116:	00 e0       	mov	#0,r0
 118:	0c 7f       	add	#12,r15
 11a:	26 4f       	lds.l	@r15+,pr
 11c:	f6 6e       	mov.l	@r15+,r14
 11e:	f6 6d       	mov.l	@r15+,r13
 120:	f6 6c       	mov.l	@r15+,r12
 122:	f6 6b       	mov.l	@r15+,r11
 124:	f6 6a       	mov.l	@r15+,r10
 126:	f6 69       	mov.l	@r15+,r9
 128:	0b 00       	rts	
 12a:	f6 68       	mov.l	@r15+,r8
 12c:	3c 02       	mov.b	@(r0,r3),r2
 12e:	f0 00       	.word 0x00f0
 130:	0f ff       	.word 0xff0f
 132:	09 00       	nop	
 134:	00 00       	.word 0x0000
 136:	00 00       	.word 0x0000
 138:	3c 02       	mov.b	@(r0,r3),r2
	...
 152:	00 00       	.word 0x0000
 154:	04 00       	mov.b	r0,@(r0,r0)
 156:	00 00       	.word 0x0000
 158:	09 00       	nop	
 15a:	09 00       	nop	
 15c:	09 00       	nop	
 15e:	09 00       	nop	

00000160 <keventd_create_kthread>:
 160:	14 d0       	mov.l	1b4 <keventd_create_kthread+0x54>,r0	! 0x0 <kthread_should_stop>
 162:	86 2f       	mov.l	r8,@-r15
 164:	96 2f       	mov.l	r9,@-r15
 166:	43 69       	mov	r4,r9
 168:	22 4f       	sts.l	pr,@-r15
 16a:	13 d4       	mov.l	1b8 <keventd_create_kthread+0x58>,r4	! 0x20 <kthread>
 16c:	20 96       	mov.w	1b0 <keventd_create_kthread+0x50>,r6	! 0x611
 16e:	0b 40       	jsr	@r0
 170:	93 65       	mov	r9,r5
 172:	11 40       	cmp/pz	r0
 174:	14 8f       	bf.s	1a0 <keventd_create_kthread+0x40>
 176:	03 68       	mov	r0,r8
 178:	10 d1       	mov.l	1bc <keventd_create_kthread+0x5c>,r1	! 0x0 <kthread_should_stop>
 17a:	93 64       	mov	r9,r4
 17c:	0b 41       	jsr	@r1
 17e:	08 74       	add	#8,r4
 180:	0f d0       	mov.l	1c0 <keventd_create_kthread+0x60>,r0	! 0x0 <kthread_should_stop>
 182:	83 65       	mov	r8,r5
 184:	0b 40       	jsr	@r0
 186:	00 e4       	mov	#0,r4
 188:	05 19       	mov.l	r0,@(20,r9)
 18a:	93 64       	mov	r9,r4
 18c:	26 4f       	lds.l	@r15+,pr
 18e:	0d d1       	mov.l	1c4 <keventd_create_kthread+0x64>,r1	! 0x0 <kthread_should_stop>
 190:	18 74       	add	#24,r4
 192:	f6 69       	mov.l	@r15+,r9
 194:	2b 41       	jmp	@r1
 196:	f6 68       	mov.l	@r15+,r8
 198:	09 00       	nop	
 19a:	09 00       	nop	
 19c:	09 00       	nop	
 19e:	09 00       	nop	
 1a0:	05 19       	mov.l	r0,@(20,r9)
 1a2:	93 64       	mov	r9,r4
 1a4:	26 4f       	lds.l	@r15+,pr
 1a6:	07 d1       	mov.l	1c4 <keventd_create_kthread+0x64>,r1	! 0x0 <kthread_should_stop>
 1a8:	18 74       	add	#24,r4
 1aa:	f6 69       	mov.l	@r15+,r9
 1ac:	2b 41       	jmp	@r1
 1ae:	f6 68       	mov.l	@r15+,r8
 1b0:	11 06       	.word 0x0611
 1b2:	09 00       	nop	
 1b4:	00 00       	.word 0x0000
 1b6:	00 00       	.word 0x0000
 1b8:	20 00       	.word 0x0020
	...
 1c6:	00 00       	.word 0x0000
 1c8:	09 00       	nop	
 1ca:	09 00       	nop	
 1cc:	09 00       	nop	
 1ce:	09 00       	nop	
 1d0:	09 00       	nop	
 1d2:	09 00       	nop	
 1d4:	09 00       	nop	
 1d6:	09 00       	nop	
 1d8:	09 00       	nop	
 1da:	09 00       	nop	
 1dc:	09 00       	nop	
 1de:	09 00       	nop	

000001e0 <kthread_create>:
 1e0:	76 2f       	mov.l	r7,@-r15
 1e2:	00 e2       	mov	#0,r2
 1e4:	86 2f       	mov.l	r8,@-r15
 1e6:	63 68       	mov	r6,r8
 1e8:	22 4f       	sts.l	pr,@-r15
 1ea:	a4 7f       	add	#-92,r15
 1ec:	2a d3       	mov.l	298 <kthread_create+0xb8>,r3	! 0x4b87ad6e
 1ee:	f3 61       	mov	r15,r1
 1f0:	28 71       	add	#40,r1
 1f2:	f3 67       	mov	r15,r7
 1f4:	1a 1f       	mov.l	r1,@(40,r15)
 1f6:	24 77       	add	#36,r7
 1f8:	1b 1f       	mov.l	r1,@(44,r15)
 1fa:	14 71       	add	#20,r1
 1fc:	27 17       	mov.l	r2,@(28,r7)
 1fe:	33 11       	mov.l	r3,@(12,r1)
 200:	d0 71       	add	#-48,r1
 202:	28 17       	mov.l	r2,@(32,r7)
 204:	2a 17       	mov.l	r2,@(40,r7)
 206:	2b 17       	mov.l	r2,@(44,r7)
 208:	2c 17       	mov.l	r2,@(48,r7)
 20a:	13 1f       	mov.l	r1,@(12,r15)
 20c:	14 1f       	mov.l	r1,@(16,r15)
 20e:	10 71       	add	#16,r1
 210:	17 1f       	mov.l	r1,@(28,r15)
 212:	18 1f       	mov.l	r1,@(32,r15)
 214:	21 d1       	mov.l	29c <kthread_create+0xbc>,r1	! 0x0 <kthread_should_stop>
 216:	22 1f       	mov.l	r2,@(8,r15)
 218:	26 1f       	mov.l	r2,@(24,r15)
 21a:	42 2f       	mov.l	r4,@r15
 21c:	12 64       	mov.l	@r1,r4
 21e:	20 d6       	mov.l	2a0 <kthread_create+0xc0>,r6	! 0x160 <keventd_create_kthread>
 220:	48 24       	tst	r4,r4
 222:	29 1f       	mov.l	r2,@(36,r15)
 224:	2e 1f       	mov.l	r2,@(56,r15)
 226:	2f 1f       	mov.l	r2,@(60,r15)
 228:	6c 1f       	mov.l	r6,@(48,r15)
 22a:	fd 1f       	mov.l	r15,@(52,r15)
 22c:	18 8f       	bf.s	260 <kthread_create+0x80>
 22e:	51 1f       	mov.l	r5,@(4,r15)
 230:	0b 46       	jsr	@r6
 232:	f3 64       	mov	r15,r4
 234:	f5 50       	mov.l	@(20,r15),r0
 236:	2d 91       	mov.w	294 <kthread_create+0xb4>,r1	! 0xfc18
 238:	16 30       	cmp/hi	r1,r0
 23a:	1c 8b       	bf	276 <kthread_create+0x96>
 23c:	5c 7f       	add	#92,r15
 23e:	26 4f       	lds.l	@r15+,pr
 240:	f6 68       	mov.l	@r15+,r8
 242:	0b 00       	rts	
 244:	04 7f       	add	#4,r15
 246:	09 00       	nop	
 248:	09 00       	nop	
 24a:	09 00       	nop	
 24c:	09 00       	nop	
 24e:	09 00       	nop	
 250:	09 00       	nop	
 252:	09 00       	nop	
 254:	09 00       	nop	
 256:	09 00       	nop	
 258:	09 00       	nop	
 25a:	09 00       	nop	
 25c:	09 00       	nop	
 25e:	09 00       	nop	
 260:	10 d0       	mov.l	2a4 <kthread_create+0xc4>,r0	! 0x0 <kthread_should_stop>
 262:	0b 40       	jsr	@r0
 264:	73 65       	mov	r7,r5
 266:	10 d1       	mov.l	2a8 <kthread_create+0xc8>,r1	! 0x0 <kthread_should_stop>
 268:	f3 64       	mov	r15,r4
 26a:	0b 41       	jsr	@r1
 26c:	18 74       	add	#24,r4
 26e:	f5 50       	mov.l	@(20,r15),r0
 270:	10 91       	mov.w	294 <kthread_create+0xb4>,r1	! 0xfc18
 272:	16 30       	cmp/hi	r1,r0
 274:	e2 89       	bt	23c <kthread_create+0x5c>
 276:	03 64       	mov	r0,r4
 278:	0c d0       	mov.l	2ac <kthread_create+0xcc>,r0	! 0x0 <kthread_should_stop>
 27a:	0c 91       	mov.w	296 <kthread_create+0xb6>,r1	! 0x1a4
 27c:	10 e5       	mov	#16,r5
 27e:	83 66       	mov	r8,r6
 280:	64 e7       	mov	#100,r7
 282:	1c 34       	add	r1,r4
 284:	0b 40       	jsr	@r0
 286:	fc 37       	add	r15,r7
 288:	f5 50       	mov.l	@(20,r15),r0
 28a:	5c 7f       	add	#92,r15
 28c:	26 4f       	lds.l	@r15+,pr
 28e:	f6 68       	mov.l	@r15+,r8
 290:	0b 00       	rts	
 292:	04 7f       	add	#4,r15
 294:	18 fc       	.word 0xfc18
 296:	a4 01       	mov.b	r10,@(r0,r1)
 298:	6e ad       	bra	fffffd78 <kthread_stop+0xfffffa78>
 29a:	87 4b       	ldc.l	@r11+,r0_bank
 29c:	00 00       	.word 0x0000
 29e:	00 00       	.word 0x0000
 2a0:	60 01       	.word 0x0160
	...
 2ae:	00 00       	.word 0x0000
 2b0:	09 00       	nop	
 2b2:	09 00       	nop	
 2b4:	09 00       	nop	
 2b6:	09 00       	nop	
 2b8:	09 00       	nop	
 2ba:	09 00       	nop	
 2bc:	09 00       	nop	
 2be:	09 00       	nop	

000002c0 <kthread_bind>:
 2c0:	86 2f       	mov.l	r8,@-r15
 2c2:	43 68       	mov	r4,r8
 2c4:	96 2f       	mov.l	r9,@-r15
 2c6:	53 69       	mov	r5,r9
 2c8:	22 4f       	sts.l	pr,@-r15
 2ca:	42 60       	mov.l	@r4,r0
 2cc:	01 88       	cmp/eq	#1,r0
 2ce:	07 8b       	bf	2e0 <kthread_bind+0x20>
 2d0:	26 4f       	lds.l	@r15+,pr
 2d2:	01 e1       	mov	#1,r1
 2d4:	9d 41       	shld	r9,r1
 2d6:	f6 69       	mov.l	@r15+,r9
 2d8:	40 78       	add	#64,r8
 2da:	12 18       	mov.l	r1,@(8,r8)
 2dc:	0b 00       	rts	
 2de:	f6 68       	mov.l	@r15+,r8
 2e0:	04 d0       	mov.l	2f4 <kthread_bind+0x34>,r0	! 0x0 <kthread_should_stop>
 2e2:	05 d4       	mov.l	2f8 <kthread_bind+0x38>,r4	! 0x0 <kthread_should_stop>
 2e4:	05 d5       	mov.l	2fc <kthread_bind+0x3c>,r5	! 0x18
 2e6:	04 96       	mov.w	2f2 <kthread_bind+0x32>,r6	! 0x9e
 2e8:	0b 40       	jsr	@r0
 2ea:	09 00       	nop	
 2ec:	09 00       	nop	
 2ee:	f0 af       	bra	2d2 <kthread_bind+0x12>
 2f0:	26 4f       	lds.l	@r15+,pr
 2f2:	9e 00       	mov.l	@(r0,r9),r0
	...
 2fc:	18 00       	sett	
	...

00000300 <kthread_stop>:
 300:	86 2f       	mov.l	r8,@-r15
 302:	43 68       	mov	r4,r8
 304:	96 2f       	mov.l	r9,@-r15
 306:	a6 2f       	mov.l	r10,@-r15
 308:	b6 2f       	mov.l	r11,@-r15
 30a:	c6 2f       	mov.l	r12,@-r15
 30c:	d6 2f       	mov.l	r13,@-r15
 30e:	22 4f       	sts.l	pr,@-r15
 310:	53 dc       	mov.l	460 <kthread_stop+0x160>,r12	! 0x0 <kthread_should_stop>
 312:	fc 7f       	add	#-4,r15
 314:	02 01       	stc	sr,r1
 316:	13 60       	mov	r1,r0
 318:	f0 cb       	or	#-16,r0
 31a:	0e 40       	ldc	r0,sr
 31c:	13 60       	mov	r1,r0
 31e:	f0 c9       	and	#-16,r0
 320:	9b 9b       	mov.w	45a <kthread_stop+0x15a>,r11	! 0xf0
 322:	f0 c9       	and	#-16,r0
 324:	c2 63       	mov.l	@r12,r3
 326:	b0 30       	cmp/eq	r11,r0
 328:	ff 73       	add	#-1,r3
 32a:	06 8d       	bt.s	33a <kthread_stop+0x3a>
 32c:	32 2c       	mov.l	r3,@r12
 32e:	95 91       	mov.w	45c <kthread_stop+0x15c>,r1	! 0xff0f
 330:	02 02       	stc	sr,r2
 332:	19 22       	and	r1,r2
 334:	e2 01       	stc	r6_bank,r1
 336:	1b 22       	or	r1,r2
 338:	0e 42       	ldc	r2,sr
 33a:	11 43       	cmp/pz	r3
 33c:	70 8b       	bf	420 <kthread_stop+0x120>
 33e:	02 01       	stc	sr,r1
 340:	13 60       	mov	r1,r0
 342:	f0 cb       	or	#-16,r0
 344:	0e 40       	ldc	r0,sr
 346:	13 60       	mov	r1,r0
 348:	f0 c9       	and	#-16,r0
 34a:	82 51       	mov.l	@(8,r8),r1
 34c:	f0 c9       	and	#-16,r0
 34e:	b0 30       	cmp/eq	r11,r0
 350:	01 71       	add	#1,r1
 352:	06 8d       	bt.s	362 <kthread_stop+0x62>
 354:	12 18       	mov.l	r1,@(8,r8)
 356:	81 91       	mov.w	45c <kthread_stop+0x15c>,r1	! 0xff0f
 358:	02 02       	stc	sr,r2
 35a:	19 22       	and	r1,r2
 35c:	e2 01       	stc	r6_bank,r1
 35e:	1b 22       	or	r1,r2
 360:	0e 42       	ldc	r2,sr
 362:	40 d9       	mov.l	464 <kthread_stop+0x164>,r9	! 0xc
 364:	00 ed       	mov	#0,r13
 366:	93 61       	mov	r9,r1
 368:	d2 29       	mov.l	r13,@r9
 36a:	04 71       	add	#4,r1
 36c:	11 19       	mov.l	r1,@(4,r9)
 36e:	11 11       	mov.l	r1,@(4,r1)
 370:	3d d0       	mov.l	468 <kthread_stop+0x168>,r0	! 0x0 <kthread_should_stop>
 372:	93 6a       	mov	r9,r10
 374:	f8 7a       	add	#-8,r10
 376:	83 64       	mov	r8,r4
 378:	0b 40       	jsr	@r0
 37a:	82 2a       	mov.l	r8,@r10
 37c:	02 01       	stc	sr,r1
 37e:	13 60       	mov	r1,r0
 380:	f0 cb       	or	#-16,r0
 382:	0e 40       	ldc	r0,sr
 384:	13 60       	mov	r1,r0
 386:	f0 c9       	and	#-16,r0
 388:	82 53       	mov.l	@(8,r8),r3
 38a:	f0 c9       	and	#-16,r0
 38c:	b0 30       	cmp/eq	r11,r0
 38e:	ff 73       	add	#-1,r3
 390:	06 8d       	bt.s	3a0 <kthread_stop+0xa0>
 392:	32 18       	mov.l	r3,@(8,r8)
 394:	62 91       	mov.w	45c <kthread_stop+0x15c>,r1	! 0xff0f
 396:	02 02       	stc	sr,r2
 398:	19 22       	and	r1,r2
 39a:	e2 01       	stc	r6_bank,r1
 39c:	1b 22       	or	r1,r2
 39e:	0e 42       	ldc	r2,sr
 3a0:	38 23       	tst	r3,r3
 3a2:	2d 89       	bt	400 <kthread_stop+0x100>
 3a4:	31 d1       	mov.l	46c <kthread_stop+0x16c>,r1	! 0x0 <kthread_should_stop>
 3a6:	0b 41       	jsr	@r1
 3a8:	93 64       	mov	r9,r4
 3aa:	d2 2a       	mov.l	r13,@r10
 3ac:	a1 58       	mov.l	@(4,r10),r8
 3ae:	02 01       	stc	sr,r1
 3b0:	13 60       	mov	r1,r0
 3b2:	f0 cb       	or	#-16,r0
 3b4:	0e 40       	ldc	r0,sr
 3b6:	13 60       	mov	r1,r0
 3b8:	f0 c9       	and	#-16,r0
 3ba:	c2 63       	mov.l	@r12,r3
 3bc:	f0 c9       	and	#-16,r0
 3be:	b0 30       	cmp/eq	r11,r0
 3c0:	01 73       	add	#1,r3
 3c2:	06 8d       	bt.s	3d2 <kthread_stop+0xd2>
 3c4:	32 2c       	mov.l	r3,@r12
 3c6:	49 91       	mov.w	45c <kthread_stop+0x15c>,r1	! 0xff0f
 3c8:	02 02       	stc	sr,r2
 3ca:	19 22       	and	r1,r2
 3cc:	e2 01       	stc	r6_bank,r1
 3ce:	1b 22       	or	r1,r2
 3d0:	0e 42       	ldc	r2,sr
 3d2:	15 43       	cmp/pl	r3
 3d4:	34 8b       	bf	440 <kthread_stop+0x140>
 3d6:	83 60       	mov	r8,r0
 3d8:	04 7f       	add	#4,r15
 3da:	26 4f       	lds.l	@r15+,pr
 3dc:	f6 6d       	mov.l	@r15+,r13
 3de:	f6 6c       	mov.l	@r15+,r12
 3e0:	f6 6b       	mov.l	@r15+,r11
 3e2:	f6 6a       	mov.l	@r15+,r10
 3e4:	f6 69       	mov.l	@r15+,r9
 3e6:	0b 00       	rts	
 3e8:	f6 68       	mov.l	@r15+,r8
 3ea:	09 00       	nop	
 3ec:	09 00       	nop	
 3ee:	09 00       	nop	
 3f0:	09 00       	nop	
 3f2:	09 00       	nop	
 3f4:	09 00       	nop	
 3f6:	09 00       	nop	
 3f8:	09 00       	nop	
 3fa:	09 00       	nop	
 3fc:	09 00       	nop	
 3fe:	09 00       	nop	
 400:	1b d1       	mov.l	470 <kthread_stop+0x170>,r1	! 0x0 <kthread_should_stop>
 402:	0b 41       	jsr	@r1
 404:	83 64       	mov	r8,r4
 406:	cd af       	bra	3a4 <kthread_stop+0xa4>
 408:	09 00       	nop	
 40a:	09 00       	nop	
 40c:	09 00       	nop	
 40e:	09 00       	nop	
 410:	09 00       	nop	
 412:	09 00       	nop	
 414:	09 00       	nop	
 416:	09 00       	nop	
 418:	09 00       	nop	
 41a:	09 00       	nop	
 41c:	09 00       	nop	
 41e:	09 00       	nop	
 420:	14 d1       	mov.l	474 <kthread_stop+0x174>,r1	! 0x0 <kthread_should_stop>
 422:	0b 41       	jsr	@r1
 424:	c3 64       	mov	r12,r4
 426:	8a af       	bra	33e <kthread_stop+0x3e>
 428:	09 00       	nop	
 42a:	09 00       	nop	
 42c:	09 00       	nop	
 42e:	09 00       	nop	
 430:	09 00       	nop	
 432:	09 00       	nop	
 434:	09 00       	nop	
 436:	09 00       	nop	
 438:	09 00       	nop	
 43a:	09 00       	nop	
 43c:	09 00       	nop	
 43e:	09 00       	nop	
 440:	0d d1       	mov.l	478 <kthread_stop+0x178>,r1	! 0x0 <kthread_should_stop>
 442:	0b 41       	jsr	@r1
 444:	c3 64       	mov	r12,r4
 446:	83 60       	mov	r8,r0
 448:	04 7f       	add	#4,r15
 44a:	26 4f       	lds.l	@r15+,pr
 44c:	f6 6d       	mov.l	@r15+,r13
 44e:	f6 6c       	mov.l	@r15+,r12
 450:	f6 6b       	mov.l	@r15+,r11
 452:	f6 6a       	mov.l	@r15+,r10
 454:	f6 69       	mov.l	@r15+,r9
 456:	0b 00       	rts	
 458:	f6 68       	mov.l	@r15+,r8
 45a:	f0 00       	.word 0x00f0
 45c:	0f ff       	.word 0xff0f
 45e:	09 00       	nop	
 460:	00 00       	.word 0x0000
 462:	00 00       	.word 0x0000
 464:	0c 00       	mov.b	@(r0,r0),r0
	...
 47a:	00 00       	.word 0x0000
 47c:	09 00       	nop	
 47e:	09 00       	nop	
Disassembly of section .init.text:

00000000 <helper_init>:
   0:	0c d0       	mov.l	34 <helper_init+0x34>,r0	! 0x0 <helper_init>
   2:	22 4f       	sts.l	pr,@-r15
   4:	0c d4       	mov.l	38 <helper_init+0x38>,r4	! 0x2c
   6:	0b 40       	jsr	@r0
   8:	01 e5       	mov	#1,r5
   a:	0c d1       	mov.l	3c <helper_init+0x3c>,r1	! 0x0 <helper_init>
   c:	08 20       	tst	r0,r0
   e:	07 8d       	bt.s	20 <helper_init+0x20>
  10:	02 21       	mov.l	r0,@r1
  12:	26 4f       	lds.l	@r15+,pr
  14:	0b 00       	rts	
  16:	00 e0       	mov	#0,r0
  18:	09 00       	nop	
  1a:	09 00       	nop	
  1c:	09 00       	nop	
  1e:	09 00       	nop	
  20:	07 d0       	mov.l	40 <helper_init+0x40>,r0	! 0x0 <helper_init>
  22:	08 d4       	mov.l	44 <helper_init+0x44>,r4	! 0x0 <helper_init>
  24:	08 d5       	mov.l	48 <helper_init+0x48>,r5	! 0x18
  26:	04 96       	mov.w	32 <helper_init+0x32>,r6	! 0xc5
  28:	0b 40       	jsr	@r0
  2a:	09 00       	nop	
  2c:	09 00       	nop	
  2e:	f1 af       	bra	14 <helper_init+0x14>
  30:	26 4f       	lds.l	@r15+,pr
  32:	c5 00       	mov.w	r12,@(r0,r0)
  34:	00 00       	.word 0x0000
  36:	00 00       	.word 0x0000
  38:	2c 00       	mov.b	@(r0,r2),r0
	...
  46:	00 00       	.word 0x0000
  48:	18 00       	sett	
  4a:	00 00       	.word 0x0000
  4c:	09 00       	nop	
  4e:	09 00       	nop	
  50:	09 00       	nop	
  52:	09 00       	nop	
  54:	09 00       	nop	
  56:	09 00       	nop	
  58:	09 00       	nop	
  5a:	09 00       	nop	
  5c:	09 00       	nop	
  5e:	09 00       	nop	

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Oops in kthread
  2006-05-20 12:37 Oops in kthread Liu haixiang
@ 2006-05-20 13:25 ` Balbir Singh
  2006-05-21  6:06   ` Liu haixiang
  2006-05-20 13:44 ` Arjan van de Ven
  1 sibling, 1 reply; 6+ messages in thread
From: Balbir Singh @ 2006-05-20 13:25 UTC (permalink / raw)
  To: Liu haixiang; +Cc: linux-kernel

On 5/20/06, Liu haixiang <liu.haixiang@gmail.com> wrote:
> Hi All,
>
> Today I debug one kernel thread created by kthread_run. And after
> several hours run, there is one Oops coming from kthread. Please see
> below mesage:
> ====================
> Unable to handle kernel NULL pointer dereference at virtual address 00000000
> pc = 00000000
> *pde = 00000000
> Oops: 0000 [#1]
>
> Pid : 261, Comm:      CallbackManager
> PC is at 0x0
> PC  : 00000000 SP  : 869bbf8c SR  : 40008100 TEA : c016db88    Tainted: P
> R0  : 00000000 R1  : 00000000 R2  : 005770c5 R3  : 40008101
> R4  : 8b000006 R5  : 00000003 R6  : 07b1ce60 R7  : 00000079
> R8  : c01c0800 R9  : 07b1ce60 R10 : 00000003 R11 : 00000000
> R12 : 0000004c R13 : 00000000 R14 : 00000079
> MACH: 0000025c MACL: 000001c8 GBR : 00000000 PR  : c01b514a
>

Your kernel is Tainted. I do not see a list of loaded modules in the
oops log. A quick grep through the kernel sources did not reveal any
routine called "CallbackManager". From the trace CallbackManager
(which is also the name of the thread) belongs to a module called
fdma.

Are you writing fdma or do you have the source code for it? If your
planning to submit fdma to the linux kernel, I would recommend that
you go through the coding standards for the kernel. I don't think
CallbackManager is an acceptable naming convention.

> Call trace:
> [<8442d184>] kthread+0xe4/0x140
> [<c01b4f80>] CallbackManager+0x0/0x2c0 [fdma]
> [<8440f4c0>] complete+0x0/0xc0
> [<8442d080>] kthread_should_stop+0x0/0x20
> [<84403004>] kernel_thread_helper+0x4/0x20
>
> Then I do objdump the kernel/kthread.c. Please see attached dumped
> contents. And find the offset 0xe4. The assembly line code is:
> e4:     08 20           tst     r0,r0
>
> Does anybody can explain to me which C code in kthread create this
> Oops?Is there any easy way to translate assembly code to C?
>

Try running objdump -d -l on the object file. It should dump the line
numbers and the corresponding disassembled assembly code.

> best regards
>
> Liu haixiang
>
>
>

Balbir
Linux Technology Center,
India Software Labs,
Bangalore

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Oops in kthread
  2006-05-20 12:37 Oops in kthread Liu haixiang
  2006-05-20 13:25 ` Balbir Singh
@ 2006-05-20 13:44 ` Arjan van de Ven
  1 sibling, 0 replies; 6+ messages in thread
From: Arjan van de Ven @ 2006-05-20 13:44 UTC (permalink / raw)
  To: Liu haixiang; +Cc: linux-kernel

On Sat, 2006-05-20 at 20:37 +0800, Liu haixiang wrote:
> Hi All,
> 
> Today I debug one kernel thread created by kthread_run. And after
> several hours run, there is one Oops coming from kthread. Please see
> below mesage:
> ====================
> Unable to handle kernel NULL pointer dereference at virtual address 00000000
> pc = 00000000
> *pde = 00000000
> Oops: 0000 [#1]
> 
> Pid : 261, Comm:      CallbackManager
> PC is at 0x0
> PC  : 00000000 SP  : 869bbf8c SR  : 40008100 TEA : c016db88    Tainted: P
> R0  : 00000000 R1  : 00000000 R2  : 005770c5 R3  : 40008101
> R4  : 8b000006 R5  : 00000003 R6  : 07b1ce60 R7  : 00000079
> R8  : c01c0800 R9  : 07b1ce60 R10 : 00000003 R11 : 00000000
> R12 : 0000004c R13 : 00000000 R14 : 00000079
> MACH: 0000025c MACL: 000001c8 GBR : 00000000 PR  : c01b514a
> 
> Call trace:
> [<8442d184>] kthread+0xe4/0x140
> [<c01b4f80>] CallbackManager+0x0/0x2c0 [fdma]

you forgot to attach the source code for "fdma"... so how can we help
you?


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Oops in kthread
  2006-05-20 13:25 ` Balbir Singh
@ 2006-05-21  6:06   ` Liu haixiang
  2006-05-21  6:14     ` Balbir Singh
  2006-05-21  9:26     ` David Greaves
  0 siblings, 2 replies; 6+ messages in thread
From: Liu haixiang @ 2006-05-21  6:06 UTC (permalink / raw)
  To: Balbir Singh; +Cc: linux-kernel

Hi Balbir,

The FDMA is my coded module. And in my code, I didn't call kthread in
my code but only call kthread_run once to create one kernel thread
CallbackManager.

So I don't understand why there is Oops from kthread and called by my
CallbackManager.

Can anybody explain to me when kthread will be called by the kernel?
Then I can understand well why Oops happen.

best regards

Liu haixiang

2006/5/20, Balbir Singh <bsingharora@gmail.com>:
> On 5/20/06, Liu haixiang <liu.haixiang@gmail.com> wrote:
> > Hi All,
> >
> > Today I debug one kernel thread created by kthread_run. And after
> > several hours run, there is one Oops coming from kthread. Please see
> > below mesage:
> > ====================
> > Unable to handle kernel NULL pointer dereference at virtual address 00000000
> > pc = 00000000
> > *pde = 00000000
> > Oops: 0000 [#1]
> >
> > Pid : 261, Comm:      CallbackManager
> > PC is at 0x0
> > PC  : 00000000 SP  : 869bbf8c SR  : 40008100 TEA : c016db88    Tainted: P
> > R0  : 00000000 R1  : 00000000 R2  : 005770c5 R3  : 40008101
> > R4  : 8b000006 R5  : 00000003 R6  : 07b1ce60 R7  : 00000079
> > R8  : c01c0800 R9  : 07b1ce60 R10 : 00000003 R11 : 00000000
> > R12 : 0000004c R13 : 00000000 R14 : 00000079
> > MACH: 0000025c MACL: 000001c8 GBR : 00000000 PR  : c01b514a
> >
>
> Your kernel is Tainted. I do not see a list of loaded modules in the
> oops log. A quick grep through the kernel sources did not reveal any
> routine called "CallbackManager". From the trace CallbackManager
> (which is also the name of the thread) belongs to a module called
> fdma.
>
> Are you writing fdma or do you have the source code for it? If your
> planning to submit fdma to the linux kernel, I would recommend that
> you go through the coding standards for the kernel. I don't think
> CallbackManager is an acceptable naming convention.
>
> > Call trace:
> > [<8442d184>] kthread+0xe4/0x140
> > [<c01b4f80>] CallbackManager+0x0/0x2c0 [fdma]
> > [<8440f4c0>] complete+0x0/0xc0
> > [<8442d080>] kthread_should_stop+0x0/0x20
> > [<84403004>] kernel_thread_helper+0x4/0x20
> >
> > Then I do objdump the kernel/kthread.c. Please see attached dumped
> > contents. And find the offset 0xe4. The assembly line code is:
> > e4:     08 20           tst     r0,r0
> >
> > Does anybody can explain to me which C code in kthread create this
> > Oops?Is there any easy way to translate assembly code to C?
> >
>
> Try running objdump -d -l on the object file. It should dump the line
> numbers and the corresponding disassembled assembly code.
>
> > best regards
> >
> > Liu haixiang
> >
> >
> >
>
> Balbir
> Linux Technology Center,
> India Software Labs,
> Bangalore
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Oops in kthread
  2006-05-21  6:06   ` Liu haixiang
@ 2006-05-21  6:14     ` Balbir Singh
  2006-05-21  9:26     ` David Greaves
  1 sibling, 0 replies; 6+ messages in thread
From: Balbir Singh @ 2006-05-21  6:14 UTC (permalink / raw)
  To: Liu haixiang; +Cc: linux-kernel

On 5/21/06, Liu haixiang <liu.haixiang@gmail.com> wrote:
> Hi Balbir,
>
> The FDMA is my coded module. And in my code, I didn't call kthread in
> my code but only call kthread_run once to create one kernel thread
> CallbackManager.
>
> So I don't understand why there is Oops from kthread and called by my
> CallbackManager.
>
> Can anybody explain to me when kthread will be called by the kernel?
> Then I can understand well why Oops happen.
>
> best regards
>
> Liu haixiang
>

Please post the source code, it is easier to help out, otherwise its
like shooting in the dark.

Balbir
Linux Technology Center,
India Software Labs,
Bangalore

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Oops in kthread
  2006-05-21  6:06   ` Liu haixiang
  2006-05-21  6:14     ` Balbir Singh
@ 2006-05-21  9:26     ` David Greaves
  1 sibling, 0 replies; 6+ messages in thread
From: David Greaves @ 2006-05-21  9:26 UTC (permalink / raw)
  To: Liu haixiang; +Cc: Balbir Singh, linux-kernel

Liu haixiang wrote:
> Hi Balbir,
>
> The FDMA is my coded module. And in my code, I didn't call kthread in
> my code but only call kthread_run once to create one kernel thread
> CallbackManager.
>
> So I don't understand why there is Oops from kthread and called by my
> CallbackManager.
>
> Can anybody explain to me when kthread will be called by the kernel?
> Then I can understand well why Oops happen.
Have you seen the kernel-newbies mailing list?
http://www.kernelnewbies.org/

It's for people who want to develop kernel code. It's full of people
asking (and answering) questions like this and you'll probably more
helpful answers (though you'll still probably need to provide source).

David


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-05-21  9:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-20 12:37 Oops in kthread Liu haixiang
2006-05-20 13:25 ` Balbir Singh
2006-05-21  6:06   ` Liu haixiang
2006-05-21  6:14     ` Balbir Singh
2006-05-21  9:26     ` David Greaves
2006-05-20 13:44 ` Arjan van de Ven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox