D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] create_proc_entry hangs the kernel

 


On Fri, Dec 10, 2010 at 11:53 AM, Giriprasad Deviprasad <g_pr21@xxxxxxxx> wrote:
Hi,

 The following program hangs the kernel, when the insmod on it, is run. Can any one provide ideas why :

I've not done any kernel work for a long time, but a useful debug technique was to insmod the driver from one of the virtual terminals (non framebuffered) then when the kernel panics you should get a dump and a backtrace printed on the VT, for this to work you may need to rebuild your kernel with debug symbols/support.  You can also get it to output with some various sysreq magic key combinations http://en.wikipedia.org/wiki/Magic_SysRq_key such as the last kexec log and the current locks held etc but again needs a certain about of kernel debug symbols to be helpful, just watch out for some of the disk sync combinations, if you manage to corrupt kernel memory (in particular anything related to the disk/filesystem) and you sync that back you can end up needing a reinstall.

If the VT backtrace is too big and is scrolling of the screen, another thing i would do is login to the system from a 2nd pc using a RS232 null modem as the kernel supports outputting crash information on a TTY (with an approprate flag at boot) then at least you can use your scroll abck buffer on the 2nd PC to capture the entire log. It is also possible to run a kernel debugger this way and even set breakpoints and step through things, but the last time i looked this was non trivial to do and not very well supported (but that was years ago now)

Hope thats helpful in someway

Robin


-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq