* [PATCH] glibc: Enable backtrace from abort on ARM
@ 2016-12-08 19:03 Mark Hatle
2016-12-08 19:12 ` [morty] " Mark Hatle
2016-12-09 6:48 ` Khem Raj
0 siblings, 2 replies; 5+ messages in thread
From: Mark Hatle @ 2016-12-08 19:03 UTC (permalink / raw)
To: openembedded-core
From: Yuanjie Huang <yuanjie.huang@windriver.com>
ARM stack frames for abort and raise were limited to the the actual
abort and raise call, such as:
Obtained 4 stack frames.
./test-app(print_trace+0x1c) [0x10a08]
./test-app() [0x10b3c]
/lib/libc.so.6(__default_sa_restorer+0) [0x4adae1e0]
/lib/libc.so.6(gsignal+0xa0) [0x4adacf74]
This is not terribly useful when trying to figure out what function
may have called called the abort, especially when using pthreads.
After the change the trace would now look like:
Obtained 8 stack frames.
./test-app(print_trace+0x1c) [0x10a08]
./test-app() [0x10b3c]
/lib/libc.so.6(__default_sa_restorer+0) [0x4befe1e0]
/lib/libc.so.6(gsignal+0xa0) [0x4befcf74]
/lib/libc.so.6(abort+0x134) [0x4befe358]
./test-app(dummy_function+0x50) [0x10adc]
./test-app(main+0xd4) [0x10c24]
/lib/libc.so.6(__libc_start_main+0x114) [0x4bee7a58]
Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
meta/recipes-core/glibc/glibc.inc | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
index e85c7044a0..358e69be67 100644
--- a/meta/recipes-core/glibc/glibc.inc
+++ b/meta/recipes-core/glibc/glibc.inc
@@ -78,3 +78,9 @@ do_configure_prepend() {
}
GLIBC_ADDONS ?= "nptl,libidn"
+
+# Enable backtrace from abort()
+do_configure_append_arm () {
+ echo "CFLAGS-abort.c = -funwind-tables" >> ${B}/configparms
+ echo "CFLAGS-raise.c = -funwind-tables" >> ${B}/configparms
+}
--
2.11.0.rc1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [morty] [PATCH] glibc: Enable backtrace from abort on ARM
2016-12-08 19:03 [PATCH] glibc: Enable backtrace from abort on ARM Mark Hatle
@ 2016-12-08 19:12 ` Mark Hatle
2016-12-09 6:48 ` Khem Raj
1 sibling, 0 replies; 5+ messages in thread
From: Mark Hatle @ 2016-12-08 19:12 UTC (permalink / raw)
To: openembedded-core
Forgot to mention, also applicable to Morty.
--Mark
On 12/8/16 1:03 PM, Mark Hatle wrote:
> From: Yuanjie Huang <yuanjie.huang@windriver.com>
>
> ARM stack frames for abort and raise were limited to the the actual
> abort and raise call, such as:
>
> Obtained 4 stack frames.
> ./test-app(print_trace+0x1c) [0x10a08]
> ./test-app() [0x10b3c]
> /lib/libc.so.6(__default_sa_restorer+0) [0x4adae1e0]
> /lib/libc.so.6(gsignal+0xa0) [0x4adacf74]
>
> This is not terribly useful when trying to figure out what function
> may have called called the abort, especially when using pthreads.
>
> After the change the trace would now look like:
>
> Obtained 8 stack frames.
> ./test-app(print_trace+0x1c) [0x10a08]
> ./test-app() [0x10b3c]
> /lib/libc.so.6(__default_sa_restorer+0) [0x4befe1e0]
> /lib/libc.so.6(gsignal+0xa0) [0x4befcf74]
> /lib/libc.so.6(abort+0x134) [0x4befe358]
> ./test-app(dummy_function+0x50) [0x10adc]
> ./test-app(main+0xd4) [0x10c24]
> /lib/libc.so.6(__libc_start_main+0x114) [0x4bee7a58]
>
> Signed-off-by: Yuanjie Huang <yuanjie.huang@windriver.com>
> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
> ---
> meta/recipes-core/glibc/glibc.inc | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/meta/recipes-core/glibc/glibc.inc b/meta/recipes-core/glibc/glibc.inc
> index e85c7044a0..358e69be67 100644
> --- a/meta/recipes-core/glibc/glibc.inc
> +++ b/meta/recipes-core/glibc/glibc.inc
> @@ -78,3 +78,9 @@ do_configure_prepend() {
> }
>
> GLIBC_ADDONS ?= "nptl,libidn"
> +
> +# Enable backtrace from abort()
> +do_configure_append_arm () {
> + echo "CFLAGS-abort.c = -funwind-tables" >> ${B}/configparms
> + echo "CFLAGS-raise.c = -funwind-tables" >> ${B}/configparms
> +}
>
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] glibc: Enable backtrace from abort on ARM
2016-12-08 19:03 [PATCH] glibc: Enable backtrace from abort on ARM Mark Hatle
2016-12-08 19:12 ` [morty] " Mark Hatle
@ 2016-12-09 6:48 ` Khem Raj
2016-12-09 17:26 ` Mark Hatle
1 sibling, 1 reply; 5+ messages in thread
From: Khem Raj @ 2016-12-09 6:48 UTC (permalink / raw)
To: Mark Hatle; +Cc: Patches and discussions about the oe-core layer
On Thu, Dec 8, 2016 at 11:03 AM, Mark Hatle <mark.hatle@windriver.com> wrote:
> +do_configure_append_arm () {
> + echo "CFLAGS-abort.c = -funwind-tables" >> ${B}/configparms
> + echo "CFLAGS-raise.c = -funwind-tables" >> ${B}/configparms
> +}
perhaps using -fasynchronous-unwind-tables is better. can you try that out ?
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] glibc: Enable backtrace from abort on ARM
2016-12-09 6:48 ` Khem Raj
@ 2016-12-09 17:26 ` Mark Hatle
2016-12-09 17:36 ` Khem Raj
0 siblings, 1 reply; 5+ messages in thread
From: Mark Hatle @ 2016-12-09 17:26 UTC (permalink / raw)
To: Khem Raj; +Cc: Patches and discussions about the oe-core layer
On 12/9/16 12:48 AM, Khem Raj wrote:
> On Thu, Dec 8, 2016 at 11:03 AM, Mark Hatle <mark.hatle@windriver.com> wrote:
>> +do_configure_append_arm () {
>> + echo "CFLAGS-abort.c = -funwind-tables" >> ${B}/configparms
>> + echo "CFLAGS-raise.c = -funwind-tables" >> ${B}/configparms
>> +}
>
> perhaps using -fasynchronous-unwind-tables is better. can you try that out ?
>
This passed my internal test with the same results.
So either one is fine with me. What is the difference between the options?
--Mark
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] glibc: Enable backtrace from abort on ARM
2016-12-09 17:26 ` Mark Hatle
@ 2016-12-09 17:36 ` Khem Raj
0 siblings, 0 replies; 5+ messages in thread
From: Khem Raj @ 2016-12-09 17:36 UTC (permalink / raw)
To: Mark Hatle; +Cc: Patches and discussions about the oe-core layer
On Fri, Dec 9, 2016 at 9:26 AM, Mark Hatle <mark.hatle@windriver.com> wrote:
> On 12/9/16 12:48 AM, Khem Raj wrote:
>> On Thu, Dec 8, 2016 at 11:03 AM, Mark Hatle <mark.hatle@windriver.com> wrote:
>>> +do_configure_append_arm () {
>>> + echo "CFLAGS-abort.c = -funwind-tables" >> ${B}/configparms
>>> + echo "CFLAGS-raise.c = -funwind-tables" >> ${B}/configparms
>>> +}
>>
>> perhaps using -fasynchronous-unwind-tables is better. can you try that out ?
>>
>
> This passed my internal test with the same results.
>
> So either one is fine with me. What is the difference between the options?
-fasynchronous-unwind-tables when used with -g emits the static data
in dward2 into .debug_frame
sections so your binaries dont bloat. funwind-tables is for generating
static data that is needed for exception handing into .eh_frame.
>
> --Mark
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-12-09 17:37 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-08 19:03 [PATCH] glibc: Enable backtrace from abort on ARM Mark Hatle
2016-12-08 19:12 ` [morty] " Mark Hatle
2016-12-09 6:48 ` Khem Raj
2016-12-09 17:26 ` Mark Hatle
2016-12-09 17:36 ` Khem Raj
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox