lkml.org 
[lkml]   [2000]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: freeing a static after one use only?
Date
"A month of sundays ago Mike Galbraith wrote:"
> On Fri, 18 Feb 2000, Peter T. Breuer wrote:
>
> > "A month of sundays ago Mike Galbraith wrote:"
> > > On Thu, 17 Feb 2000, Peter T. Breuer wrote:
> > > > use it once and then throw it away
> > > vi://TheSource/include/linux/init.h/__initdata
> Close but no banana.
> Strike Two:
> Package data in a seperate module.. load/use/eject?

I tried this. No bananas. Maybe I didn't do it right. To check that
theer's no obvious coding mistake, I just put the code of the second
module back into the first module, and it works fine again. It oopsed
after a short while the way I tried it with two modules.

The first module allocated memory for the lists it would use. The
second module used its big static constant translation table to
fill out those arrays. It never finished .. the kernel faulted
after scanning about 270 entries, like this:

Feb 18 22:15:30 bambam kernel: Unable to handle kernel paging
request at virtual address c40bb000
Feb 18 22:15:30 bambam kernel: current->tss.cr3 = 01b0f000, %cr3 = 01b0f000
Feb 18 22:15:30 bambam kernel: *pde = 03d4d063
Feb 18 22:15:30 bambam kernel: *pte = 00000000

It looked to me like the fault one gets from accessing a different
address space. Is c40bb000 in the right range? I never got to the
point of unloading the second module or running kfree.

I don't see any point in trying the memory allocation the other way
round without a clue, as now! Maybe I declared something const in
one module and not extern const in the other, hmm ... or maybe
something got optimized away without the protection of calls to it
showing up in the data analysis. Maybe. Hmm. I need to declare
some variables as "likely to be touched in another module"!

Peter

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

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.151 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site