lkml.org 
[lkml]   [2000]   [Feb]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: freeing a static after one use only?
Date
> On Sat, 19 Feb 2000, Peter T. Breuer wrote:
> > ucName[count] = ucIndexName[i]; // write to first from second
> > } else {
> > printk (KERN_INFO "lost key %d: %u\n", count, key);
> > ucName[count] = "????";
> ^^^^
> I've no idea what the rest of your code is doing, but if ucName[] is
> being filled with pointers like this one.. across modules, it doesn't
> matter much if you overran your array or not. (&"whatever" points to
> Nirvana after module is unloaded)

That is true. I never exercised that code. Yes, that code would have
oopsed later when the second module was unloaded. But the second module
has not been unloaded. Both modules are there.

The oops happens in code that works fine in the first module. It has
been transplanted into the second module and both modules are loaded.

I've been doing some more experiments and some thinking.

I don't see how the compiler can avoid giving possibly overlapping
addresses to constant data in different modules. It doesn't know
about the other module. So it must be up to modprobe to remap ...

.. and how can modprobe guarantee to avoid overlaps? It would need
to check the whole map of kernel data structures. Surely it can't
do that reliably? It would have to follow a heuristic rather than
a algorithm for mapping areas, no?

I would almost suspect that modutils don't expect constant data
of more than one page in size. Is that it?

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.027 / U:97.668 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site