Bug 124437 - socket.connect can't work correct in lang/gdc
Summary: socket.connect can't work correct in lang/gdc
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dmitry Marakasov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-10 09:40 UTC by Gu Xianjie
Modified: 2008-06-26 23:55 UTC (History)
0 users

See Also:


Attachments
gdc.diff (2.26 KB, patch)
2008-06-20 07:52 UTC, Masanori OZAWA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gu Xianjie 2008-06-10 09:40:00 UTC
In freebsd 7.0bata4/i386 and freebsd8.0current/amd64,socket.connect in gdc's socket.d ,can't work.it cause my program core dump.
for example:
A.d
------------------------
import std.socket;
import std.socketstream;
import std.stdio;

int main()
{
    Socket sock = new Socket(AddressFamily.INET, SocketType.STREAM, 
ProtocolType.IP);
    writefln("Befor");
    sock.connect(new InternetAddress("www.digitalmars.com", 80));
writefln("After");
//  SocketStream ss = new SocketStream(sock);

 //   ss.writeString("GET /d/intro.html HTTP/1.1\r\n"
//       "Host: www.digitalmars.com\r\n"
//       "\r\n");

  //  while(ss.readLine().length) {} //skip header
   // while(!ss.eof())
    {
       char[] line;
//       printf("%.*s\n", ss.readLine());
    }

    return 0;
}
--------------------------------------
it can compile well,but it core dump at sock.connect(new InternetAddress("www.digitalmars.com", 80));

How-To-Repeat: install gdc from ports in freebsd 8.0current.and compile following and run it.
import std.socket;
import std.socketstream;
import std.stdio;

int main()
{
    Socket sock = new Socket(AddressFamily.INET, SocketType.STREAM, 
ProtocolType.IP);
    writefln("Befor");
    sock.connect(new InternetAddress("www.digitalmars.com", 80));
writefln("After");
//  SocketStream ss = new SocketStream(sock);

 //   ss.writeString("GET /d/intro.html HTTP/1.1\r\n"
//       "Host: www.digitalmars.com\r\n"
//       "\r\n");

  //  while(ss.readLine().length) {} //skip header
   // while(!ss.eof())
    {
       char[] line;
//       printf("%.*s\n", ss.readLine());
    }

    return 0;
}
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2008-06-10 13:30:51 UTC
Maintainer of lang/gdc,

Please note that PR ports/124437 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/124437

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2008-06-10 13:30:53 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Masanori OZAWA 2008-06-20 07:52:55 UTC
This problem was fixed.
The attached file, please commit.

P.S.
PR 124567 is also fixed.

-- 
ozawa@ongs.co.jp
Comment 4 Dmitry Marakasov freebsd_committer freebsd_triage 2008-06-26 17:27:35 UTC
Responsible Changed
From-To: freebsd-ports-bugs->amdmi3

I'll take it.
Comment 5 Dmitry Marakasov freebsd_committer freebsd_triage 2008-06-26 23:55:56 UTC
State Changed
From-To: feedback->closed

Committed, with minor changes. Thanks!