public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* ada/9535: Datagram socket semantics are wrong
@ 2003-02-01 18:06 simon
  0 siblings, 0 replies; 3+ messages in thread
From: simon @ 2003-02-01 18:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9535
>Category:       ada
>Synopsis:       Datagram socket semantics are wrong
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 01 18:06:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Simon Wright
>Release:        gcc version 3.4 20030201 (experimental)
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
Datagram sockets try to behave like streams -- they will send as many datagrams as necessary to output the data rather than failing if the user sends more than the max datagram size, and read as many as necessary to fill the user buffer.
I believe they should respect the "datagram-ness" of the medium the user has chosen. There are all sorts of problems with the present model (out-of-order arrival etc).
I propose the attached patch.
>How-To-Repeat:
Not applicable.
>Fix:
As per patch.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="g-socket.adb.diff"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="g-socket.adb.diff"

SW5kZXg6IGctc29ja2V0LmFkYgo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvY3Zzcm9vdC9nY2MvZ2Nj
L2djYy9hZGEvZy1zb2NrZXQuYWRiLHYKcmV0cmlldmluZyByZXZpc2lvbiAxLjQKZGlmZiAtdSAt
cjEuNCBnLXNvY2tldC5hZGIKLS0tIGctc29ja2V0LmFkYgkxNCBNYXIgMjAwMiAxMDo1OToyMiAt
MDAwMAkxLjQKKysrIGctc29ja2V0LmFkYgkxIEZlYiAyMDAzIDE4OjAzOjI2IC0wMDAwCkBAIC0x
MTgwLDI3ICsxMTgwLDEyIEBACiAgICAgICBJdGVtICAg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WFtLkZyb20p
OwogICAgZW5kIFJlYWQ7CiAKICAgIC0tLS0tLS0tLS0KQEAgLTE3MzIsMjEgKzE3MTcsMTMgQEAK
ICAgICAgIE1heCAgIDogY29uc3RhbnQgQWRhLlN0cmVhbXMuU3RyZWFtX0VsZW1lbnRfT2Zmc2V0
IDo9IEl0ZW0nTGFzdDsKIAogICAgYmVnaW4KLSAgICAgIGxvb3AKLSAgICAgICAgIFNlbmRfU29j
a2V0Ci0gICAgICAgICAgIChTdHJlYW0uU29ja2V0LAotICAgICAgICAgICAgSXRlbSAoRmlyc3Qg
Li4gTWF4KSwKLSAgICAgICAgICAgIEluZGV4LAotICAgICAgICAgICAgU3RyZWFtLlRvKTsKLQot
ICAgICAgICAgLS0gIEV4aXQgd2hlbiBhbGwgb3IgemVybyBkYXRhIHNlbnQuIFplcm8gbWVhbnMg
dGhhdCB0aGUKLSAgICAgICAgIC0tICBzb2NrZXQgaGFzIGJlZW4gY2xvc2VkIGJ5IHBlZXIuCi0K
LSAgICAgICAgIGV4aXQgd2hlbiBJbmRleCA8IEZpcnN0IG9yIGVsc2UgSW5kZXggPSBNYXg7Ci0K
LSAgICAgICAgIEZpcnN0IDo9IEluZGV4ICsgMTsKLSAgICAgIGVuZCBsb29wOworICAgICAgU2Vu
ZF9Tb2NrZXQKKyAgICAgICAgKFN0cmVhbS5Tb2NrZXQsCisgICAgICAgICBJdGVtIChGaXJzdCAu
LiBNYXgpLAorICAgICAgICAgSW5kZXgsCisgICAgICAgICBTdHJlYW0uVG8pOwogCisgICAgICAt
LSAgSXQgaXMgYW4gZXJyb3IgaWYgbm90IGFsbCBvZiB0aGUgZGF0YSBoYXMgYmVlbiBzZW50Lgog
ICAgICAgaWYgSW5kZXggLz0gTWF4IHRoZW4KICAgICAgICAgIHJhaXNlIFNvY2tldF9FcnJvcjsK
ICAgICAgIGVuZCBpZjsK


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ada/9535: Datagram socket semantics are wrong
@ 2003-05-13  0:36 Dara Hazeghi
  0 siblings, 0 replies; 3+ messages in thread
From: Dara Hazeghi @ 2003-05-13  0:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR ada/9535; it has been noted by GNATS.

From: Dara Hazeghi <dhazeghi@yahoo.com>
To: gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, simon@pushface.org
Cc:  
Subject: Re: ada/9535: Datagram socket semantics are wrong
Date: Mon, 12 May 2003 17:34:34 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- 
 trail&database=gcc&pr=9535
 
 Hello,
 
 you'll probably have better luck getting feedback, if you send this  
 patch to either the gcc-patches mailing lists, or one of the Ada  
 maintainers. To date, Ada people haven't paid much attention to bug  
 reports in GNATs. Cheers,
 
 Dara
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ada/9535: Datagram socket semantics are wrong
@ 2003-03-01  8:06 Simon Wright
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Wright @ 2003-03-01  8:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR ada/9535; it has been noted by GNATS.

From: Simon Wright <simon@pushface.org>
To: gcc-gnats@gcc.gnu.org,  gcc-bugs@gcc.gnu.org,  nobody@gcc.gnu.org, 
 simon@pushface.org,  gcc-prs@gcc.gnu.org
Cc:  
Subject: Re: ada/9535: Datagram socket semantics are wrong
Date: Sat, 01 Mar 2003 07:57:02 +0000

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9535
 
 A clarification (I hope):
 
 At present, you can't use 'Read, 'Write with Stream(UDP_Socket) at all 
 (except for
 elementary types). You can Write a Stream_Element_Array, but you can't 
 Read one unless
 you know beforehand how big it needs to be. The patch I sent allows you 
 to Read into an
 arbitrarily-sized Stream_Element_Array, but you still can't do 'Read, 
 'Write directly.
 
 It's at least arguable that users should not be able to get a Stream at 
 all for a UDP socket (use
 Receive_Socket, Send_Socket instead). That solution would cause us 
 problems on the
 writing side: to avoid multiple OS calls, we
    get the user to stream his data into a memory stream
    get the user to write the contents of the memory stream to your 
 socket's stream in one go.
 
 On the UDP read side (using unpatched GNAT), we
    Receive_Socket into a memory stream
    give the user our memory stream to read from rather than your 
 socket's stream.
 
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-05-13  0:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-01 18:06 ada/9535: Datagram socket semantics are wrong simon
2003-03-01  8:06 Simon Wright
2003-05-13  0:36 Dara Hazeghi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).