[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: network support : memory management problem

From: Vincent Guffens
Subject: Re: network support : memory management problem
Date: Tue, 31 May 2005 18:45:18 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913

it looks like the problem is gone. I changed the way I allocate the memory to hold a block. I changed from:

int load_block ()
        char * p = (char *) grub_malloc(len*sizeof(char));


int load_block ()
        char * p;
p = (char *) grub_malloc(len*sizeof(char));

but still, I would be interested in documentation about the memory layout and the memory management of grub2, if available.

Thanks !

Vincent Guffens wrote:

I sent a similar e-mail yesterday but I think it didn't get through.

I have a working version of the netboot support in grub2. I can issue commands like (seeking in file is not yet possible):

cat (nd0)test.txt
linux (nd0)linux24

but depending on where in the code I free my data blocks, I sometimes get a "free magic is broken" fatal error msg from grub_free().

I found out that if I use the grub_printf() function just before the call to grub_free(), the problem disappears.

That is to say that in my grub_net_close function (the close file function associated with the net binding file system), I do something like:

struct grub_netfs_data * priv =  (struct grub_netfs_data *) file->data;
struct grub_netfs_block *pp, * p = priv->head;


if (p)
  pp = p->next;

  while (p) {
    if ((p->data)){

If I remove the FREEING msg, I have the panic error message, otherwise, everything looks fine. The exact error message is

free magic is broken at 0x85900: 0x0

Does someone has an idea ? Is there some documentation available about the mm in grub2 ?

The full code is available on this web page:

                                Vincent Guffens
                                PhD Student UCL/CESAME
                                tel:   +32 10 47 80 30
Value your freedom, or you will lose it, teaches history.
"Don't bother us with politics," respond those who don't want to learn.
                -- Richard M. Stallman

reply via email to

[Prev in Thread] Current Thread [Next in Thread]