device driver debug solution/answer plus request for comments

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

 



Hello

Yesterday I was working on a network device driver problem.  This is a
custom built network device driver written by a friend of mine.  The driver
would insmod ok, but when it came time to ifconfig the network device
associated with this driver, I got a bus error and the following oops
message:

Oops: kernel access of bad area, sig: 11
<stuff deleted>
Call backtrace:
FFFF050F C902AD0C C902F878 C00CDBCC C00C3B1C C00C9B84 C00DA880
C00DB6C4 C00FBF84 C0104314 C00BB49C C00BC740 C00BD02C C0003C50
<stuff deleted>

So, the way I approached this problem was to examine the call backtrace
address's.  The FFFF050F address was most likely bogus so I looked at the
next address, C902AD0C.  I examined /proc/ksyms for the closet match to
this address and noticed it was for a routine in the device driver.  That
was expected.   However, the routine was for a function call which didn't
look right.  I thought that when you ifconfig a network device, the kernel
calls the do_ioctl registered routine.  The routine corresponding to
C902AD0C was for a non-ioctal routine.  A routine which isn't even called
from the ioctl routine.  Anyway, I put printk's and a early return (
return(0); ) in the ioctl routine and tried it again.  The code still oop'd
and the printk was not printed out.

I was royally confused.

I finally resorted to diffing the last set of changes and discovered that
the code had disabled interrupts prior to requesting interrupts and then
never reenabled interrupts.  I fixed that and the problem went away.  I am
worried that a problem still exists since that doesn't seem like a good
reason for the problem.

Your comments are welcome.

JD


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