Backtrace in uClibC

Carmelo AMOROSO carmelo.amoroso at st.com
Mon May 2 15:20:57 UTC 2011


On 5/2/2011 4:14 PM, Thomas De Schampheleire wrote:
> Hi Carmelo,
> 

Hi Thomas,

> I tested backtrace on a powerpc system (P4080 family) with
> uClibc-0.9.31, and the test program mentioned in the backtrace man
> page [1].
> 
> The good news is that it seems to work correctly. The raw pointers
> returned by backtrace() are correct and complete.

great ;-)

> Note that, although the source code of libubacktrace mentions the need
> for compiling with '-fexception', it is sufficient to add
> '-funwind-tables'. The latter has the advantage of not changing
> dynamic behavior (i.e. enabling exception code). I think it would be
> good to modify the comment.
> 

ok, I understand your point. I'll test it with -funwind-tables on my
side, and check it.

> Unfortunately, backtrace_symbols() is not yet ok. According to the
> expected output of the example I took from [1], static functions
> simply have no symbolic resolution in the glibc version; only a
> pointer is shown.
> 
> However, with the current uClibc / libgcc implementation, a symbolic
> name *is* shown for static functions, but it is wrong. Referring to
> the example code, the entry referring to myfunc2 is printed as
> 'myfunc'. If you change the code and make myfunc static and myfunc2
> global, then all entries referring to myfunc are printed as 'myfunc2'.
> This is problematic in my opinion.
> 
> I haven't looked into detail into backtrace_symbols yet. I also don't
> know whether the error is in libgcc or libubacktrace. Any thoughts are
> appreciated.
> 

I'll give a look asap.

Really many thanks for your feedback and testing.

> Best regards,
> Thomas
> 
> [1] http://www.kernel.org/doc/man-pages/online/pages/man3/backtrace.3.html
> 

Cheers,
Carmelo

> 
> On Tue, Apr 26, 2011 at 2:14 PM, Carmelo AMOROSO <carmelo.amoroso at st.com> wrote:
>> On 4/25/2011 10:02 AM, Tony Wu wrote:
>>> Hi, Carmelo,
>>>
>>> If commit 7b5b79f is for generic libubacktrace implementation, then, I
>>> think TARGET_sh dependency for UCLIBC_HAS_BACKTRACE should be removed
>>> in extra/Configs/Config.in.
>>>
>>> Tony
>>
>> You're right. Pushed in master.
>>
>> Thanks,
>> Carmelo
>>
>>>
>>> On Fri, Apr 22, 2011 at 7:06 PM, Carmelo AMOROSO <carmelo.amoroso at st.com> wrote:
>>>> On 4/6/2011 8:47 AM, Thomas De Schampheleire wrote:
>>>>> Hi Carmelo,
>>>>>
>>>>> On Tue, Apr 5, 2011 at 7:18 AM, Carmelo AMOROSO <carmelo.amoroso at st.com> wrote:
>>>>>> Hello,
>>>>>> I'm finally back to work on uClibc. I'm preparing some patches to make
>>>>>> backtrace available for all archs, asking you guys to test on your
>>>>>> platforms.
>>>>>
>>>>> I should be able to test it on powerpc.
>>>>>
>>>>> Looking forward to your patches...
>>>>> Thomas
>>>>>
>>>>
>>>> Pushed in master right now. Please let us to know.
>>>>
>>>> Thanks,
>>>> Carmelo
>>>> _______________________________________________
>>>> uClibc mailing list
>>>> uClibc at uclibc.org
>>>> http://lists.busybox.net/mailman/listinfo/uclibc
>>>>
>>
>> _______________________________________________
>> uClibc mailing list
>> uClibc at uclibc.org
>> http://lists.busybox.net/mailman/listinfo/uclibc
>>
> 



More information about the uClibc mailing list