Bug 1370024

Summary: [abrt] gdb: tdesc_find_feature(): gdb killed by SIGSEGV
Product: [Fedora] Fedora Reporter: 汪明衡 <ifoolb>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: gbenson, jan.kratochvil, palves, pmuldoon, sergiodj, tom
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/e3f519f0be4fd22467294449d8ed51c5afb12c2c
Whiteboard: abrt_hash:585067858a9d73674fc0ddce9bb976fbdff29720;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-20 21:23:12 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: core_backtrace
none
File: dso_list
none
File: environ
none
File: exploitable
none
File: limits
none
File: maps
none
File: mountinfo
none
File: namespaces
none
File: open_fds
none
File: proc_pid_status
none
File: var_log_messages none

Description 汪明衡 2016-08-25 05:35:36 UTC
Description of problem:
I was using gdb as a client to remote debug a binary running on android. It crashed after I typed 'show'.

Version-Release number of selected component:
gdb-7.10.1-31.fc23

Additional info:
reporter:       libreport-2.6.4
backtrace_rating: 4
cmdline:        gdb
crash_function: tdesc_find_feature
executable:     /usr/bin/gdb
global_pid:     16494
kernel:         4.6.7-200.fc23.i686
runlevel:       N 5
type:           CCpp
uid:            1000

Truncated backtrace:
Thread no. 1 (10 frames)
 #0 tdesc_find_feature at ../../gdb/target-descriptions.c:512
 #1 i386_mpx_enabled at ../../gdb/i386-tdep.c:8655
 #2 i386_mpx_info_bounds at ../../gdb/i386-tdep.c:8780
 #3 do_cfunc at ../../gdb/cli/cli-decode.c:105
 #4 cmd_func at ../../gdb/cli/cli-decode.c:1886
 #5 cmd_show_list at ../../gdb/cli/cli-setshow.c:707
 #7 show_command at ../../gdb/cli/cli-cmds.c:227
 #8 do_cfunc at ../../gdb/cli/cli-decode.c:105
 #9 cmd_func at ../../gdb/cli/cli-decode.c:1886
 #10 execute_command at ../../gdb/top.c:468

Comment 1 汪明衡 2016-08-25 05:35:45 UTC
Created attachment 1193867 [details]
File: backtrace

Comment 2 汪明衡 2016-08-25 05:35:47 UTC
Created attachment 1193868 [details]
File: cgroup

Comment 3 汪明衡 2016-08-25 05:35:49 UTC
Created attachment 1193869 [details]
File: core_backtrace

Comment 4 汪明衡 2016-08-25 05:35:51 UTC
Created attachment 1193870 [details]
File: dso_list

Comment 5 汪明衡 2016-08-25 05:35:57 UTC
Created attachment 1193871 [details]
File: environ

Comment 6 汪明衡 2016-08-25 05:35:59 UTC
Created attachment 1193872 [details]
File: exploitable

Comment 7 汪明衡 2016-08-25 05:36:02 UTC
Created attachment 1193873 [details]
File: limits

Comment 8 汪明衡 2016-08-25 05:36:06 UTC
Created attachment 1193874 [details]
File: maps

Comment 9 汪明衡 2016-08-25 05:36:09 UTC
Created attachment 1193875 [details]
File: mountinfo

Comment 10 汪明衡 2016-08-25 05:36:11 UTC
Created attachment 1193876 [details]
File: namespaces

Comment 11 汪明衡 2016-08-25 05:36:15 UTC
Created attachment 1193877 [details]
File: open_fds

Comment 12 汪明衡 2016-08-25 05:36:18 UTC
Created attachment 1193878 [details]
File: proc_pid_status

Comment 13 汪明衡 2016-08-25 05:36:23 UTC
Created attachment 1193879 [details]
File: var_log_messages

Comment 14 Jan Kratochvil 2016-08-25 07:30:47 UTC
tdesc_find_feature() has range 0x...f00 - 0x...f73 but the ABRT backtrace contains:
#0  0x804abacc in tdesc_find_feature ...
I do not understand the ABRT output.

Comment 15 汪明衡 2016-08-25 10:22:19 UTC
This seems to be sort of random thing. I'm not sure if it's reproduceable. But where indicates the function's actual range?

Comment 16 Jan Kratochvil 2016-08-25 12:12:01 UTC
My comment was more for ABRT people although they do not read it here anyway.
The function range is from:

# debuginfo-install gdb
$ gdb gdb
(gdb) disas tdesc_find_feature
Dump of assembler code for function tdesc_find_feature:
   0x0000000000438f00 <+0>:	mov    0x20(%rdi),%rax
[...]
   0x0000000000438f72 <+114>:	retq   
End of assembler dump.
(gdb) 

You can ignore address offsets modulo 0x1000 as all executables incl. GDB are PIE (Position Independent Executable) now in Fedora.

Comment 17 汪明衡 2016-08-26 01:01:36 UTC
well, on this machine, I got:


Reading symbols from gdb...Reading symbols from /usr/lib/debug/usr/bin/gdb.debug...done.
done.
  File "/usr/lib/debug/usr/bin/gdb-gdb.py", line 91
    print "Warning: Cannot find enum type_flag_value type."
                                                          ^
SyntaxError: Missing parentheses in call to 'print'
(gdb) disassemble tdesc_find_feature
Dump of assembler code for function tdesc_find_feature:
   0x00443a90 <+0>:	push   %ebp
   0x00443a91 <+1>:	push   %edi
   0x00443a92 <+2>:	push   %esi
   0x00443a93 <+3>:	push   %ebx
   0x00443a94 <+4>:	call   0xa5380 <__x86.get_pc_thunk.bx>
   0x00443a99 <+9>:	add    $0x4569e3,%ebx
   0x00443a9f <+15>:	lea    -0x2c(%esp),%esp
   0x00443aa3 <+19>:	mov    0x40(%esp),%eax
   0x00443aa7 <+23>:	mov    0x10(%eax),%esi
   0x00443aaa <+26>:	test   %esi,%esi
   0x00443aac <+28>:	je     0x443ae3 <tdesc_find_feature+83>
   0x00443aae <+30>:	mov    (%esi),%eax
   0x00443ab0 <+32>:	test   %eax,%eax
   0x00443ab2 <+34>:	mov    %eax,0x1c(%esp)
   0x00443ab6 <+38>:	je     0x443ae3 <tdesc_find_feature+83>
   0x00443ab8 <+40>:	xor    %ebp,%ebp
   0x00443aba <+42>:	lea    0x0(%esi),%esi
   0x00443ac0 <+48>:	mov    0x8(%esi,%ebp,4),%edi
   0x00443ac4 <+52>:	mov    0x44(%esp),%eax
   0x00443ac8 <+56>:	mov    %eax,0x4(%esp)
   0x00443acc <+60>:	mov    (%edi),%eax
   0x00443ace <+62>:	mov    %eax,(%esp)
   0x00443ad1 <+65>:	call   0xa0530 <strcmp@plt>
   0x00443ad6 <+70>:	test   %eax,%eax
   0x00443ad8 <+72>:	je     0x443af0 <tdesc_find_feature+96>
   0x00443ada <+74>:	lea    0x1(%ebp),%ebp
   0x00443add <+77>:	cmp    0x1c(%esp),%ebp
   0x00443ae1 <+81>:	jne    0x443ac0 <tdesc_find_feature+48>
   0x00443ae3 <+83>:	lea    0x2c(%esp),%esp
   0x00443ae7 <+87>:	xor    %eax,%eax
   0x00443ae9 <+89>:	pop    %ebx
   0x00443aea <+90>:	pop    %esi
   0x00443aeb <+91>:	pop    %edi
   0x00443aec <+92>:	pop    %ebp
   0x00443aed <+93>:	ret    
   0x00443aee <+94>:	xchg   %ax,%ax
   0x00443af0 <+96>:	lea    0x2c(%esp),%esp
   0x00443af4 <+100>:	mov    %edi,%eax
   0x00443af6 <+102>:	pop    %ebx
   0x00443af7 <+103>:	pop    %esi
---Type <return> to continue, or q <return> to quit---
   0x00443af8 <+104>:	pop    %edi
   0x00443af9 <+105>:	pop    %ebp
   0x00443afa <+106>:	ret    
End of assembler dump.
(gdb) 

The funciton's addresses here seem reasonable to me. I know position independent code, but not familiar with PIE. Does it mean the whole executable's addresses can be mapped differently in different environment?

Comment 18 Jan Kratochvil 2016-08-26 05:49:53 UTC
(In reply to 汪明衡 from comment #17)
> well, on this machine, I got:

Ah, I have only now realized you run i686, not x86_64


> I know position
> independent code, but not familiar with PIE. Does it mean the whole
> executable's addresses can be mapped differently in different environment?

Even differently on each run on the same machine:
  https://en.wikipedia.org/wiki/Position-independent_code#PIE

Comment 19 Fedora End Of Life 2016-11-25 09:31:48 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 20 Fedora End Of Life 2016-12-20 21:23:12 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.