Re: 2.2.11: Complicated memory leak...

Mike Galbraith (mikeg@weiden.de)
Thu, 12 Aug 1999 07:04:03 +0200 (CEST)


On Thu, 12 Aug 1999, Frank Horowitz wrote:

> I'm now deciding between trying to compile under different versions
> of gcc, or (following Mike Galbraith's suggestion) using ikd and
> enabling memleak. I'm open to advice regarding the pain/benefit
> ratio of either course.

If you do decide to try ikd, and use gcc-2.95 (or ~recent snapshot),
you will need the below incremental patch.

I've just build a memleak enabled ac3 kernel with gcc-2.95, and memleak
appears to be working. Tips concerning what to beat upon are welcome.

-Mike

--- linux-2.2.11.ac3.ikd/arch/i386/kernel/process.c.org Thu Aug 12 05:36:06 1999
+++ linux-2.2.11.ac3.ikd/arch/i386/kernel/process.c Thu Aug 12 05:36:48 1999
@@ -707,7 +707,7 @@
* More important, however, is the fact that this allows us much
* more flexibility.
*/
-void __switch_to(struct task_struct *prev, struct task_struct *next)
+void STDCALL(__switch_to(struct task_struct *prev, struct task_struct *next))
{
/* Do the FPU save and set TS if it wasn't set before.. */
unlazy_fpu(prev);
--- linux-2.2.11.ac3.ikd/include/asm-i386/system.h.org Thu Aug 12 05:32:21 1999
+++ linux-2.2.11.ac3.ikd/include/asm-i386/system.h Thu Aug 12 05:33:55 1999
@@ -11,8 +11,7 @@
#ifndef CONFIG_KERNEL_DEBUGGING /* Fix the FASTCALL thing -Andrea */
extern void FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next));
#else
-extern void __switch_to(struct task_struct *prev, struct task_struct *next)
- __attribute__((stdcall));
+extern void STDCALL(__switch_to(struct task_struct *prev, struct task_struct *next));
#endif

#ifdef CONFIG_KERNEL_DEBUGGING /* we can' t use FASTCALL -Andrea */
--- linux-2.2.11.ac3.ikd/include/linux/kernel.h.org Thu Aug 12 05:34:47 1999
+++ linux-2.2.11.ac3.ikd/include/linux/kernel.h Thu Aug 12 05:35:36 1999
@@ -41,8 +41,10 @@

#if defined(__i386__) && !defined(CONFIG_KERNEL_DEBUGGING)
#define FASTCALL(x) x __attribute__((regparm(3)))
+#define STDCALL(x) x
#else
#define FASTCALL(x) x
+#define STDCALL(x) __attribute__((stdcall)) x
#endif

extern void math_error(void);

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