On 19/03/2020 08:57, Stephen Hemminger wrote:
On Thu, 19 Mar 2020 08:34:35 +0800
Phil Reid <pr...@electromag.com.au> wrote:

On 19/03/2020 01:45, Stephen Hemminger wrote:
Trying to use libunwind on Arm64 and discovered that it is not working
as expected. Only one function is printed.

On x86 Debian 10 (1.2.1-9)
$ ./bt
^\Signal Quit recevied
#0 0x5640deb47308 (sigquit+0x29)
#1 0x7f4337b8587f (killpg+0x40)
#2 0x7f4337c146f4 (nanosleep+0x14)
#3 0x7f4337c1462a (sleep+0x3a)
#4 0x5640deb4732c (main+0x1f)
#5 0x7f4337b7209b (__libc_start_main+0xeb)
#6 0x564


On Arm64

# /tmp/bt
^\Signal Quit recevied
#0 0xab9f2f927bf0 (sigquit+0x34)
Aborted (core dumped)

I patched gcc libs with the following for an 32bit arm system to get more 
complete backtraces.


diff -Naur a/libsupc++/eh_terminate.cc b/libsupc++/eh_terminate.cc
--- a/libstdc++-v3/libsupc++/eh_terminate.cc    2019-02-28 14:31:50.951261183 
+0800
+++ b/libstdc++-v3/libsupc++/eh_terminate.cc    2019-02-28 14:32:42.040396849 
+0800
@@ -40,7 +40,7 @@
   using namespace __cxxabiv1;

   void
-__cxxabiv1::__terminate (std::terminate_handler handler) throw ()
+__cxxabiv1::__terminate (std::terminate_handler handler)
   {
     __try
       {
diff -Naur a/libsupc++/unwind-cxx.h b/libsupc++/unwind-cxx.h
--- a/libstdc++-v3/libsupc++/unwind-cxx.h       2019-02-28 14:31:50.949253953 
+0800
+++ b/libstdc++-v3/libsupc++/unwind-cxx.h       2019-02-28 14:32:53.073426806 
+0800
@@ -189,8 +189,7 @@

   // Invokes given handler, dying appropriately if the user handler was
   // so inconsiderate as to return.
-extern void __terminate(std::terminate_handler) throw ()
-  __attribute__((__noreturn__));
+extern void __terminate(std::terminate_handler);
   extern void __unexpected(std::unexpected_handler)
     __attribute__((__noreturn__));

But gcc backtrace already works on this platform, I am confused.


Do you me gdb backtrace or the gcc builtin functions?
gdb worked for me ok as well before the patch.

Any which way that's what I had to do.
I think the noreutrn attribute results in something getting
missed thats required for libunwind.



--
Regards
Phil Reid

Reply via email to