[Top][All Lists]

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

Re: Problems with the pager of fatfs

From: Marco Gerards
Subject: Re: Problems with the pager of fatfs
Date: Mon, 22 Apr 2002 18:50:01 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020316

Ludovic Courtès wrote:


After reading from the pager there happens a weird thing:

Breakpoint 1, pager_read_page (pager=0x8055528, page=0, buf=0x128bd7c, writelock=0x128bd80) at pager.c:554
554     {
(gdb) p pager
$1 = (struct user_pager_info *) 0x0
(gdb) p (struct user_pager_info *) pager_get_upi (diskfs_root_node->dn->pager)
$2 = (struct user_pager_info *) 0x8055528

The value in pager seems to be random (now it is zero but sometimes it has other values).

I compile with the following in CFLAGS: -O -g -D_GNU_SOURCE -Wall

I got the same kind of problem. First of all, I think you should not compile
with optimization if you want to debug it with gdb (otherwise you get weird
think). But the problem with those random values could be many things (of
course ;), but what you could check is whether your code is overriding the
stack at some point (for instance, check how much memory is allocated for
your struct dirent and so on).

It was the optimization. I printed pager (pager was in cx), but the value wasn't copied from the stack to cx. Using "next" in gdb solved the problem because after that the
value was loaded.

Just a stupid mistake of me but thanks for your response :-)

Hope it helps.


reply via email to

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