Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mtr: extend gdb backtace to -frame-arguments all full #2096

Merged

Conversation

grooverdan
Copy link
Member

GDB has supported -frame-arguments and full for a while.

Let's make our bb logs give a little bit more detail on those
hard to reproduce bugs.

Tested with:

$ while [ 1 ]; do sleep 2; killall -SEGV mysqld ; done

and

 mysql-test/mtr innodb_fts.innodb_fts_stopword_charset
...
Thread 27 (Thread 0x7f4d0a8a9640 (LWP 332030)):
#0  0x00007f4d1010823b in fsync () from /lib64/libc.so.6
No symbol table info available.
#1  0x000000000092eb4f in os_file_fsync_posix (file=72) at /home/dan/repos/mariadb-server-10.2/storage/innobase/os/os0file.cc:2526
        ret = <optimized out>
        failures = 0
#2  os_file_flush_func (file=file@entry=72) at /home/dan/repos/mariadb-server-10.2/storage/innobase/os/os0file.cc:2619
        ret = <optimized out>
#3  0x0000000000a6825f in pfs_os_file_flush_func (file={m_file = 72, m_psi = 0x7f4d0eeca980}, src_line=3753, src_file=<optimized out>) at /home/dan/repos/mariadb-server-10.2/storage/innobase/include/os0file.inl:496
        state = {m_flags = 7, m_operation = PSI_FILE_SYNC, m_file = 0x7f4d0eeca980, m_name = 0x0, m_class = 0x28a9900, m_thread = 0x7f4d10242700, m_number_of_bytes = 139968866047176, m_timer_start = 47553245109992, m_timer = 0xbcfdd0 <my_timer_cycles>, m_wait = 0x7f4d10242838}
        locker = 0x7f4d0a8a5480
        result = <optimized out>
#4  fil_ibd_create (space_id=<optimized out>, name=0x7f4cb80700e0 "test/FTS_", '0' <repeats 14 times>, "2d_", '0' <repeats 14 times>, "33_INDEX_2", path=<optimized out>, path@entry=0x7f4cb8030dd0 "./test/FTS_", '0' <repeats 14 times>, "2d_", '0' <repeats 14 times>, "33_INDEX_2.ibd", flags=<optimized out>, flags@entry=33, size=size@entry=4, mode=FIL_ENCRYPTION_DEFAULT, key_id=1) at /home/dan/repos/mariadb-server-10.2/storage/innobase/fil/fil0fil.cc:3753
        request = {m_bpage = 0x0, m_fil_node = 0x0, m_type = 2}
        crypt_data = <optimized out>

@grooverdan
Copy link
Member Author

grooverdan commented Apr 14, 2022

tested with gdb-7.12 (debian-9)

$ podman run --rm -ti --cap-add=CAP_SYS_PTRACE debian:9 
root@8b3e973780e9:/# apt-get update && apt-get install -y gdb
...
root@8b3e973780e9:/# gdb ls
GNU gdb (Debian 7.12-6) 7.12.0.20161007-git
(gdb) r
Starting program: /bin/ls 
warning: Error disabling address space randomization: Function not implemented
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Breakpoint 2, __opendir (name=0x55dc36116cb0 ".") at ../sysdeps/posix/opendir.c:182
182	../sysdeps/posix/opendir.c: No such file or directory.
(gdb) thread apply all bt -frame-arguments all full

Thread 1 (Thread 0x7fe29096ef40 (LWP 595)):
No symbol "frame" in current context.

So syntax not rejected.

@dr-m
Copy link
Contributor

dr-m commented Apr 14, 2022

I am all for this change, provided that you can figure out a fallback for older GDB. On CentOS 7, the GDB might be even older than on Debian 9.

bt full - to include args and locals.

set print sevenbit on
  - it is more useful to be able to see the exact bytes
    (in case something is dumped as a string and not hexadecimal digits)
set print static-members off
  - there are many interesting (non-const) static members
set frame-arguments all
  - even non-printables are useful to see.

Let's make our bb logs give a little bit more detail on those
hard to reproduce bugs.

Tests on rhel7's gdb-7.6.1-120.el7
@grooverdan grooverdan force-pushed the bb-10.2-danielblack-mtr-gdb-more-is-better branch from 0f732f9 to 0a40ef1 Compare April 14, 2022 06:18
@grooverdan grooverdan merged commit 66832e3 into MariaDB:10.2 Apr 14, 2022
@grooverdan grooverdan deleted the bb-10.2-danielblack-mtr-gdb-more-is-better branch April 14, 2022 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants