[Bug libgcc/69997] GCC5.3.0 _Unwind_ForcedUnwind Always Abort While pthread_exit

2016-03-03 Thread tcliuqiang at msn dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69997

Liu Qiang  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Liu Qiang  ---

The problem has been resolved by changing the gcc configure options:

add configure option --with-sysroot= for gcc second stage building. this option
will disable the inhibit_libc, and then enable MD_FALLBACK_FRAME_STATE_FOR
feature which is needed by unwinder.

[Bug libgcc/69997] GCC5.3.0 _Unwind_ForcedUnwind Always Abort While pthread_exit

2016-03-02 Thread tcliuqiang at msn dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69997

--- Comment #5 from Liu Qiang  ---
Should I try to enable the MD_FALLBACK_FRAME_STATE_FOR for target specific
fallback mechanism?

in file src/gcc-5.3.0/libgcc/config/i386/linux-unwind.h, 

#ifndef inhibit_libc
#define MD_FALLBACK_FRAME_STATE_FOR x86_64_fallback_frame_state

I just want to know if anyone know how to disable the inhibit_libc?


static _Unwind_Reason_Code
uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs)
{
  const struct dwarf_fde *fde;
  const struct dwarf_cie *cie;
  const unsigned char *aug, *insn, *end;

  memset (fs, 0, sizeof (*fs));
  context->args_size = 0;
  context->lsda = 0;

  if (context->ra == 0)
return _URC_END_OF_STACK;

  fde = _Unwind_Find_FDE (context->ra + _Unwind_IsSignalFrame (context) - 1,
  >bases);
  if (fde == NULL)
{
#ifdef MD_FALLBACK_FRAME_STATE_FOR
  /* Couldn't find frame unwind info for this function.  Try a
 target-specific fallback mechanism.  This will necessarily
 not provide a personality routine or LSDA.  */
  return MD_FALLBACK_FRAME_STATE_FOR (context, fs);
#else
  return _URC_END_OF_STACK;
#endif
}

[Bug libgcc/69997] GCC5.3.0 _Unwind_ForcedUnwind Always Abort While pthread_exit

2016-03-01 Thread tcliuqiang at msn dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69997

--- Comment #4 from Liu Qiang  ---
Hello everybody.

I build the powerpc64 crosstoolchain with removing the
'gcc_assert(code==URC_NO_REASON)', and run the new system built by it.  The
program (python3 with thread exiting) terminated by SIGSEGV instead of SIGABRT.
Can anyone help? 


Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x3fffb763b190 (LWP 1667)]
_Unwind_GetGR (index=65, context=0x3fffb7639e40) at
/develop/build/toolchain/src/gcc-4.9.3/libgcc/unwind-dw2.c:244
244 /develop/build/toolchain/src/gcc-4.9.3/libgcc/unwind-dw2.c: No such
file or directory.
(gdb) bt
#0  _Unwind_GetGR (index=65, context=0x3fffb7639e40) at
/develop/build/toolchain/src/gcc-4.9.3/libgcc/unwind-dw2.c:244
#1  frob_update_context (fs=0x3fffb7638ea0, context=0x3fffb7639e40) at
./md-unwind-support.h:335
#2  uw_update_context_1 (context=context@entry=0x3fffb7639e40,
fs=fs@entry=0x3fffb7638ea0) at
/develop/build/toolchain/src/gcc-4.9.3/libgcc/unwind-dw2.c:1494
#3  0x3fffb6e249f0 in uw_init_context_1
(context=context@entry=0x3fffb7639e40,
outer_cfa=outer_cfa@entry=0x3fffb763a4f0, 
outer_ra=0x3fffb7c92e04 <._Unwind_ForcedUnwind+164>) at
/develop/build/toolchain/src/gcc-4.9.3/libgcc/unwind-dw2.c:1587
#4  0x3fffb6e25230 in _Unwind_ForcedUnwind (exc=0x3fffb763b600,
stop=@0x3fffb7ca9270: 0x3fffb7c8f8f0 <.unwind_stop>,
stop_argument=0x3fffb763a7e0)
at /develop/build/toolchain/src/gcc-4.9.3/libgcc/unwind.inc:201
#5  0x3fffb7c92e04 in ._Unwind_ForcedUnwind () from /lib/libpthread.so.0
#6  0x3fffb7c8fb08 in .__pthread_unwind () from /lib/libpthread.so.0
#7  0x3fffb7c84e1c in .pthread_exit () from /lib/libpthread.so.0
#8  0x3fffb7e78044 in PyThread_exit_thread () at
Python/thread_pthread.h:266
#9  0x3fffb7e7e888 in t_bootstrap (boot_raw=0x10115740) at
./Modules/_threadmodule.c:1023
#10 0x3fffb7c83af0 in .start_thread () from /lib/libpthread.so.0
#11 0x3fffb7ad4024 in .__clone () from /lib/libc.so.6
(gdb) info registers 
r0 0x5701392
r1 0x3fffb76387f0   70367525963760
r2 0x3fffb6e43030   70367517618224
r3 0x3fffb7638860   70367525963872
r4 0x0  0
r5 0x3fffb6e25230   70367517495856
r6 0x3fffb6e3b770   70367517587312
r7 0x7fc4f378   2143613816
r8 0x8  8
r9 0x4000   4611686018427387904
r100x0  0
r110x3fffb763a3b0   70367525970864
r120x3fffb7639e40   70367525969472
r130x3fffb76428f0   70367526004976
r140x800576460752303423488
r150x3fffb78fce60   70367528865376
r160x3fffb6e3c000   70367517589504
r170x3fffb763b250   70367525974608
r180x80 8388608
r190x3fffb7ca8020   70367532711968
r200x10115740   269571904
r210x3fffeaf8   70368744172280
r220x3fffb763a4f0   70367525971184
r230x3fffb7639e40   70367525969472
r240x3fffb7638860   70367525963872
r250x3fffb763a3aa   70367525970858
r260x3fffb763a2d0   70367525970640
r270x92 146
r280x3fffb76397c0   70367525967808
r290x3fffb7638ea0   70367525965472
r300x0  0
r310x1  1
pc 0x3fffb6e23a24   0x3fffb6e23a24 
msr0x8002d000   2147667968
cr 0x44424422   1145193506
lr 0x3fffb6e23680   0x3fffb6e23680 
ctr0x3fffb6e237d0   70367517489104
xer0x0  0
orig_r30x3fffb6e3b804   70367517587460
trap   0x300768
(gdb)

[Bug libgcc/69997] GCC5.3.0 _Unwind_ForcedUnwind Always Abort While pthread_exit

2016-03-01 Thread tcliuqiang at msn dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69997

--- Comment #3 from Liu Qiang  ---
Latest info:
uw_frmae_state_for return: 5
_URC_END_OF_STACK = 5,

And I find that it is harmless to remove the gcc_assert(...).
will it be the resolution?


uw_init_context_1 (struct _Unwind_Context *context,
   void *outer_cfa, void *outer_ra)
{
  void *ra = __builtin_extract_return_addr (__builtin_return_address (0));
  _Unwind_FrameState fs;
  _Unwind_SpTmp sp_slot;
  _Unwind_Reason_Code code;

  memset (context, 0, sizeof (struct _Unwind_Context));
  context->ra = ra;
  if (!ASSUME_EXTENDED_UNWIND_CONTEXT)
context->flags = EXTENDED_CONTEXT_BIT;

  code = uw_frame_state_for (context, );
  printf("uw_frmae_state_for return: %d\n", code);
  if(ignore_assert_control)
  {

  }
  else
  {
  gcc_assert (code == _URC_NO_REASON);
  }

[Bug libgcc/69997] GCC5.3.0 _Unwind_ForcedUnwind Always Abort While pthread_exit

2016-02-28 Thread tcliuqiang at msn dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69997

--- Comment #2 from Liu Qiang  ---
yeah, i recommitted the page before the first committing done.

[Bug libgcc/69997] GCC5.3.0 _Unwind_ForcedUnwind Always Abort While pthread_exit

2016-02-28 Thread tcliuqiang at msn dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69997

Liu Qiang  changed:

   What|Removed |Added

   Keywords||EH
   Severity|normal  |critical

[Bug libgcc/69997] GCC5.3.0 _Unwind_ForcedUnwind Always Abort While pthread_exit

2016-02-28 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69997

Andreas Schwab  changed:

   What|Removed |Added

   Severity|blocker |normal

[Bug libgcc/69997] GCC5.3.0 _Unwind_ForcedUnwind Always Abort While pthread_exit

2016-02-28 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69997

--- Comment #1 from Andreas Schwab  ---
*** Bug 69998 has been marked as a duplicate of this bug. ***