Re: Difference between process & kernel module

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

 



Thanks for the link,

CONFIG_DEBUG_STACKOVERFLOW is available for 386 and ppc64 only, I was looking for the same thing but for arm processor.

Stephane


Brandon Niemczyk wrote:

apparently my post is a bit wrong, see Gaurav's posts.

That said, I found the following in arch/i386/kernel/irq.c

#ifdef CONFIG_DEBUG_STACKOVERFLOW
       /* Debugging check for stack overflow: is there less than 1KB free? */
       {
               long esp;

               __asm__ __volatile__("andl %%esp,%0" :
                                       "=r" (esp) : "0" (THREAD_SIZE - 1));
               if (unlikely(esp < (sizeof(struct thread_info) + STACK_WARN))) {
                       printk("do_IRQ: stack overflow: %ld\n",
                               esp - sizeof(struct thread_info));
                       dump_stack();
               }
       }
#endif

is that what you are looking for?

On Wed, 29 Sep 2004 11:24:49 +0200, Stephane List <slist@xxxxxxxxxxx> wrote:


IIUC a kernel module uses the kernel's stack and heap.  And because of
this modules which use a lot of stack space can cause some serious
problems.





Does Linux provide a mecanism to panic in case of stack or heap overflow ?
If I run Linux in an emulator, is there a thing I could trace to detect
such problem ?

Thanks

Stephane



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/











--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux