Re: freeing a static after one use only?

From: Peter T. Breuer (ptb@it.uc3m.es)
Date: Wed Feb 23 2000 - 17:42:58 EST


"A month of sundays ago Mike Galbraith wrote:"
> Strike Two:
> Package data in a seperate module.. load/use/eject?

As near as I can tell, the problems I was having with this idea seem to
be related to what gcc does when faced with

      static Foo foo;
      ...
      {
      Foo bar[] = { .. masses of constants .. }
      foo = bar;
      ...

as opposed to

      static Foo foo[] = { .. masses of constants .. }
     
The latter is written correctly from the second module. The first form
apparently tries to make itself automatic (best guess, despite the
owww! in the consequences). Sprinkling the word "const" around didn't
help.

It certainly caused weird limited, nonfatal effects. Namely localised
corruption on the array when reading back from it after having written
to a different, kmalloc'ed area. It looks like the array got overwritten
with addresses and data, which makes me think it got used as stack.
Addresses in the range 0xC010.... were common.

The problem is currently "solved".

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/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:34 EST