comp.lang.ada
 help / color / mirror / Atom feed
* stacktrace gan on raspberry pi
@ 2021-05-10 16:01 Björn Lundin
  2021-05-10 16:53 ` Joakim Strandberg
  2021-05-11  7:37 ` Simon Wright
  0 siblings, 2 replies; 8+ messages in thread
From: Björn Lundin @ 2021-05-10 16:01 UTC (permalink / raw)




Hi!
I got a raspberry pi 4 - 8 Gb, with
Ubuntu 20.04 LTS on.

I use the gnat provided by apt -


ubuntu@ubuntu:~/svn/wcs-std/target/message$ gnatls -v

GNATLS 9.3.0
Copyright (C) 1997-2019, Free Software Foundation, Inc.

Source Search Path:
    <Current_Directory>
    /usr/lib/gcc/aarch64-linux-gnu/9/adainclude


Object Search Path:
    <Current_Directory>
    /usr/lib/gcc/aarch64-linux-gnu/9/adalib


Project Search Path:
    <Current_Directory>
    /home/ubuntu/svn/wcs-std/config/gpr
    /home/ubuntu/svn/wcs-std/config/gpr/unix
    /usr/aarch64-linux-gnu/lib/gnat
    /usr/aarch64-linux-gnu/share/gpr
    /usr/share/gpr
    /usr/lib/gnat


I seem to get some info out on a crash

Exception raised : GNU.DB.SQLCLI.INVALID_FUNCTION_SEQUENCE

Message : [Proc=SQLFetch][Server=][State=HY010][unixODBC][Driver 
Manager]Function sequence error
raised GNU.DB.SQLCLI.INVALID_FUNCTION_SEQUENCE : 
[Proc=SQLFetch][Server=][State=HY010][unixODBC][Driver Manager]Function 
sequence error
Call stack traceback locations:
0xaaaab8fc2b84 0xaaaab8fc5924 0xaaaab900c364 0xaaaab90024dc 
0xaaaab8fbab48 0xaaaab8fbe364 0xaaaab8fb9848 0xffffa687c08c 0xaaaab8fb9898


but addr2line gives

ubuntu@ubuntu:~/svn/wcs-std/target/message$ addr2line -e 
./message_utility 0xaaaab8fc2b84 0xaaaab8fc5924 0xaaaab900c364 
0xaaaab90024dc 0xaaaab8fbab48 0xaaaab8fbe364 0xaaaab8fb9848 
0xffffa687c08c 0xaaaab8fb9898
??:0
??:0
??:0
??:0
??:0
??:0
??:0
??:0
??:0


Is stacktracing not implemented (which i suspect it is not) or is there 
another tool to use? (like atos on macos)


-- 
Björn

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

* Re: stacktrace gan on raspberry pi
  2021-05-10 16:01 stacktrace gan on raspberry pi Björn Lundin
@ 2021-05-10 16:53 ` Joakim Strandberg
  2021-05-11  8:28   ` Björn Lundin
  2021-05-11  7:37 ` Simon Wright
  1 sibling, 1 reply; 8+ messages in thread
From: Joakim Strandberg @ 2021-05-10 16:53 UTC (permalink / raw)


måndag 10 maj 2021 kl. 18:01:53 UTC+2 skrev björn lundin:
> Hi! 
> I got a raspberry pi 4 - 8 Gb, with 
> Ubuntu 20.04 LTS on. 
> 
> I use the gnat provided by apt - 
> 
> 
> ubuntu@ubuntu:~/svn/wcs-std/target/message$ gnatls -v 
> 
> GNATLS 9.3.0 
> Copyright (C) 1997-2019, Free Software Foundation, Inc. 
> 
> Source Search Path: 
> <Current_Directory> 
> /usr/lib/gcc/aarch64-linux-gnu/9/adainclude 
> 
> 
> Object Search Path: 
> <Current_Directory> 
> /usr/lib/gcc/aarch64-linux-gnu/9/adalib 
> 
> 
> Project Search Path: 
> <Current_Directory> 
> /home/ubuntu/svn/wcs-std/config/gpr 
> /home/ubuntu/svn/wcs-std/config/gpr/unix 
> /usr/aarch64-linux-gnu/lib/gnat 
> /usr/aarch64-linux-gnu/share/gpr 
> /usr/share/gpr 
> /usr/lib/gnat 
> 
> 
> I seem to get some info out on a crash 
> 
> Exception raised : GNU.DB.SQLCLI.INVALID_FUNCTION_SEQUENCE 
> 
> Message : [Proc=SQLFetch][Server=][State=HY010][unixODBC][Driver 
> Manager]Function sequence error 
> raised GNU.DB.SQLCLI.INVALID_FUNCTION_SEQUENCE : 
> [Proc=SQLFetch][Server=][State=HY010][unixODBC][Driver Manager]Function 
> sequence error 
> Call stack traceback locations: 
> 0xaaaab8fc2b84 0xaaaab8fc5924 0xaaaab900c364 0xaaaab90024dc 
> 0xaaaab8fbab48 0xaaaab8fbe364 0xaaaab8fb9848 0xffffa687c08c 0xaaaab8fb9898 
> 
> 
> but addr2line gives 
> 
> ubuntu@ubuntu:~/svn/wcs-std/target/message$ addr2line -e 
> ./message_utility 0xaaaab8fc2b84 0xaaaab8fc5924 0xaaaab900c364 
> 0xaaaab90024dc 0xaaaab8fbab48 0xaaaab8fbe364 0xaaaab8fb9848 
> 0xffffa687c08c 0xaaaab8fb9898 
> ??:0 
> ??:0 
> ??:0 
> ??:0 
> ??:0 
> ??:0 
> ??:0 
> ??:0 
> ??:0 
> 
> 
> Is stacktracing not implemented (which i suspect it is not) or is there 
> another tool to use? (like atos on macos) 
> 
> 
> -- 
> Björn

Hi Björn,

According to what I've heard but not checked it myself, the Ada-runtime for the GNAT FSF compiler is not compiled with symbol information and it is therefore not possible to get stacktrace from exceptions that originate from inside the standard library. However, you should be able to see the stack-trace from your own code.

Best regards,
Joakim

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

* Re: stacktrace gan on raspberry pi
  2021-05-10 16:01 stacktrace gan on raspberry pi Björn Lundin
  2021-05-10 16:53 ` Joakim Strandberg
@ 2021-05-11  7:37 ` Simon Wright
  2021-05-11  8:27   ` Björn Lundin
  1 sibling, 1 reply; 8+ messages in thread
From: Simon Wright @ 2021-05-11  7:37 UTC (permalink / raw)


Björn Lundin <b.f.lundin@gmail.com> writes:

> Exception raised : GNU.DB.SQLCLI.INVALID_FUNCTION_SEQUENCE
>
> Message : [Proc=SQLFetch][Server=][State=HY010][unixODBC][Driver
> Manager]Function sequence error
> raised GNU.DB.SQLCLI.INVALID_FUNCTION_SEQUENCE :
> [Proc=SQLFetch][Server=][State=HY010][unixODBC][Driver
> Manager]Function sequence error
> Call stack traceback locations:
> 0xaaaab8fc2b84 0xaaaab8fc5924 0xaaaab900c364 0xaaaab90024dc
> 0xaaaab8fbab48 0xaaaab8fbe364 0xaaaab8fb9848 0xffffa687c08c
> 0xaaaab8fb9898
>
>
> but addr2line gives
>
> ubuntu@ubuntu:~/svn/wcs-std/target/message$ addr2line -e
> ./message_utility 0xaaaab8fc2b84 0xaaaab8fc5924 0xaaaab900c364 
> 0xaaaab90024dc 0xaaaab8fbab48 0xaaaab8fbe364 0xaaaab8fb9848
> 0xffffa687c08c 0xaaaab8fb9898
> ??:0
> ??:0
> ??:0
> ??:0
> ??:0
> ??:0
> ??:0
> ??:0
> ??:0

I think you need to compile and link your code with -g to rsp generate &
preserve symbol information. In a GPR, this should do the trick:

   package Builder is
      for Default_Switches ("ada") use ("-g");
   end Builder;

Also, -gnateE should "generate extra information in exception messages".

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

* Re: stacktrace gan on raspberry pi
  2021-05-11  7:37 ` Simon Wright
@ 2021-05-11  8:27   ` Björn Lundin
  2021-05-11  9:51     ` Simon Wright
  0 siblings, 1 reply; 8+ messages in thread
From: Björn Lundin @ 2021-05-11  8:27 UTC (permalink / raw)


Den 2021-05-11 kl. 09:37, skrev Simon Wright:

> 
> I think you need to compile and link your code with -g to rsp generate &
> preserve symbol information. In a GPR, this should do the trick:
> 
>     package Builder is
>        for Default_Switches ("ada") use ("-g");
>     end Builder;
> 
> Also, -gnateE should "generate extra information in exception messages".
> 


Hmm, I do.

If I run with -v for gprbuild I get

ubuntu@ubuntu:~/svn/wcs-std/target/core$ gprbuild -v -j0 -p 
-XUse_Data_Base=1 -P core.gpr "chain2xml"
Changing to object directory of "Core": 
"/home/ubuntu/svn/wcs-std/target/adalib/global_gpr/core/"
/usr/bin/aarch64-linux-gnu-gnatgcc -c -x ada -gnatA -g -gnatoU -gnat12 
-Os -funwind-tables -fstack-check -gnata -gnatw.d -gnatH -gnatJ -gnatwla 
-gnatwJ -gnatwK -gnatwW -gnatye -gnatec=/tmp/GNAT-TEMP-000011.TMP 
-gnatem=/tmp/GNAT-TEMP-000012.TMP 
/home/ubuntu/svn/wcs-std/source/kernel/core/local/chain2xml.adb
chain2xml.adb:47:01: warning: variable "a" is never read and never 
assigned [-gnatwv]
/usr/lib/gprbuild/gprbind chain2xml.bexch
/usr/bin/aarch64-linux-gnu-gnatbind -shared -o b__chain2xml.adb 
/home/ubuntu/svn/wcs-std/target/adalib/global_gpr/core/chain2xml.ali -E 
-x -O
/usr/bin/aarch64-linux-gnu-gnatgcc -c -x ada -gnatA -c -gnatA -gnatWb 
-gnatiw -gnatws -Os -g -funwind-tables -fstack-check=specific 
-mlittle-endian -mabi=lp64 b__chain2xml.adb -o b__chain2xml.o
aarch64-linux-gnu-gnatgcc chain2xml.o @/tmp/GNAT-TEMP-000016.TMP


which saya I use both '-g' and '-E' for compiler and binder.




I have the below (exerp) switches on - which inclues -g and -gnateE in 
the gpr file

On win86/win64/lnx86/lnx64/mac64/aix32 I get the traceback




Platform_Independent_Compiler_Switches :=
                                           ("-g", -- debug
                                            "-gnatoU",
                                            "-gnat12",
                                            "-Os", -- to reduce size
                                            "-funwind-tables",
                                            "-fstack-check",
                                            "-gnata"); --assertions on



Compiler_Dependent_Compiler_Switches := ("-gnatw.d","-gnatH","-gnatJ");


  Simple_Style_Check_Compiler_Switches :=
      ("-gnatye"     --require 'end procedurename'
      );

  Low_Warnings_Compiler_Switches :=
      ("-gnatwla",
       "-gnatwJ",   -- Suppress warnings on obsolescent features
       "-gnatwK",   -- no warnings like '... could be declared constant'
       "-gnatwW"    -- Suppress warnings on wrong low bound assumption
      );

Warning_Switches := Low_Warnings_Compiler_Switches & 
Simple_Style_Check_Compiler_Switches;


  Platform_Dependent_Compiler_Switches := ();

   package Compiler is
      for Default_Switches ("Ada") use
            Platform_Independent_Compiler_Switches &
            Compiler_Dependent_Compiler_Switches &
            Warning_Switches &
            Platform_Dependent_Compiler_Switches;
    end Compiler;


    package Binder is
     case Compiler_Version is
        when others => for Default_Switches ("Ada") use ("-E");
      end case;
    end Binder;



-- 
Björn

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

* Re: stacktrace gan on raspberry pi
  2021-05-10 16:53 ` Joakim Strandberg
@ 2021-05-11  8:28   ` Björn Lundin
  0 siblings, 0 replies; 8+ messages in thread
From: Björn Lundin @ 2021-05-11  8:28 UTC (permalink / raw)


Den 2021-05-10 kl. 18:53, skrev Joakim Strandberg:


>However, you should be able to see the stack-trace from your own code.

Hmm, yes but I don't, see my reply to Simon


-- 
Björn

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

* Re: stacktrace gan on raspberry pi
  2021-05-11  8:27   ` Björn Lundin
@ 2021-05-11  9:51     ` Simon Wright
  2021-05-11 11:17       ` Dmitry A. Kazakov
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Wright @ 2021-05-11  9:51 UTC (permalink / raw)


Björn Lundin <b.f.lundin@gmail.com> writes:

> On win86/win64/lnx86/lnx64/mac64/aix32 I get the traceback

I didn't realise that.

No help to offer, sorry

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

* Re: stacktrace gan on raspberry pi
  2021-05-11  9:51     ` Simon Wright
@ 2021-05-11 11:17       ` Dmitry A. Kazakov
  2021-05-11 16:32         ` Björn Lundin
  0 siblings, 1 reply; 8+ messages in thread
From: Dmitry A. Kazakov @ 2021-05-11 11:17 UTC (permalink / raw)


On 2021-05-11 11:51, Simon Wright wrote:
> Björn Lundin <b.f.lundin@gmail.com> writes:
> 
>> On win86/win64/lnx86/lnx64/mac64/aix32 I get the traceback
> 
> I didn't realise that.
> 
> No help to offer, sorry

AFAIK and all necessary disclaimers...

You cannot get trace under GNAT ARM, because this is what we recently 
requested for our GNAT Pro ARM cross compiler. AdaCore confirmed the 
issue and fixed it for us.

So, in some near future it might arrive at the FSF GNAT.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

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

* Re: stacktrace gan on raspberry pi
  2021-05-11 11:17       ` Dmitry A. Kazakov
@ 2021-05-11 16:32         ` Björn Lundin
  0 siblings, 0 replies; 8+ messages in thread
From: Björn Lundin @ 2021-05-11 16:32 UTC (permalink / raw)


Den 2021-05-11 kl. 13:17, skrev Dmitry A. Kazakov:

> 
> You cannot get trace under GNAT ARM, because this is what we recently 
> requested for our GNAT Pro ARM cross compiler. AdaCore confirmed the 
> issue and fixed it for us.
> 

Ok - good to know


> So, in some near future it might arrive at the FSF GNAT.

That would be nice


-- 
Björn

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

end of thread, other threads:[~2021-05-11 16:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-10 16:01 stacktrace gan on raspberry pi Björn Lundin
2021-05-10 16:53 ` Joakim Strandberg
2021-05-11  8:28   ` Björn Lundin
2021-05-11  7:37 ` Simon Wright
2021-05-11  8:27   ` Björn Lundin
2021-05-11  9:51     ` Simon Wright
2021-05-11 11:17       ` Dmitry A. Kazakov
2021-05-11 16:32         ` Björn Lundin

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