Bug 1609504
Summary: | gdb is crashing on almost any backtrace | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Tomasz Kłoczko <kloczko.tomasz> | ||||||
Component: | gdb | Assignee: | Sergio Durigan Junior <sergiodj> | ||||||
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | unspecified | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | rawhide | CC: | jan.kratochvil, keiths, kevinb, kloczko.tomasz, pmuldoon, sergiodj, sgehwolf | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | gdb-8.1.90.20180727-38 | Doc Type: | If docs needed, set a value | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2018-07-31 20:15:40 UTC | Type: | Bug | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Tomasz Kłoczko
2018-07-28 17:59:07 UTC
It is Bug 1560010 which is already backported to F-28 but F-29/Rawhide still does not have the fix. (In reply to Jan Kratochvil from comment #1) > It is Bug 1560010 which is already backported to F-28 but F-29/Rawhide still > does not have the fix. You're right, when I backported gdb-8.1.90.20180724 I should have double-checked that the fix was included. I've now just release Fedora GDB 8.1.90.20170727, which does have the fix. Tomasz, could you please give it a try with this new GDB? https://koji.fedoraproject.org/koji/taskinfo?taskID=28674201 Thanks. >Tomasz, could you please give it a try with this new GDB? > https://koji.fedoraproject.org/koji/taskinfo?taskID=28674201 With pleasure. Just downloaded gdb and gdb-headless from the links provided in koji build log. Seems it works without crashing. However I found another issue with gdb. I'm trying to build lftp ad I found that one of the autoconf tests crashes with core. I've extracted from config.log source code of the conftest.c and after compile it crashes as same as during configure script execution however seems it crashes as well gdb. [tkloczko@domek lftp-4.8.3]$ gcc -o conftest -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Os -flto -Wall -Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,--as-needed -flto -fuse-linker-plugin conftest.c conftest.c: In function ‘main’: conftest.c:219:57: warning: suggest parentheses around comparison in operand of ‘|’ [-Wparentheses] if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ conftest.c:221:14: warning: suggest parentheses around comparison in operand of ‘|’ [-Wparentheses] |count != 4) ~~~~~~^~~~ [tkloczko@domek lftp-4.8.3]$ ./conftest *** %n in writable segment detected *** Aborted (core dumped) [tkloczko@domek lftp-4.8.3]$ gdb ./conftest GNU gdb (GDB) Fedora 8.1.90.20180727-37.fc29 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from ./conftest...done. (gdb) r Starting program: /home/tkloczko/rpmbuild/BUILD/lftp-4.8.3/conftest Missing separate debuginfos, use: dnf debuginfo-install glibc-2.27.9000-40.fc29.x86_64 *** %n in writable segment detected *** Program received signal SIGABRT, Aborted. 0x00007ffff7e1e19f in raise () from /lib64/libc.so.6 (gdb) bt terminate called after throwing an instance of 'gdb_exception_RETURN_MASK_ERROR' Aborted (core dumped) [tkloczko@domek lftp-4.8.3]$ Created attachment 1471370 [details]
autoconf generated conftest.c program which crashes gdb.
autoconf generated conftest.c program which crashes gdb.
After installing glibc debuginfo package. (gdb) r Starting program: /home/tkloczko/rpmbuild/BUILD/lftp-4.8.3/conftest warning: Loadable section ".note.gnu.property" outside of ELF segments *** %n in writable segment detected *** Program received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 return ret; (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x00007ffff7e08565 in __GI_abort () at abort.c:79 #2 0x00007ffff7e612a7 in __libc_message (action=action@entry=(do_abort | do_backtrace), fmt=fmt@entry=0x7ffff7f6de97 "%s") at ../sysdeps/posix/libc_fatal.c:181 #3 0x00007ffff7e6136a in __GI___libc_fatal (message=message@entry=0x7ffff7f6f400 "*** %n in writable segment detected ***\n") at ../sysdeps/posix/libc_fatal.c:191 #4 0x00007ffff7e392ce in _IO_vfprintf_internal (s=s@entry=0x7fffffffdd80, format=format@entry=0x5555555580a8 <fmtstring> "%d %n", ap=ap@entry=0x7fffffffdec0) at vfprintf.c:1637 terminate called after throwing an instance of 'gdb_exception_RETURN_MASK_ERROR' Aborted (core dumped) Just in case if it is not obvious what I'm trying to do with lftp .. I'm trying to build it with LTO and seems lftp is OK however that is quite possible that LTO options which I'm passing to the CFLAGS, CXXFLAGS and LDFLAGS may be causing that simple test program is core dumping and additionally core file generated out of executable with such option is crashing gdb as well. In other words here it may be not one but two bugs. Should I raise second ticket against gcc? Created attachment 1471593 [details]
dn.c
gcc -o dn dn.c -Wall -O2;gdb -q -ex r -ex bt ./dn
...
#4 0x00007ffff7e472ce in _IO_vfprintf_internal (s=s@entry=0x7fffffffceb0, format=format@entry=0x4052d0 "%n",
ap=ap@entry=0x7fffffffcff0) at vfprintf.c:1637
terminate called after throwing an instance of 'gdb_exception_RETURN_MASK_ERROR'
Aborted
As GDB cannot backtrace even the crashed GDB on Rawhide: gcc -o dn dn.c -Wall -O2;gdb -q -ex r -ex bt --args gdb -q -ex r -ex bt ./dn ... terminate called after throwing an instance of 'gdb_exception_RETURN_MASK_ERROR' ... terminate called after throwing an instance of 'gdb_exception_RETURN_MASK_ERROR' One can get a backtrace by: dnf copr enable jankratochvil/lldb;dnf install lldb-experimental;gcc -o dn dn.c -Wall -O2;lldb-experimental gdb -o 'r -q -ex r -ex bt ./dn' * thread #1, name = 'gdb', stop reason = signal SIGABRT * frame #0: 0x00007ffff737219f libc.so.6`__GI_raise(sig=6) at raise.c:51 frame #1: 0x00007ffff735c565 libc.so.6`__GI_abort at abort.c:79 frame #2: 0x00007ffff75a89eb libstdc++.so.6`__gnu_cxx::__verbose_terminate_handler() (.cold.1) at vterminate.cc:95 frame #3: 0x00007ffff75aee4c libstdc++.so.6`__cxxabiv1::__terminate(void (*)()) at eh_terminate.cc:47 frame #4: 0x00007ffff75aeea7 libstdc++.so.6`std::terminate() at eh_terminate.cc:57 frame #5: 0x00007ffff75af108 libstdc++.so.6`__cxxabiv1::__cxa_throw(obj=<unavailable>, tinfo=<unavailable>, dest=<unavailable>)(void *)) at eh_throw.cc:95 frame #6: 0x000055555587b682 gdb`::throw_exception_cxx(exception=<unavailable>) at common-exceptions.c:303 frame #7: 0x000055555587b6ef gdb`::throw_it(return_reason, errors, const char *, typedef __va_list_tag __va_list_tag *) [inlined] throw_exception(exception=<unavailable>) at common-exceptions.c:317 frame #8: 0x000055555587b6e4 gdb`::throw_it(reason=<unavailable>, error=<unavailable>, fmt=<unavailable>, ap=<unavailable>) at common-exceptions.c:373 frame #9: 0x000055555587b92c gdb`throw_verror(error=<unavailable>, fmt=<unavailable>, ap=<unavailable>) at common-exceptions.c:379 frame #10: 0x000055555587b9ea gdb`throw_error(error=<unavailable>, fmt=<unavailable>) at common-exceptions.c:394 frame #11: 0x00005555558bbe9d gdb`dwarf_expr_reg_to_entry_parameter(frame_info*, call_site_parameter_kind, call_site_parameter_u, dwarf2_per_cu_data**) at dwarf2loc.c:1296 frame #12: 0x00005555558bc0bc gdb`::value_of_dwarf_reg_entry(type=0x0000555556fee670, frame=0x0000555556fd7190, kind=CALL_SITE_PARAMETER_DWARF_REG, kind_u=<unavailable>) at dwarf2loc.c:1417 frame #13: 0x00005555558bc1db gdb`::value_of_dwarf_block_entry(type=0x0000555556fee670, frame=0x0000555556fd7190, block="U\x1d", block_len=<unavailable>) at dwarf2loc.c:1465 frame #14: 0x00005555558bc2fb gdb`::loclist_read_variable_at_entry(symbol=0x0000555556ff69a0, frame=0x0000555556fd7190) at dwarf2loc.c:4528 frame #15: 0x00005555559d2a18 gdb`read_frame_arg(symbol*, frame_info*, frame_arg*, frame_arg*) at stack.c:370 frame #16: 0x00005555559d3493 gdb`::print_frame_args(func=<unavailable>, frame=0x0000555556fd7190, num=-1, stream=0x0000555556959f20) at stack.c:681 frame #17: 0x00005555559d3eb1 gdb`print_frame_info(frame_info*, int, print_what, int, int) at stack.c:1203 frame #18: 0x00005555559d4b00 gdb`backtrace_command(char const*, int) at stack.c:1790 frame #19: 0x000055555577705a gdb`cmd_func(cmd_list_element*, char const*, int) at cli-decode.c:1857 frame #20: 0x0000555555a1940a gdb`execute_command(char const*, int) at top.c:630 frame #21: 0x0000555555958608 gdb`catch_command_errors(void (*)(char const*, int), char const*, int) at main.c:380 frame #22: 0x0000555555959a02 gdb`gdb_main(captured_main_args*) at main.c:1207 frame #23: 0x00005555556abaff gdb`main(argc=<unavailable>, argv=<unavailable>) at gdb.c:40 frame #24: 0x00007ffff735e0e3 libc.so.6`__libc_start_main(main=(gdb`main at gdb.c:29), argc=7, argv=0x00007fffffffd1b8, init=<unavailable>, fini=<unavailable>, rtld_fini=<unavailable>, stack_end=0x00007fffffffd1a8) at libc-start.c:308 frame #25: 0x00005555556af46a gdb`_start + 42 *** Bug 1609714 has been marked as a duplicate of this bug. *** Would it be possible for you guys to test this scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=28721550 ? I can reproduce the issue with the GDB that's installed via dnf on rawhide, but I cannot reproduce the issue with this scratch build. After some investigation, Jan and I have tracked down the problem to Bug 1609577. I have now triggered a new GDB build on Rawhide which should fix the problem. I'm still leaving the needinfo flag just to make sure that this new build will work for Tomasz and Severin. (In reply to Sergio Durigan Junior from comment #12) > After some investigation, Jan and I have tracked down the problem to Bug > 1609577. I have now triggered a new GDB build on Rawhide which should fix > the problem. I'm still leaving the needinfo flag just to make sure that > this new build will work for Tomasz and Severin. 8.1.90.20180727-38.fc29 seems to work for us. Thanks! java-1.8.0-openjdk builds work in rawhide. Note, that they perform some bt check in %check of our spec[1]: https://apps.fedoraproject.org/koschei/package/java-1.8.0-openjdk?collection=f29 https://koji.fedoraproject.org/koji/taskinfo?taskID=28726317 [1] https://src.fedoraproject.org/rpms/java-1.8.0-openjdk/blob/master/f/java-1.8.0-openjdk.spec#_1893 Looks like new gdb is not crashing. What about second thing related to segv of the autoconf contest test program? glibc or gcc issue? [tkloczko@domek SPECS]$ gdb conftest GNU gdb (GDB) Fedora 8.1.90.20180727-38.fc29 Copyright (C) 2018 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from conftest...done. (gdb) r Starting program: /home/tkloczko/rpmbuild/SPECS/conftest warning: Loadable section ".note.gnu.property" outside of ELF segments *** %n in writable segment detected *** Program received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 return ret; (gdb) bt #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #1 0x00007ffff7e08565 in __GI_abort () at abort.c:79 #2 0x00007ffff7e612a7 in __libc_message (action=action@entry=(do_abort | do_backtrace), fmt=fmt@entry=0x7ffff7f6de97 "%s") at ../sysdeps/posix/libc_fatal.c:181 #3 0x00007ffff7e6136a in __GI___libc_fatal (message=message@entry=0x7ffff7f6f400 "*** %n in writable segment detected ***\n") at ../sysdeps/posix/libc_fatal.c:191 #4 0x00007ffff7e392ce in _IO_vfprintf_internal (s=s@entry=0x7fffffffdda0, format=format@entry=0x5555555580a8 <fmtstring> "%d %n", ap=ap@entry=0x7fffffffdee0) at vfprintf.c:1637 #5 0x00007ffff7ef1d73 in ___vsprintf_chk (s=0x555555558040 <buf> "123 ", flags=1, slen=100, format=0x5555555580a8 <fmtstring> "%d %n", args=args@entry=0x7fffffffdee0) at vsprintf_chk.c:83 #6 0x00007ffff7ef1c9e in ___sprintf_chk (s=<optimized out>, flags=<optimized out>, slen=<optimized out>, format=<optimized out>) at sprintf_chk.c:31 #7 0x00005555555550e5 in sprintf (__fmt=0x5555555580a8 <fmtstring> "%d %n", __s=0x555555558040 <buf> "123 ") at /usr/include/bits/stdio2.h:36 #8 main () at conftest.c:219 (gdb) (In reply to Tomasz Kłoczko from comment #14) > Looks like new gdb is not crashing. Thanks for testing. I am closing this bug then. > What about second thing related to segv of the autoconf contest test program? > glibc or gcc issue? This is a different issue. Does this program crash only inside GDB? (In reply to Severin Gehwolf from comment #13) > (In reply to Sergio Durigan Junior from comment #12) > > After some investigation, Jan and I have tracked down the problem to Bug > > 1609577. I have now triggered a new GDB build on Rawhide which should fix > > the problem. I'm still leaving the needinfo flag just to make sure that > > this new build will work for Tomasz and Severin. > > 8.1.90.20180727-38.fc29 seems to work for us. Thanks! java-1.8.0-openjdk > builds work in rawhide. Note, that they perform some bt check in %check of > our spec[1]: > https://apps.fedoraproject.org/koschei/package/java-1.8.0- > openjdk?collection=f29 > https://koji.fedoraproject.org/koji/taskinfo?taskID=28726317 > > [1] > https://src.fedoraproject.org/rpms/java-1.8.0-openjdk/blob/master/f/java-1.8. > 0-openjdk.spec#_1893 Thanks for testing, Severin. I closed the bug. |