[MDEV-15781] mariabackup does not produce a nice stacktrace on Linux Created: 2018-04-04  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Backup, Debug, mariabackup
Affects Version/s: 10.2, 10.3
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Major
Reporter: Vladislav Vaintroub Assignee: Vicențiu Ciorbaru
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-16194 Stack trace is not resolved on fulltest2 Open
relates to MDEV-20738 my_addr_resolve passes invalid offset... Open

 Description   

here is an example from the MDEV-15579

addr2line: 'mariabackup': No such file
mariabackup(my_print_stacktrace+0x2e)[0x55e29c08481e]
mariabackup(handle_fatal_signal+0x345)[0x55e29bb81835]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f6e58cc4390]
linux/raise.c:54(__GI_raise)[0x7f6e56f6b428]
stdlib/abort.c:91(__GI_abort)[0x7f6e56f6d02a]
addr2line: 'mariabackup': No such file
mariabackup(+0x9fd6b6)[0x55e29be906b6]
mariabackup(+0xa030f8)[0x55e29be960f8]
mariabackup(+0xa031b2)[0x55e29be961b2]
mariabackup(+0x4324dc)[0x55e29b8c54dc]
mariabackup(+0x408cb7)[0x55e29b89bcb7]
mariabackup(+0x437053)[0x55e29b8ca053]
mariabackup(main+0x185)[0x55e29b8ad145]
csu/libc-start.c:325(__libc_start_main)[0x7f6e56f56830]
addr2line: 'mariabackup': No such file
mariabackup(_start+0x29)[0x55e29b8c1f79]



 Comments   
Comment by Vladislav Vaintroub [ 2018-04-04 ]

unlike mysqld, I think mariabackup does not try to export all symbols. I'm not sure it plays any role, but basically, mariabackup links to the same libraries as mysqld, so that might be the only difference I know.

Comment by Vicențiu Ciorbaru [ 2018-04-04 ]

diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index 274bf05..6ee7566 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -5571,6 +5571,8 @@ static int main_low(char** argv)
                        return(EXIT_FAILURE);
                }
        }
+       my_setwd("/",MYF(MY_WME));
+       abort();
 
        if (!xtrabackup_print_param && !xtrabackup_prepare
            && !strcmp(mysql_data_home, "./")) {

This patch will reproduce the problem.

Generated at Thu Feb 08 08:23:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.