LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-21-2005, 03:51 AM   #1
thegreatest
LQ Newbie
 
Registered: Nov 2005
Posts: 9

Rep: Reputation: 0
Segmentation fault in sock_recvmsg()


Hie
I am using sock_recvmsg(sock,&msg,size,0) for the user to kernel communication...
but when it runs, it gives a segmentation fault...
Kindly help me by knowing what mistake i am doing in it.
Thanks in advance
 
Old 12-22-2005, 02:33 PM   #2
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
There's not much to break, so there's probably something wrong with the buffer (msg) you pass. Check everything related to it carefully.
 
Old 12-23-2005, 01:01 PM   #3
elyk1212
Member
 
Registered: Jan 2005
Location: Chandler, AZ USA
Distribution: Mandrake/Mandriva 10.2
Posts: 186

Rep: Reputation: 30
Yes, as Mara is mentioning.

Most likely you are passing a buffer that has not been allocated memory, or sock_recvmsg is indexing past the allowed memory in the buffer. Please check that the size you are specifying to sock_recvmsg is not larger than sizeof(msg), either that or you are using using char** instead of char*, then unexpected things happen when you do a &msg, or any variation of incorrect dereferencing.

Last edited by elyk1212; 12-23-2005 at 01:02 PM.
 
  


Reply



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
yast segmentation fault, system freezing - nvidia driver at fault? BaltikaTroika SUSE / openSUSE 2 12-02-2005 09:34 AM
Segmentation fault velda.ebel Linux - Security 1 08-08-2005 07:23 PM
Help !!! Segmentation fault mola Linux - Software 3 06-23-2005 11:13 AM
Segmentation fault tejas15_10 Programming 9 06-20-2005 09:12 AM
Segmentation fault tejas15_10 Linux - Newbie 1 06-14-2005 04:44 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:53 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
Open Source Consulting | Domain Registration