All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Friesen <cfriesen@nortelnetworks.com>
To: Jeff Dike <jdike@addtoit.com>
Cc: User-mode-linux-devel <User-mode-linux-devel@lists.sourceforge.net>
Subject: [uml-devel] Re: problems with UML, issues with includes
Date: Tue, 02 Mar 2004 18:18:12 -0500	[thread overview]
Message-ID: <40451634.70902@nortelnetworks.com> (raw)
In-Reply-To: 200403022322.i22NM8Wo003853@ccure.user-mode-linux.org

Jeff Dike wrote:
> cfriesen@nortelnetworks.com said:
> 
>>#1  0xa00d03d6 in activate_fd (irq=3, fd=47, type=1,
>>dev_id=0xa02309f8) at irq_user.c:230 
>>
> 
> Why don't your line numbers match mine?  

I've added debug statements.

The kfree you seem to be talking
> about is this:

> 
>    211   out_unlock:
>    212          irq_unlock(flags);
>    213          kfree(new_fd);
>    214   out:
> 
> And I totally don't see a problem there.  new_fd isn't on any lists when it's
> freed there.

As mentioned in my other message, I'm seeing um_kmalloc() return a 
new_fd address that is *already* on the active_fds list.  Hence it ends 
up looking like a dupe, hence we end up calling kfree() on an address 
that is still on the active_fds list.

I made the following changes within activate_fd() to try and see what's 
going on.  If I set a breakpoint at the "redo=1" line and then step 
through the code, I end up in a continuous loop getting the same value 
for the return code of um_kmalloc().  There's something fishy going on 
here....

get_mem:
	new_fd = um_kmalloc(sizeof(*new_fd));	
	err = -ENOMEM;
	if(new_fd == NULL)
		goto out;
	
	redo = 0;
	flags = irq_lock();
	for(irq_fd = active_fds; irq_fd != NULL; irq_fd = irq_fd->next){
		
		if (irq_fd == new_fd) {
			redo = 1;
		}
	}
	irq_unlock(flags);
	
	if (redo)
		goto get_mem;


Chris


-- 
Chris Friesen                    | MailStop: 043/33/F10
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: cfriesen@nortelnetworks.com



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  reply	other threads:[~2004-03-02 23:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-01 22:07 [uml-devel] problems with UML, issues with includes Chris Friesen
2004-03-02  1:00 ` [uml-devel] " Jeff Dike
2004-03-02 15:08   ` Chris Friesen
2004-03-02 18:06     ` BlaisorBlade
2004-03-02 20:54     ` Jeff Dike
2004-03-02 22:26       ` Chris Friesen
2004-03-02 23:22         ` Jeff Dike
2004-03-02 23:18           ` Chris Friesen [this message]
2004-03-02 23:37           ` [uml-devel] Re: problems with UML -- new data with memory debugging on Chris Friesen
2004-03-03  1:33             ` Jeff Dike
2004-03-03 16:49               ` Chris Friesen
2004-03-08 21:34                 ` Jeff Dike
2004-03-08 21:08                   ` Chris Friesen
2004-03-02 23:03       ` [uml-devel] Re: problems with UML, issues with includes Chris Friesen

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=40451634.70902@nortelnetworks.com \
    --to=cfriesen@nortelnetworks.com \
    --cc=User-mode-linux-devel@lists.sourceforge.net \
    --cc=jdike@addtoit.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.