comp.lang.ada
 help / color / mirror / Atom feed
* AWS issue
@ 2008-05-17 21:00 Sebastien Morand
  2008-05-17 23:15 ` Samuel Tardieu
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Sebastien Morand @ 2008-05-17 21:00 UTC (permalink / raw)


Hi,

I've got two problems on AWS, hope there is some aws 2.3 users here. I'm under 
FreeBSD 7.0-STABLE running gnat and gcc 4.3

First, there are lines that doesn't compile, I think it's more an ada issue 
about some think I miss that an AWS issue:

$ gnatmake --GCC=gcc-ada -P *gpr && ./httpd
gcc-ada -c -I- -gnatA 
/mnt/programs/home/sebastien/workspaces/httpd/src/httpd/httpd.adb
httpd.adb:65:06: no selector "Initialize" for private type "Handler" defined at 
aws-services-dispatchers-uri.ads:41
httpd.adb:66:06: no selector "Initialize" for private type "Handler" defined at 
aws-services-dispatchers-virtual_host.ads:39
gnatmake: "/mnt/programs/home/sebastien/workspaces/httpd/src/httpd/httpd.adb" 
compilation error

The lines are the following:
     60      H: AWS.Services.Dispatchers.URI.Handler;
     61      V: AWS.Services.Dispatchers.Virtual_Host.Handler;
     62      C: AWS.Config.Object := AWS.Config.Default_Config;
     63
     64  begin
     65      H.Initialize;
     66      V.Initialize;

What I don't understand is that AWS.Services.Dispatchers.URI.Handler; is a new 
AWS.Dispatchers.Handler and Initialize is defined for AWS.Dispatchers.Handler 
type, so it should be ok.


Second I'm not able to run AWS tests, I got the following for the hello_world demo :
$ ./hello_world
Call me on port 8080, I will stop in 60 seconds...

Execution terminated by unhandled exception
Exception name: AWS.NET.SOCKET_ERROR
Message: Connect : [47] Address family not supported by protocol family
Call stack traceback locations:
0x28188ac9 0x2818a535 0x2819196a 0x28183cac 0x2819bd94 0x2819e324 0x804d184 
0x804d022 0x804c987

So, Could it be some mistakes in my gnat installation about socket?

Sebastien



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

* Re: AWS issue
  2008-05-17 21:00 AWS issue Sebastien Morand
@ 2008-05-17 23:15 ` Samuel Tardieu
  2008-05-18 10:13 ` Per Sandberg
  2008-05-18 17:16 ` Sebastien Morand
  2 siblings, 0 replies; 8+ messages in thread
From: Samuel Tardieu @ 2008-05-17 23:15 UTC (permalink / raw)


>>>>> "Sebastien" == Sebastien Morand <seb.morand@gmail.com> writes:

Sebastien> Exception name: AWS.NET.SOCKET_ERROR
Sebastien> Message: Connect : [47] Address family not supported by
Sebastien> protocol family

Could you open a bug on GCC bugzilla so that we can look at it?
(http://gcc.gnu.org/bugzilla) Can you "strace" the process and attach
the trace to the bug report as well?

  Sam
-- 
Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/



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

* Re: AWS issue
  2008-05-18 10:13 ` Per Sandberg
@ 2008-05-18 10:10   ` Ludovic Brenta
  2008-05-18 11:51   ` Sebastien Morand
  1 sibling, 0 replies; 8+ messages in thread
From: Ludovic Brenta @ 2008-05-18 10:10 UTC (permalink / raw)


On May 18, 12:13 pm, Per Sandberg <per.sandb...@bredband.net> wrote:
> Hi.
> First:
> At a glance it seems like you are missing -gnat05 in the compile command
> so you get and Ada95 compiler instead of Ada (Ada05) compiler.

gnat-4.3 defaults to Ada 2005 unless you specify -gnat95. So, the
problem may be that the OP isn't using gnat-4.3 as he thinks he does.

I compiled AWS 2.5.0 from AdaCore's Subversion repository successfully
the day before yesterday. Initial tests, however, show that wsdl2aws
and aws2wsdl exit with a Constraint_Error. I'll investigate later on.
Right now I'm at the Ada-Belgium barbecue with Jacob Sparre Andersen
and other folks.  We'll be discussing the Beaujolais effect shortly.
Cheers :)

--
Ludovic Brenta.



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

* Re: AWS issue
  2008-05-17 21:00 AWS issue Sebastien Morand
  2008-05-17 23:15 ` Samuel Tardieu
@ 2008-05-18 10:13 ` Per Sandberg
  2008-05-18 10:10   ` Ludovic Brenta
  2008-05-18 11:51   ` Sebastien Morand
  2008-05-18 17:16 ` Sebastien Morand
  2 siblings, 2 replies; 8+ messages in thread
From: Per Sandberg @ 2008-05-18 10:13 UTC (permalink / raw)


Hi.
First:
At a glance it seems like you are missing -gnat05 in the compile command 
so you get and Ada95 compiler instead of Ada (Ada05) compiler.

And the second just a hint:
  3 options to start debugging:
   * Use the debugger.
   * Do an addr2line -e httpd 0x28188ac9 0x2818a535 0x2819196a ..
   * Last in your main program add a handler that proints
     exception
       when e : others =>
           Ada.Text_Io.Put_Line
                (GNAT.Traceback.Symbolic.
                   Symbolic_Traceback(E));

Sebastien Morand wrote:
> Hi,
> 
> I've got two problems on AWS, hope there is some aws 2.3 users here. I'm 
> under FreeBSD 7.0-STABLE running gnat and gcc 4.3
> 
> First, there are lines that doesn't compile, I think it's more an ada 
> issue about some think I miss that an AWS issue:
> 
> $ gnatmake --GCC=gcc-ada -P *gpr && ./httpd
> gcc-ada -c -I- -gnatA 
> /mnt/programs/home/sebastien/workspaces/httpd/src/httpd/httpd.adb
> httpd.adb:65:06: no selector "Initialize" for private type "Handler" 
> defined at aws-services-dispatchers-uri.ads:41
> httpd.adb:66:06: no selector "Initialize" for private type "Handler" 
> defined at aws-services-dispatchers-virtual_host.ads:39
> gnatmake: 
> "/mnt/programs/home/sebastien/workspaces/httpd/src/httpd/httpd.adb" 
> compilation error
> 
> The lines are the following:
>     60      H: AWS.Services.Dispatchers.URI.Handler;
>     61      V: AWS.Services.Dispatchers.Virtual_Host.Handler;
>     62      C: AWS.Config.Object := AWS.Config.Default_Config;
>     63
>     64  begin
>     65      H.Initialize;
>     66      V.Initialize;
> 
> What I don't understand is that AWS.Services.Dispatchers.URI.Handler; is 
> a new AWS.Dispatchers.Handler and Initialize is defined for 
> AWS.Dispatchers.Handler type, so it should be ok.
> 
> 
> Second I'm not able to run AWS tests, I got the following for the 
> hello_world demo :
> $ ./hello_world
> Call me on port 8080, I will stop in 60 seconds...
> 
> Execution terminated by unhandled exception
> Exception name: AWS.NET.SOCKET_ERROR
> Message: Connect : [47] Address family not supported by protocol family
> Call stack traceback locations:
> 0x28188ac9 0x2818a535 0x2819196a 0x28183cac 0x2819bd94 0x2819e324 
> 0x804d184 0x804d022 0x804c987
> 
> So, Could it be some mistakes in my gnat installation about socket?
> 
> Sebastien



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

* Re: AWS issue
  2008-05-18 10:13 ` Per Sandberg
  2008-05-18 10:10   ` Ludovic Brenta
@ 2008-05-18 11:51   ` Sebastien Morand
  2008-05-18 20:46     ` Simon Wright
  2008-05-18 20:59     ` Gautier
  1 sibling, 2 replies; 8+ messages in thread
From: Sebastien Morand @ 2008-05-18 11:51 UTC (permalink / raw)


Debugger for ada is not installed, so I can run the debugger, but the only 
answer I get is exit code 01.

About addr2line, here is what I got:
$ addr2line -e hello_world 0x28188ac9 0x2818a535 0x2819196a 0x28183cac 
0x2819bd94 0x2819e324 0x804d184 0x804d022 0x804c987??:0
??:0
??:0
??:0
??:0
??:0
/mnt/programs/opt/src/AWS-gpl-2.3.0/demos/hello_world.adb:43
/mnt/programs/opt/src/AWS-gpl-2.3.0/.build/release/demos/obj/b~hello_world.adb:447
??:0

The problem is 
/mnt/programs/opt/src/AWS-gpl-2.3.0/.build/release/demos/obj/b~hello_world.adb 
does not exist :-)

So finally I tried the third solutions: Adding
      exception
        when e : others =>
            Ada.Text_Io.Put_Line
                 (GNAT.Traceback.Symbolic.
                    Symbolic_Traceback(E));
at the end of the program.
So I got the two errors:
/usr/bin/ld: Unable to find -laddr2line
/usr/bin/ld: Unable to find -lbfd

So I use addr2line/*.o and bfd/*.o in the FreeBSD source tree to create the lib 
and then...
convert_addresses was missing. I found out in gcc source tree the following:
in ada/adaint.c:
/* Dummy function to satisfy g-trasym.o. See the preprocessor conditional
    just above for a list of native platforms that provide a non-dummy
    version of this procedure in libaddr2line.a.  */
void
convert_addresses (const char *file_name ATTRIBUTE_UNUSED,
		   void *addrs ATTRIBUTE_UNUSED,
		   int n_addr ATTRIBUTE_UNUSED,
		   void *buf ATTRIBUTE_UNUSED,
		   int *len ATTRIBUTE_UNUSED)
{
   *len = 0;
}

So I compile a single file with this function and link with all that stuff.
And compile was fine but no error anymore. I think the empty code of the 
function convert_addresses if the point. If you have a code more appropriate, I 
think I hope I'll be able to get GNAT.Traceback.Symbolic.Symbolic_Traceback(E) 
working.

> Hi.
> First:
> At a glance it seems like you are missing -gnat05 in the compile command 
> so you get and Ada95 compiler instead of Ada (Ada05) compiler.
> 
> And the second just a hint:
>  3 options to start debugging:
>   * Use the debugger.
>   * Do an addr2line -e httpd 0x28188ac9 0x2818a535 0x2819196a ..
>   * Last in your main program add a handler that proints
>     exception
>       when e : others =>
>           Ada.Text_Io.Put_Line
>                (GNAT.Traceback.Symbolic.
>                   Symbolic_Traceback(E));
> 
> Sebastien Morand wrote:
>> Hi,
>>
>> I've got two problems on AWS, hope there is some aws 2.3 users here. 
>> I'm under FreeBSD 7.0-STABLE running gnat and gcc 4.3
>>
>> First, there are lines that doesn't compile, I think it's more an ada 
>> issue about some think I miss that an AWS issue:
>>
>> $ gnatmake --GCC=gcc-ada -P *gpr && ./httpd
>> gcc-ada -c -I- -gnatA 
>> /mnt/programs/home/sebastien/workspaces/httpd/src/httpd/httpd.adb
>> httpd.adb:65:06: no selector "Initialize" for private type "Handler" 
>> defined at aws-services-dispatchers-uri.ads:41
>> httpd.adb:66:06: no selector "Initialize" for private type "Handler" 
>> defined at aws-services-dispatchers-virtual_host.ads:39
>> gnatmake: 
>> "/mnt/programs/home/sebastien/workspaces/httpd/src/httpd/httpd.adb" 
>> compilation error
>>
>> The lines are the following:
>>     60      H: AWS.Services.Dispatchers.URI.Handler;
>>     61      V: AWS.Services.Dispatchers.Virtual_Host.Handler;
>>     62      C: AWS.Config.Object := AWS.Config.Default_Config;
>>     63
>>     64  begin
>>     65      H.Initialize;
>>     66      V.Initialize;
>>
>> What I don't understand is that AWS.Services.Dispatchers.URI.Handler; 
>> is a new AWS.Dispatchers.Handler and Initialize is defined for 
>> AWS.Dispatchers.Handler type, so it should be ok.
>>
>>
>> Second I'm not able to run AWS tests, I got the following for the 
>> hello_world demo :
>> $ ./hello_world
>> Call me on port 8080, I will stop in 60 seconds...
>>
>> Execution terminated by unhandled exception
>> Exception name: AWS.NET.SOCKET_ERROR
>> Message: Connect : [47] Address family not supported by protocol family
>> Call stack traceback locations:
>> 0x28188ac9 0x2818a535 0x2819196a 0x28183cac 0x2819bd94 0x2819e324 
>> 0x804d184 0x804d022 0x804c987
>>
>> So, Could it be some mistakes in my gnat installation about socket?
>>
>> Sebastien



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

* Re: AWS issue
  2008-05-17 21:00 AWS issue Sebastien Morand
  2008-05-17 23:15 ` Samuel Tardieu
  2008-05-18 10:13 ` Per Sandberg
@ 2008-05-18 17:16 ` Sebastien Morand
  2 siblings, 0 replies; 8+ messages in thread
From: Sebastien Morand @ 2008-05-18 17:16 UTC (permalink / raw)


> The lines are the following:
>     60      H: AWS.Services.Dispatchers.URI.Handler;
>     61      V: AWS.Services.Dispatchers.Virtual_Host.Handler;
>     62      C: AWS.Config.Object := AWS.Config.Default_Config;
>     63
>     64  begin
>     65      H.Initialize;
>     66      V.Initialize;
> 
> What I don't understand is that AWS.Services.Dispatchers.URI.Handler; is 
> a new AWS.Dispatchers.Handler and Initialize is defined for 
> AWS.Dispatchers.Handler type, so it should be ok.

I answer to my own question: I read a bit more about Ada.Finalization. Actually, 
Initalize and Finalize Methods are the equivalent of contructor and destructor 
and are automatically called by the compiler.

So my feelings is that the error message could be a bit clearer :-)

I remove the call to these two methods, and it works fine.

Sebastien



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

* Re: AWS issue
  2008-05-18 11:51   ` Sebastien Morand
@ 2008-05-18 20:46     ` Simon Wright
  2008-05-18 20:59     ` Gautier
  1 sibling, 0 replies; 8+ messages in thread
From: Simon Wright @ 2008-05-18 20:46 UTC (permalink / raw)


Sebastien Morand <seb.morand@gmail.com> writes:

> About addr2line, here is what I got:
> $ addr2line -e hello_world 0x28188ac9 0x2818a535 0x2819196a 0x28183cac
> 0x2819bd94 0x2819e324 0x804d184 0x804d022 0x804c987??:0
> ??:0
> ??:0
> ??:0
> ??:0
> ??:0
> /mnt/programs/opt/src/AWS-gpl-2.3.0/demos/hello_world.adb:43
> /mnt/programs/opt/src/AWS-gpl-2.3.0/.build/release/demos/obj/b~hello_world.adb:447
> ??:0
>
> The problem is
> /mnt/programs/opt/src/AWS-gpl-2.3.0/.build/release/demos/obj/b~hello_world.adb
> does not exist :-)

gnatmake would normally leave it there. This is the actual main
program, constructed by gnatbind, which calls your main procedure.

The useful exception point is hello_world.adb:43.

The situation with having only a hex traceback is where our project is
all the time on an embedded system (VxWorks): even if the addr2line
code was available on the target, the symbolic traceback only works
where you have access to the unstripped executable, and we don't have
room for it on flash. So we keep the unstripped executable and run
addr2line (actually a wrapper, powerpc-wrs-vxworks-vxaddr2line) on
that. You do need to be careful with your config management, of
course!



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

* Re: AWS issue
  2008-05-18 11:51   ` Sebastien Morand
  2008-05-18 20:46     ` Simon Wright
@ 2008-05-18 20:59     ` Gautier
  1 sibling, 0 replies; 8+ messages in thread
From: Gautier @ 2008-05-18 20:59 UTC (permalink / raw)


Sebastien Morand:

 > If you have a code more
> appropriate, I think I hope I'll be able to get 
> GNAT.Traceback.Symbolic.Symbolic_Traceback(E) working.

For that you need also the -E binder option. With gnatmake: -bargs -E

__________________________________________________________________
Gautier's Ada programming -- http://sourceforge.net/users/gdemont/

NB: For a direct answer, e-mail address on the Web site!



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

end of thread, other threads:[~2008-05-18 20:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-17 21:00 AWS issue Sebastien Morand
2008-05-17 23:15 ` Samuel Tardieu
2008-05-18 10:13 ` Per Sandberg
2008-05-18 10:10   ` Ludovic Brenta
2008-05-18 11:51   ` Sebastien Morand
2008-05-18 20:46     ` Simon Wright
2008-05-18 20:59     ` Gautier
2008-05-18 17:16 ` Sebastien Morand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox