Menu

#1200 optional parms to SockRecvFrom aren't optional 4.1.3 64-bit debian 7

v4.2.0
closed
None
none
1
2014-04-15
2013-10-21
No

optional parms to SockRecvFrom aren't optional 4.1.3 64-bit debian 7

And error reporting is horrible.

The issue occurs when calling SockRecvFrom with parms valid until 4.1.2.

According to the book, the flags parameter is optional. However, if it's omitted, all you get is rc=0 from the call.

I had to break out the debugger to see what was going on: the stem.resolveStem() at the beginning of the routine will always return false when the flags parameter is omitted.

Later testing shows an empty flags parameter and .nil address parameter fails with a segfault, a '' address parameter fails with rc=0.

If all parameters are specified (with empty flags parameter), it works as expected.

Reproduce with the attached exec. Run 'udptest4.rex listen' to set up listening UDP socket, then 'udptest4.rex send' to send it a message. This should work.

Run 'udptest4.rex listen fail' to set up listening UDP socket without optional flags parm, then 'udptest4.rex send' to send it a message. This should fail.

Examine the source of udptest4.rex for the other failure modes.

The scheme of returning rc=0 for bad parameters isn't very useful at all: this should raise an identifiable condition.

This seems to be down to changes at rev 9196, which are a little more than bug fixing imho, and could have done with a note in the readme.

1 Attachments

Discussion

  • David Ashley

    David Ashley - 2013-10-21
    • status: open --> pending
    • assigned_to: David Ashley
     
  • David Ashley

    David Ashley - 2013-10-21

    Fixed in SVN revision 9482. The parameter is now optional as documented.

     
  • Rick McGuire

    Rick McGuire - 2013-11-22
    • Group: None --> v4.2.0
     
  • Rick McGuire

    Rick McGuire - 2014-04-15
    • status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel