Re: recvfrom returns with an error code of 14, EFAULT "Bad Address"

From: Barry Margolin (barry.margolin_at_level3.com)
Date: 07/03/03


Date: Thu, 03 Jul 2003 17:29:36 GMT

In article <480de79d.0307030820.7b959e89@posting.google.com>,
Chris Ritchey <rethnor@yahoo.com> wrote:
>I'll post the code at the bottom of the post. Whenever I try to

It looks like you didn't post the correct code, I don't see any calls to
recvfrom() in the excerpt.

>retreive a udp packet sent via broadcast I get the errorcode
>EFAULT(bad address). The same program sends out the packets without

Sounds like you passed an uninitialized pointer as the buffer argument
argument.

>any complaints but it fails when retreiving, I'm lost as to why it
>would report this error. It returns the number of bytes correctly but

If it returns the number of bytes, then how can it also be reporting an
error code? Errno is only meaningful if recvfrom() returns -1.

>returns the char* buffer as NULL. Any help would be appriciated and I

I don't understand this at all. Buffer is an input parameter, not an
output parameter. You have to pass in the pointer to the place where you
want the data written.

>wouldn't be supprised if I was just missing something simple with
>broacasting as I am still learning some aspects of socket
>programiing.Thanks in advance to all whom reply and here is the code:

Have you looked at the sample code in Unix Network Programming, Vol.1?

-- 
Barry Margolin, barry.margolin@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


Relevant Pages

  • Re: Competition for OraPerf
    ... Here's a couple of details from the report: ... Solid state disks help to increase the CPU time by reducing ... "You have excessive buffer busy waits with 3.1 per transaction. ...
    (comp.databases.oracle.server)
  • Statspack analysis
    ... that users report are now suddenly slower. ... is using 73% of total buffer gets. ... Buffer Gets Executions Gets per Exec % Total Hash Value ... SELECT Aftagenummer_RecNum FROM Aftagenummer WHERE Aftagenumm ...
    (comp.databases.oracle.server)
  • Re: Ready to go nuts
    ... error code if there is a problem with the system. ... if they are not all green then report back what colors they are and perhaps we can help you with the meaning of the code. ... Two of the kids on the block found and asked me to fix an old XPS H266 ... or full system CDs, "98UBD" only lets me use the upgrade CD, on the FULL ...
    (alt.sys.pc-clone.dell)
  • Re: System Reboots
    ... those windows offering to report to Microsoft. ... With this error code the value in parameter 2 (E1BF7D51 in your ... I hope you chose the option to report this error to Microsoft. ...
    (microsoft.public.windowsxp.basics)
  • Re: Ready to go nuts
    ... error code if there is a problem with the system. ... if they are not all green then report back what colors they are and perhaps we can help you with the meaning of the code. ... many times before with no problems, BUT this is my first time on a ... or full system CDs, "98UBD" only lets me use the upgrade CD, on the FULL ...
    (alt.sys.pc-clone.dell)