LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-05-2009, 12:59 AM   #1
akshaynm87
LQ Newbie
 
Registered: Apr 2009
Location: Bengaluru
Distribution: Ubuntu 8.10
Posts: 10

Rep: Reputation: 0
Unable to access instance of a device


I have written a shared object library and a device driver.the library will be used to send ioctls to the driver.But i am unable to open the instance of the device(created in '/dev/').
I have a handler for the 'open' call in my driver too.
what could be the problem?

Last edited by akshaynm87; 05-05-2009 at 05:03 AM.
 
Old 05-05-2009, 05:48 AM   #2
bhaslinux
Member
 
Registered: Oct 2003
Location: UnitedKingdom
Distribution: Debian Lenny
Posts: 351

Rep: Reputation: 47
what is the permission of the device file in /dev/XXX do u have open/read/write permissions on the /dev/XXX entry ?
 
Old 05-05-2009, 07:57 AM   #3
akshaynm87
LQ Newbie
 
Registered: Apr 2009
Location: Bengaluru
Distribution: Ubuntu 8.10
Posts: 10

Original Poster
Rep: Reputation: 0
Null pointer dereference

The permissions seem to be fine and i added some prints in the open function call in the driver and found that the function actually gets invoked, does everything ok and returns.
But the call is failing at some point afterwards with a segmentation fault. I checked the log and found this
'BUG : Unable to Handle KERNEL null pointer dereference at 0000000d
IP : [some addr] do_sys_open+0x5e/0xe0 '
So the kernel is failing the call at some point after the 'open' function in the driver returns and before control is transferred back to the application which tried to access the device instance.
 
Old 05-06-2009, 04:44 AM   #4
bhaslinux
Member
 
Registered: Oct 2003
Location: UnitedKingdom
Distribution: Debian Lenny
Posts: 351

Rep: Reputation: 47
Or
the module parameters (char/block) is not initilized properly and it may not be
pointing to the open function you had written. This can cause null pointer exception as above.
Can you post us the code if it is ok to ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding object files to shared objects gopherq Linux - Software 3 06-25-2008 02:21 PM
How to create shared objects and how are they useful jeevanladhe Programming 4 05-01-2007 02:41 PM
How to see of which objects files is particular shared library made of? halturata Programming 4 04-12-2006 02:35 AM
any links on linking, loading shared libraries, shared objects. etc? ananthbv Programming 0 02-03-2005 08:47 AM
powernowd: required sysfs objects not found TLV Debian 0 08-21-2004 10:15 AM


All times are GMT -5. The time now is 04:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration