Bug#564232: gnat-4.4: bind a socket in Ada program fails
Package: gnat-4.4
Version: 4.4.2-5
Severity: important
Socket Binding in Ada seems broken.
It has an severe consequence on test phase in
the build of the package polyorb.
*** server.adb
with Ada.Streams;
with GNAT.Sockets;
with Ada.Text_IO;
procedure Server is
use GNAT.Sockets;
use Ada.Streams;
Address : Sock_Addr_Type;
Server : Socket_Type;
Socket : Socket_Type;
Data : Stream_Element_Array (1 .. 1024);
Last : Stream_Element_Offset;
begin
Address.Addr := Addresses (Get_Host_By_Name (Host_Name), 1);
Address.Port := 3434;
Create_Socket (Server);
Set_Socket_Option
(Server,
Socket_Level,
(Reuse_Address, True));
Ada.Text_IO.Put_Line ("before bind");
Bind_Socket (Server, Address);
Ada.Text_IO.Put_Line ("before listen");
Listen_Socket (Server);
Ada.Text_IO.Put_Line ("before accept");
Accept_Socket (Server, Socket, Address);
Ada.Text_IO.Put_Line ("after accept");
loop
Last := 0;
Receive_Socket (Socket,
Data,
Last);
if Last /= 0 then
Ada.Text_IO.Put_Line ("receive last : " & Last'Img);
end if;
end loop;
end Server;
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: kfreebsd-amd64 (x86_64)
Kernel: kFreeBSD 7.2-1-amd64
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Versions of packages gnat-4.4 depends on:
ii gcc-4.4 4.4.2-8 The GNU C compiler
ii gnat-4.4-base 4.4.2-5 The GNU Compiler Collection (gnat
ii libc0.1 2.10.2-5 Embedded GNU C Library: Shared lib
ii libc0.1-dev 2.10.2-5 Embedded GNU C Library: Developmen
ii libgcc1 1:4.4.2-8 GCC support library
ii libgmp3c2 2:4.3.1+dfsg-3 Multiprecision arithmetic library
ii libgnat-4.4 4.4.2-5 Runtime library for GNU Ada applic
ii libgnatprj4.4 4.4.2-5 GNU Ada Project Manager
ii libgnatvsn4.4 4.4.2-5 GNU Ada compiler version library
ii libmpfr1ldbl 2.4.2-3 multiple precision floating-point
gnat-4.4 recommends no packages.
Versions of packages gnat-4.4 suggests:
ii ada-reference-manual 20021112web-3 The standard describing the Ada 95
pn gnat-4.4-doc <none> (no description available)
-- no debconf information
Reply to: