Deadloop _Unwind_Backtrace noexcept

Bug #1318478 reported by Joey Ye
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
Fix Released
Medium
Unassigned

Bug Description

Following case runs into a dead loop on all Cortex-M. Correctness of this case is verified on i386. It also works if removing noexcept from foo

Command line:
arm-none-eabi-g++ -mthumb -mcpu=cortex-m3 -std=c++11 -specs=rdimon.specs

#include <unwind.h>
#include <stdio.h>

_Unwind_Reason_Code trace_func(struct _Unwind_Context * context, void* arg) {
  void *ip = (void *)_Unwind_GetIP(context);
  printf("Address: %p\n", ip);
  return _URC_NO_REASON;
}

void bar()
{
        puts("This is in bar");
        _Unwind_Backtrace((_Unwind_Trace_Fn)&trace_func, nullptr); }

void foo() noexcept
{
        bar();
}

int main()
{
        foo();
        return 0;
}

Joey Ye (jinyun-ye)
Changed in gcc-arm-embedded:
status: New → Confirmed
importance: Undecided → Medium
description: updated
Revision history for this message
Jackson Jones (jackson-jones) wrote : Re: [Bug 1318478] [NEW] Deadloop _Unwind_Backtrace noexcept
Download full text (3.6 KiB)

Joey,

Thanks for following up with this. I meant to try and do a simple example
this weekend, but I was working on other issues (trying to get the iMX6 to
drive two monitors with a single IPU (for EMC testing).

We may have a workaround, the boot library has a BOOST_NO_NOEXCEPT macro
that disables all the noexcept methods. I am going to try rebuilding our
app with that and see if the stack traces clear up.

Thanks,

Jackson

On Sun, May 11, 2014 at 9:57 PM, Joey Ye <email address hidden> wrote:

> Public bug reported:
>
> Following case runs into a dead loop on all Cortex-M. Correctness of
> this case is verified on i386. It also works if removing noexcept from
> foo
>
> Command line:
> arm-none-eabi-g++ -mthumb -mcpu=cortex-m3 -std=c++11 -specs=rdimon.specs
>
> #include <unwind.h>
> #include <stdio.h>
>
> _Unwind_Reason_Code trace_func(struct _Unwind_Context * context, void*
> arg) {
> void *ip = (void *)_Unwind_GetIP(context);
> printf("Address: %p\n", ip);
> return _URC_NO_REASON;
> }
>
> void bar()
> {
> puts("This is in bar");
> _Unwind_Backtrace((_Unwind_Trace_Fn)&trace_func, nullptr); }
>
> void foo() noexcept
> {
> bar();
> }
>
> int main()
> {
> foo();
> return 0;
> }
>
> ** Affects: gcc-arm-embedded
> Importance: Medium
> Status: Confirmed
>
> ** Changed in: gcc-arm-embedded
> Status: New => Confirmed
>
> ** Changed in: gcc-arm-embedded
> Importance: Undecided => Medium
>
> ** Description changed:
>
> Following case runs into a dead loop on all Cortex-M. Correctness of
> this case is verified on i386. It also works if removing noexcept from
> foo
> +
> + Command line:
> + arm-none-eabi-g++ -mthumb -mcpu=cortex-m3 -std=c++11 -specs=rdimon.specs
>
> #include <unwind.h>
> #include <stdio.h>
>
> _Unwind_Reason_Code trace_func(struct _Unwind_Context * context, void*
> arg) {
> - void *ip = (void *)_Unwind_GetIP(context);
> - printf("Address: %p\n", ip);
> - return _URC_NO_REASON;
> + void *ip = (void *)_Unwind_GetIP(context);
> + printf("Address: %p\n", ip);
> + return _URC_NO_REASON;
> }
> -
>
> void bar()
> {
> - puts("This is in bar");
> - _Unwind_Backtrace((_Unwind_Trace_Fn)&trace_func, nullptr); }
> + puts("This is in bar");
> + _Unwind_Backtrace((_Unwind_Trace_Fn)&trace_func, nullptr); }
>
> void foo() noexcept
> {
> - bar();
> + bar();
> }
>
> int main()
> {
> - foo();
> - return 0;
> + foo();
> + return 0;
> }
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1318478
>
> Title:
> Deadloop _Unwind_Backtrace noexcept
>
> Status in GNU Tools for ARM Embedded Processors:
> Confirmed
>
> Bug description:
> Following case runs into a dead loop on all Cortex-M. Correctness of
> this case is verified on i386. It also works if removing noexcept from
> foo
>
> Command line:
> arm-none-eabi-g++ -mthumb -mcpu=cortex-m3 -std=c++11 -specs=rdimon.specs
>
> #include <unwind.h>
> #include <stdio.h>
>
> _Unwind_Reason_Code trace_func(struct _Unwind_Conte...

Read more...

Joey Ye (jinyun-ye)
Changed in gcc-arm-embedded:
status: Confirmed → Fix Committed
milestone: none → 4.9-2014-q4-major
Revision history for this message
Denys Yurchenko (denys-l) wrote :

wangzheyu working on a patch to fix this bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56846

Terry Guo (terry.guo)
Changed in gcc-arm-embedded:
milestone: 4.9-2014-q4-major → 4.9-2015-q1-update
Terry Guo (terry.guo)
Changed in gcc-arm-embedded:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.