Re: your mail

From: Michael H. Warfield (mhw@wittsend.com)
Date: Tue Oct 02 2001 - 10:52:31 EST


On Tue, Oct 02, 2001 at 03:29:45PM -0000, Dinesh Gandhewar wrote:

> Hello,
> I have written a linux kernel module. The linux version is 2.2.14.
> In this module I have declared an array of size 2048. If I use this
        array, the execution of this module function causes kernel to
        reboot. If I kmalloc() this array then execution of this module
        function doesnot cause any problem.
> Can you explain this behaviour?

        You didn't say how you declared the array or what the element
size was. If the array elements were larger than a char, by saying an
array of size 2048, do you mean in bytes or in array elements?

        You also didn't say where you called your module from. Was it
in an interrupt handler or at insmod time or from a system call.

        If it was a automatic array on the stack (declared inside the
function and not declared static), you probably overflowed the stack.

> Thnaks,
> Dinesh

        Mike

-- 
 Michael H. Warfield    |  (770) 985-6132   |  mhw@WittsEnd.com
  (The Mad Wizard)      |  (678) 463-0932   |  http://www.wittsend.com/mhw/
  NIC whois:  MHW9      |  An optimist believes we live in the best of all
 PGP Key: 0xDF1DD471    |  possible worlds.  A pessimist is sure of it!

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Oct 07 2001 - 21:00:22 EST