Bug 15770 – SocketSet.add OutOfMemoryError on Posix
Status
RESOLVED
Resolution
WORKSFORME
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-03-06T07:16:00Z
Last change time
2017-07-10T22:31:49Z
Assigned to
nobody
Creator
andre
Comments
Comment #0 by andre — 2016-03-06T07:16:58Z
While adding a not alive socket to a SocketSet using method add() there is following error:
ERR core.exception.OutOfMemoryError@src/core/exception.d(679): Memory allocation failed
In some scenarios it is quite hard to find the root cause (not alive socket). An exception like InvalidSocket instead would be quite nice.
Tested on linux.
Comment #1 by dlang-bugzilla — 2017-07-10T22:31:49Z
I can't reproduce this:
/////////////////////////// test.d //////////////////////////
import std.socket;
void main()
{
auto ss = new SocketSet;
auto s = new TcpSocket;
ss.add(s); // succeeds
ss.add(TcpSocket.init); // segmentation fault as expected
}
/////////////////////////////////////////////////////////////
Please reopen if you can provide a reproducible test case.