linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* kmemeleak BUG: lock held when returning to user space!
@ 2009-07-09 10:42 Sergey Senozhatsky
  2009-07-09 10:47 ` Catalin Marinas
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Senozhatsky @ 2009-07-09 10:42 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: Pekka Enberg, Paul E. McKenney, linux-kernel, linux-mm

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

Hello.

kernel: [  149.507103] ================================================
kernel: [  149.507113] [ BUG: lock held when returning to user space! ]
kernel: [  149.507119] ------------------------------------------------
kernel: [  149.507127] cat/3279 is leaving the kernel with locks still held!
kernel: [  149.507135] 1 lock held by cat/3279:
kernel: [  149.507141]  #0:  (scan_mutex){+.+.+.}, at: [<c110707c>] kmemleak_open+0x4c/0x80

problem is here:
static int kmemleak_open(struct inode *inode, struct file *file)
{
	int ret = 0;

	if (!atomic_read(&kmemleak_enabled))
		return -EBUSY;

	ret = mutex_lock_interruptible(&scan_mutex);
	if (ret < 0)
		goto out;
	if (file->f_mode & FMODE_READ) {
		ret = seq_open(file, &kmemleak_seq_ops);
		if (ret < 0)
			goto scan_unlock;
	}
>>-	return ret;

scan_unlock:
	mutex_unlock(&scan_mutex);
out:
	return ret;
}

we should not return before mutex_unlock(&scan_mutex);

	Sergey

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

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

* Re: kmemeleak BUG: lock held when returning to user space!
  2009-07-09 10:42 kmemeleak BUG: lock held when returning to user space! Sergey Senozhatsky
@ 2009-07-09 10:47 ` Catalin Marinas
  2009-07-09 10:55   ` Sergey Senozhatsky
  0 siblings, 1 reply; 3+ messages in thread
From: Catalin Marinas @ 2009-07-09 10:47 UTC (permalink / raw)
  To: Sergey Senozhatsky; +Cc: Pekka Enberg, Paul E. McKenney, linux-kernel, linux-mm

Sergey Senozhatsky <sergey.senozhatsky@mail.by> wrote:
> kernel: [  149.507103] ================================================
> kernel: [  149.507113] [ BUG: lock held when returning to user space! ]
> kernel: [  149.507119] ------------------------------------------------
> kernel: [  149.507127] cat/3279 is leaving the kernel with locks still held!
> kernel: [  149.507135] 1 lock held by cat/3279:
> kernel: [  149.507141]  #0:  (scan_mutex){+.+.+.}, at: [<c110707c>] kmemleak_open+0x4c/0x80
>
> problem is here:
> static int kmemleak_open(struct inode *inode, struct file *file)

It's been fixed in my kmemleak branch which I'll push to Linus:

http://www.linux-arm.org/git?p=linux-2.6.git;a=shortlog;h=kmemleak

-- 
Catalin

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: kmemeleak BUG: lock held when returning to user space!
  2009-07-09 10:47 ` Catalin Marinas
@ 2009-07-09 10:55   ` Sergey Senozhatsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sergey Senozhatsky @ 2009-07-09 10:55 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: Pekka Enberg, Paul E. McKenney, linux-kernel, linux-mm

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

On (07/09/09 11:47), Catalin Marinas wrote:
> Date: Thu, 09 Jul 2009 11:47:23 +0100
> From: Catalin Marinas <catalin.marinas@arm.com>
> To: Sergey Senozhatsky <sergey.senozhatsky@mail.by>
> Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
> 	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
> 	linux-kernel@vger.kernel.org, linux-mm@kvack.org
> Subject: Re: kmemeleak BUG: lock held when returning to user space!
> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)
> 
> Sergey Senozhatsky <sergey.senozhatsky@mail.by> wrote:
> > kernel: [  149.507103] ================================================
> > kernel: [  149.507113] [ BUG: lock held when returning to user space! ]
> > kernel: [  149.507119] ------------------------------------------------
> > kernel: [  149.507127] cat/3279 is leaving the kernel with locks still held!
> > kernel: [  149.507135] 1 lock held by cat/3279:
> > kernel: [  149.507141]  #0:  (scan_mutex){+.+.+.}, at: [<c110707c>] kmemleak_open+0x4c/0x80
> >
> > problem is here:
> > static int kmemleak_open(struct inode *inode, struct file *file)
> 
> It's been fixed in my kmemleak branch which I'll push to Linus:
> 
Ok. Nice to hear.

> http://www.linux-arm.org/git?p=linux-2.6.git;a=shortlog;h=kmemleak
> 
> -- 
> Catalin
> 

	Sergey

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

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

end of thread, other threads:[~2009-07-09 10:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-09 10:42 kmemeleak BUG: lock held when returning to user space! Sergey Senozhatsky
2009-07-09 10:47 ` Catalin Marinas
2009-07-09 10:55   ` Sergey Senozhatsky

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