This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: GDB 7.2 gets SIGSEGV when step into a function in a shared library
Sorry for not being clear.
Here is the debug session getting SIGSEGV. xa_fun_in_lib is the
function defined in shared library, and its symbols has been found by
gdb. Step instruction also caused the same issue. The reason that I
attach those disassemble dump is to avoid rounds of ask-give. Let me
know if disassemble of the piece of code is needed. Any idea of why
it happens?
thanks
Breakpoint 1, main (argc=1, argv=0xbef25ca4) at vendor/altestavplayback.c:284
284 CheckErr(res);
3: x/i $pc
=> 0x8d12 <main+78>: ldr r0, [r7, #52] ; 0x34
(gdb) n
286 z = xa_fun_in_lib(10);
3: x/i $pc
=> 0x8d18 <main+84>: mov.w r0, #10
(gdb) s
Program received signal SIGSEGV, Segmentation fault.
0x00008d22 in main (argc=1, argv=0xbef25ca4) at vendor/altestavplayback.c:286
286 z = xa_fun_in_lib(10);
3: x/i $pc
=> 0x8d22 <main+94>: str r3, [r7, #44] ; 0x2c
(gdb) info address xa_fun_in_lib
Symbol "xa_fun_in_lib(int)" is a function at address 0x800036fc.
On Thu, Sep 15, 2011 at 11:13 AM, Yao Qi <yao@codesourcery.com> wrote:
> On 09/15/2011 12:21 AM, Liang Cheng wrote:
>>
>> Hi,
>>
>> The application and library under debug were built for ARM. ÂThe
>> target is running Android OS,
>> and the host is Linux X86 64. ÂAs long as we try to step into the
>> function xa_fun_in_lib, it would
>> cause segmentation fault in gdb. Same thing happened if step the
>> instructions.
>>
>> Here are the experiments I did for this issue, and some notes.
>>
>
> If you are reporting a problem of gdb, please describe the problem as clear
> as possible. ÂA clean and simple debug session is helpful for other people
> here to understand what is your problem. ÂPlease don't mix the experiments
> or your work in the problem description.
>
>>
>> So far I am stuck because of no idea why PC gets messed up. Anyone
>> else the similar issue
>> when trying to debug function in library? ÂAnd any input to how to
>> investigate gdb/gdbserver side
>> also is appreciated. Â(below some other information is dumped).
>>
>
> Due to lack of clear steps you did in gdb, and its output, I have no idea
> what the problem is and how do you get to the problem, except for some wild
> guess,
>
>> (gdb) disassemble /m 0x8d14
>> Dump of assembler code for function main:
>> ....
>> 286 Â Â Â Â z = xa_fun_in_lib(10);
>> => Â0x00008d18<+84>:  Âmov.w  r0, #10
>>  Â0x00008d1c<+88>:  Âblx   0x8628
>>  Â0x00008d20<+92>:  Âmov   r3, r0
>>  Â0x00008d22<+94>:  Âstr   r3, [r7, #44]  ; 0x2c
>
> How do you get SIGSEGV from here? ÂI guess you typed `step' try to step into
> xa_fun_in_lib, but get a SIGSEGV afterwards.
>
> Last but not least, as Hui suggested, please try GDB 7.3 release or GDB CVS
> trunk.
>
> --
> Yao (éå)
>