lkml.org 
[lkml]   [2001]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectmemory and current macro
Hi,
I've been trying to write a device driver and I've found two
problems. First, the current macro. I wanted to get the uid of the
calling process but "current->uid" does NOT work it returns some
other number. Same with "current->pid" and many others. I figured
these numbers weren't random and decided to print out a particular
processes's descriptor and check out what was going on. I found that
"&(current->uid)" is 0x1d lower than the address that holds the user
id. In addition, adding 0x1d to that address added it twice??? So
to get the uid I ended up adding half...or "&(current->uid) + 0x0f".
Does anyone know why this is? I have an i686 processor, IBM thinkpad
570e laptop, Debian 2.2, kernel version 2.4.2.

Second problem might not have anything to do with my device
driver at all. It seems that applications on my laptop know longer
free memory they have allocated. I thought it was my module. I
check "free" for the memory available, "insmod" my module, check
"free" again, "rmmod" it. Each time the amount of free memory goes
down. Even when I remove the module. Then I found that all other
processes do this also, from ftp to ls or cd. Then I start getting
really bad segmentation errors in almost every process I try to run.
And at the top, they say, usually, "kernel BUG page_alloc.c line:xx".
I'm worried I've corrupted something or I don't know. I looked this
up in the source but I don't know why everything is triggering it.
Are there any known memory allocation or freeing problems with kernel
2.4.2?

- Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:52    [W:0.025 / U:3.188 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site