Wierd bug with 2.2.5 & 2.2.10...

Micahel Zappe (zapman@interlan.net)
Tue, 27 Jul 1999 09:59:11 -0400


I'm currently writing a file system driver for linux, and have run into
a strange bug which is driving me nuts. I have to allocate additional
data for an inode using k/vmalloc, since it will no longer fit in the
page with the inode, and i store the pointer to the data in the
inode->u.generic_ip pointer. I was originally using the 2.2.5 kernel,
and strange bugs started to appear. So i decided to upgrade to 2.2.10
since I saw that some of the memory management code had been updated,
and the bugs remained. I wrote a some memory allocation debugging
routines that add 256 gaurd bytes to either end of the buffer allocated,
and zeroed the entire memory space, just to make sure that i wasn't
overruning the buffer. I then switched from using vmalloc to kmalloc.
On one run when i attempted to free the data, it checked the gaurd
bytes, and found this data at the beginning:

NONE:0,SMB_PROTOCOL_CORE:1,\SMB_PROROCOL_COREPLUS:2,SMB_PROTOCOse_handling:(88,2),64,32;max_xmit:(13,7),96,32;\server_uid:13

Needless to say i found this odd, as if kmalloc had doubly allocated the
memory range I was using. Here are the compiler flags im using (with
egcs-2.91.66):

-g -O2 -Wall -Wstrict-prototypes -DPCU=686 -Winline -pipe
-DEXPORT_SYMTAB -D__SMP__ -DDEBUG -D__KERNEL__ -DMODULE
-I$(SRCBASE)/include -I$(LINUX)/include

I checked my code to make sure i'm not prematurely freeing the memory,
so i know that's not it. Any help you could give would be greatly
appreciated!

Thanks,

Mike

-
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/