[Touch-packages] [Bug 1418642] Re: GDB hangs at thread join function on Ubuntu 14.10 LE Power

2015-02-27 Thread Thierry FAUCK
Also verified uner utopic gcc version 4.9.1

$ vi s1.cpp
$ g++ s1.cpp -g -std=c++11 -fgnu-tm -lpthread -D D_STM
$ ./a.out
a=400 b=800 c=1200
ubuntu@fauck4:~$ gdb ./a.out
GNU gdb (Ubuntu 7.8-0ubuntu2) 7.8.0.20141001-cvs
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as powerpc64le-linux-gnu.
Type show configuration for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type help.
Type apropos word to search for commands related to word...
Reading symbols from ./a.out...done.
(gdb) run
Starting program: /home/ubuntu/a.out 
[Thread debugging using libthread_db enabled]
Using host libthread_db library /lib/powerpc64le-linux-gnu/libthread_db.so.1.
[New Thread 0x3fffb72bf170 (LWP 15611)]
[New Thread 0x3fffb6abf170 (LWP 15612)]
[New Thread 0x3fffb62bf170 (LWP 15613)]
[New Thread 0x3fffb56af170 (LWP 15614)]
[Thread 0x3fffb6abf170 (LWP 15612) exited]
[Thread 0x3fffb72bf170 (LWP 15611) exited]
[Thread 0x3fffb56af170 (LWP 15614) exited]
a=400 b=800 c=1200
[Thread 0x3fffb62bf170 (LWP 15613) exited]
[Inferior 1 (process 15608) exited normally]

$ gcc --version
gcc (Ubuntu 4.9.1-16ubuntu6) 4.9.1
ubuntu@fauck4:~$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.10
DISTRIB_CODENAME=utopic
DISTRIB_DESCRIPTION=Ubuntu 14.10
$ uname -a
Linux fauck4 3.16.0-20-generic #27-Ubuntu SMP Wed Oct 1 17:24:38 UTC 2014 
ppc64le ppc64le ppc64le GNU/Linux

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to gdb in Ubuntu.
https://bugs.launchpad.net/bugs/1418642

Title:
  GDB hangs at thread join function on Ubuntu 14.10 LE Power

Status in gdb package in Ubuntu:
  Fix Released

Bug description:
  ---Problem Description---
  GDB hangs at thread join function while trying to debug STM (software 
transacational memory) code.

  ---uname output---
  Linux lep8aVM1 3.16.0-7-generic #12-Ubuntu SMP Sat Aug 9 05:05:32 UTC 2014 
ppc64le ppc64le ppc64le GNU/Linux
   
  Machine Type = Power 8 

  ---Steps to Reproduce---

  Compile:
  -
  g++ s1.cpp -g -std=c++11 -fgnu-tm -lpthread -D D_STM

  sample source: s1.cpp
  ---
  root@lep8aVM1:~/p# cat s1.cpp
  #include iostream
  #include thread

  static const auto THR_NUM = 4;
  static const auto ITER_NUM = 1000 * 1000;

  static auto a = 0, b = 0, c = 0;

  static void thr_func()
  {
  for (auto i = 0; i  ITER_NUM; ++i)
  #ifdef D_STM
   __transaction_atomic {
  ++a;
  b += 2;
  c = a + b;
  }
  #else
  ++a;
  b += 2;
  c = a + b;
  #endif
  }

  
  int main(int argc, char *argv[])
  {
std::thread thr[THR_NUM];

for (auto t : thr)
t = std::thread(thr_func);

for (auto t : thr)
t.join();

  std::cout  a=  a   b=  b   c=  c 
  std::endl;

return 0;
  }

  Debug a.out using gdb:
  
  root@lep8aVM1:~/p# gdb ./a.out 
  GNU gdb (Ubuntu 7.8-0ubuntu1) 7.8
  Copyright (C) 2014 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type show copying
  and show warranty for details.
  This GDB was configured as powerpc64le-linux-gnu.
  Type show configuration for configuration details.
  For bug reporting instructions, please see:
  http://www.gnu.org/software/gdb/bugs/.
  Find the GDB manual and other documentation resources online at:
  http://www.gnu.org/software/gdb/documentation/.
  For help, type help.
  Type apropos word to search for commands related to word...
  Reading symbols from ./a.out...done.
  (gdb) run
  Starting program: /root/p/a.out 
  Can't read symbols from system-supplied DSO at 0x3fffb7fa: File truncated
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library 
/lib/powerpc64le-linux-gnu/libthread_db.so.1.

  Breakpoint 1, main (argc=1, argv=0x36b8) at s1.cpp:27
  27{
  (gdb) list
  22#endif
  23}
  24
  25
  26int main(int argc, char *argv[])
  27{
  28std::thread thr[THR_NUM];
  29
  30for (auto t : thr)
  31t = std::thread(thr_func);
  (gdb) n
  28std::thread thr[THR_NUM];
  (gdb) n
  30for (auto t : thr)
  (gdb) n
  

[Touch-packages] [Bug 1418642] Re: GDB hangs at thread join function on Ubuntu 14.10 LE Power

2015-02-27 Thread Thierry FAUCK
Verfied in 14.04.2

g++ s1.cpp -g -std=c++11 -fgnu-tm -lpthread -D D_STM
$ ./a.out
a=400 b=800 c=1200

$ gdb ./a.out
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as powerpc64le-linux-gnu.
Type show configuration for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type help.
Type apropos word to search for commands related to word...
Reading symbols from ./a.out...done.
(gdb) run
Starting program: /home/ubuntu/a.out 
[Thread debugging using libthread_db enabled]
Using host libthread_db library /lib/powerpc64le-linux-gnu/libthread_db.so.1.
[New Thread 0x3fffb72cf170 (LWP 66956)]
[New Thread 0x3fffb6acf170 (LWP 66957)]
[New Thread 0x3fffb62cf170 (LWP 66958)]
[New Thread 0x3fffb56bf170 (LWP 66959)]
[Thread 0x3fffb72cf170 (LWP 66956) exited]
[Thread 0x3fffb6acf170 (LWP 66957) exited]
[Thread 0x3fffb62cf170 (LWP 66958) exited]
[Thread 0x3fffb56bf170 (LWP 66959) exited]
a=400 b=800 c=1200
[Inferior 1 (process 66953) exited normally]

$ uname -a
Linux fauck3 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:50:31 UTC 2014 
ppc64le ppc64le ppc64le GNU/Linux
ubuntu@fauck3:~$ cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION=Ubuntu 14.04.2 LTS

$ gcc --version
gcc-4.8.real (Ubuntu 4.8.2-19ubuntu1) 4.8.2

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to gdb in Ubuntu.
https://bugs.launchpad.net/bugs/1418642

Title:
  GDB hangs at thread join function on Ubuntu 14.10 LE Power

Status in gdb package in Ubuntu:
  Fix Released

Bug description:
  ---Problem Description---
  GDB hangs at thread join function while trying to debug STM (software 
transacational memory) code.

  ---uname output---
  Linux lep8aVM1 3.16.0-7-generic #12-Ubuntu SMP Sat Aug 9 05:05:32 UTC 2014 
ppc64le ppc64le ppc64le GNU/Linux
   
  Machine Type = Power 8 

  ---Steps to Reproduce---

  Compile:
  -
  g++ s1.cpp -g -std=c++11 -fgnu-tm -lpthread -D D_STM

  sample source: s1.cpp
  ---
  root@lep8aVM1:~/p# cat s1.cpp
  #include iostream
  #include thread

  static const auto THR_NUM = 4;
  static const auto ITER_NUM = 1000 * 1000;

  static auto a = 0, b = 0, c = 0;

  static void thr_func()
  {
  for (auto i = 0; i  ITER_NUM; ++i)
  #ifdef D_STM
   __transaction_atomic {
  ++a;
  b += 2;
  c = a + b;
  }
  #else
  ++a;
  b += 2;
  c = a + b;
  #endif
  }

  
  int main(int argc, char *argv[])
  {
std::thread thr[THR_NUM];

for (auto t : thr)
t = std::thread(thr_func);

for (auto t : thr)
t.join();

  std::cout  a=  a   b=  b   c=  c 
  std::endl;

return 0;
  }

  Debug a.out using gdb:
  
  root@lep8aVM1:~/p# gdb ./a.out 
  GNU gdb (Ubuntu 7.8-0ubuntu1) 7.8
  Copyright (C) 2014 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type show copying
  and show warranty for details.
  This GDB was configured as powerpc64le-linux-gnu.
  Type show configuration for configuration details.
  For bug reporting instructions, please see:
  http://www.gnu.org/software/gdb/bugs/.
  Find the GDB manual and other documentation resources online at:
  http://www.gnu.org/software/gdb/documentation/.
  For help, type help.
  Type apropos word to search for commands related to word...
  Reading symbols from ./a.out...done.
  (gdb) run
  Starting program: /root/p/a.out 
  Can't read symbols from system-supplied DSO at 0x3fffb7fa: File truncated
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library 
/lib/powerpc64le-linux-gnu/libthread_db.so.1.

  Breakpoint 1, main (argc=1, argv=0x36b8) at s1.cpp:27
  27{
  (gdb) list
  22#endif
  23}
  24
  25
  26int main(int argc, char *argv[])
  27{
  28std::thread thr[THR_NUM];
  29
  30for (auto t : thr)
  31t = std::thread(thr_func);
  (gdb) n
  28std::thread thr[THR_NUM];
  (gdb) n
  30for (auto t : thr)
  (gdb) n
  31t = 

[Touch-packages] [Bug 1418642] Re: GDB hangs at thread join function on Ubuntu 14.10 LE Power

2015-02-26 Thread Steve Langasek
Reported fixed in vivid.

** Changed in: gdb (Ubuntu)
   Status: Confirmed = Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to gdb in Ubuntu.
https://bugs.launchpad.net/bugs/1418642

Title:
  GDB hangs at thread join function on Ubuntu 14.10 LE Power

Status in gdb package in Ubuntu:
  Fix Released

Bug description:
  ---Problem Description---
  GDB hangs at thread join function while trying to debug STM (software 
transacational memory) code.

  ---uname output---
  Linux lep8aVM1 3.16.0-7-generic #12-Ubuntu SMP Sat Aug 9 05:05:32 UTC 2014 
ppc64le ppc64le ppc64le GNU/Linux
   
  Machine Type = Power 8 

  ---Steps to Reproduce---

  Compile:
  -
  g++ s1.cpp -g -std=c++11 -fgnu-tm -lpthread -D D_STM

  sample source: s1.cpp
  ---
  root@lep8aVM1:~/p# cat s1.cpp
  #include iostream
  #include thread

  static const auto THR_NUM = 4;
  static const auto ITER_NUM = 1000 * 1000;

  static auto a = 0, b = 0, c = 0;

  static void thr_func()
  {
  for (auto i = 0; i  ITER_NUM; ++i)
  #ifdef D_STM
   __transaction_atomic {
  ++a;
  b += 2;
  c = a + b;
  }
  #else
  ++a;
  b += 2;
  c = a + b;
  #endif
  }

  
  int main(int argc, char *argv[])
  {
std::thread thr[THR_NUM];

for (auto t : thr)
t = std::thread(thr_func);

for (auto t : thr)
t.join();

  std::cout  a=  a   b=  b   c=  c 
  std::endl;

return 0;
  }

  Debug a.out using gdb:
  
  root@lep8aVM1:~/p# gdb ./a.out 
  GNU gdb (Ubuntu 7.8-0ubuntu1) 7.8
  Copyright (C) 2014 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type show copying
  and show warranty for details.
  This GDB was configured as powerpc64le-linux-gnu.
  Type show configuration for configuration details.
  For bug reporting instructions, please see:
  http://www.gnu.org/software/gdb/bugs/.
  Find the GDB manual and other documentation resources online at:
  http://www.gnu.org/software/gdb/documentation/.
  For help, type help.
  Type apropos word to search for commands related to word...
  Reading symbols from ./a.out...done.
  (gdb) run
  Starting program: /root/p/a.out 
  Can't read symbols from system-supplied DSO at 0x3fffb7fa: File truncated
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library 
/lib/powerpc64le-linux-gnu/libthread_db.so.1.

  Breakpoint 1, main (argc=1, argv=0x36b8) at s1.cpp:27
  27{
  (gdb) list
  22#endif
  23}
  24
  25
  26int main(int argc, char *argv[])
  27{
  28std::thread thr[THR_NUM];
  29
  30for (auto t : thr)
  31t = std::thread(thr_func);
  (gdb) n
  28std::thread thr[THR_NUM];
  (gdb) n
  30for (auto t : thr)
  (gdb) n
  31t = std::thread(thr_func);
  (gdb) n
  [New Thread 0x3fffb72cf170 (LWP 1278)]
  30for (auto t : thr)
  (gdb) n
  31t = std::thread(thr_func);
  (gdb) n
  [New Thread 0x3fffb6acf170 (LWP 1279)]
  30for (auto t : thr)
  (gdb) n
  31t = std::thread(thr_func);
  (gdb) n
  [New Thread 0x3fffb62cf170 (LWP 1280)]
  30for (auto t : thr)
  (gdb) n
  31t = std::thread(thr_func);
  (gdb) n
  [New Thread 0x3fffb5acf170 (LWP 1281)]
  30for (auto t : thr)
  (gdb) n
  33for (auto t : thr)
  (gdb) n
  34t.join();
  (gdb) n
  n
  n
  n
  Here the gdb seems hangs and does not come out...

  
   The same program been tried on Ubuntu 14.10 x86 VM; gdb could able to come 
out and program ends normally.

  I've found that this issue happens also on upstream gdb and not only
  on ppc64 LE, but also on BE. It is also reproducible without STM.

  This is a regression added recently upstream by commit
  2adfaa28b5ba2fb78ba5113977082c4d04752bd6. I'll continue investigating.

  Found this reduced testcase that reproduces the problem without -fgnu-
  tm flag:

  $ cat test.c
  #include stdlib.h
  #include stdio.h
  #include unistd.h
  #include pthread.h

  void *func(void *arg)
  {
  int i,a;
  for (i = 0; i  100; ++i)
  a++;
  return NULL;
  }

  int main()
  {   
  pthread_t thread;

  pthread_create(thread, NULL, func, NULL);
  pthread_join(thread, NULL);
  return 0;
  }

  $ gcc -g -lpthread test.c -o test

  Found that this commit c1a747c10948e2298083179f4e8aeed8b962e2af fixes
  the problem on upstream gdb. I'm 

[Touch-packages] [Bug 1418642] Re: GDB hangs at thread join function on Ubuntu 14.10 LE Power

2015-02-09 Thread Breno Leitão
** Changed in: gdb (Ubuntu)
   Status: New = Incomplete

** Changed in: gdb (Ubuntu)
   Status: Incomplete = Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to gdb in Ubuntu.
https://bugs.launchpad.net/bugs/1418642

Title:
  GDB hangs at thread join function on Ubuntu 14.10 LE Power

Status in gdb package in Ubuntu:
  Confirmed

Bug description:
  ---Problem Description---
  GDB hangs at thread join function while trying to debug STM (software 
transacational memory) code.

  ---uname output---
  Linux lep8aVM1 3.16.0-7-generic #12-Ubuntu SMP Sat Aug 9 05:05:32 UTC 2014 
ppc64le ppc64le ppc64le GNU/Linux
   
  Machine Type = Power 8 

  ---Steps to Reproduce---

  Compile:
  -
  g++ s1.cpp -g -std=c++11 -fgnu-tm -lpthread -D D_STM

  sample source: s1.cpp
  ---
  root@lep8aVM1:~/p# cat s1.cpp
  #include iostream
  #include thread

  static const auto THR_NUM = 4;
  static const auto ITER_NUM = 1000 * 1000;

  static auto a = 0, b = 0, c = 0;

  static void thr_func()
  {
  for (auto i = 0; i  ITER_NUM; ++i)
  #ifdef D_STM
   __transaction_atomic {
  ++a;
  b += 2;
  c = a + b;
  }
  #else
  ++a;
  b += 2;
  c = a + b;
  #endif
  }

  
  int main(int argc, char *argv[])
  {
std::thread thr[THR_NUM];

for (auto t : thr)
t = std::thread(thr_func);

for (auto t : thr)
t.join();

  std::cout  a=  a   b=  b   c=  c 
  std::endl;

return 0;
  }

  Debug a.out using gdb:
  
  root@lep8aVM1:~/p# gdb ./a.out 
  GNU gdb (Ubuntu 7.8-0ubuntu1) 7.8
  Copyright (C) 2014 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type show copying
  and show warranty for details.
  This GDB was configured as powerpc64le-linux-gnu.
  Type show configuration for configuration details.
  For bug reporting instructions, please see:
  http://www.gnu.org/software/gdb/bugs/.
  Find the GDB manual and other documentation resources online at:
  http://www.gnu.org/software/gdb/documentation/.
  For help, type help.
  Type apropos word to search for commands related to word...
  Reading symbols from ./a.out...done.
  (gdb) run
  Starting program: /root/p/a.out 
  Can't read symbols from system-supplied DSO at 0x3fffb7fa: File truncated
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library 
/lib/powerpc64le-linux-gnu/libthread_db.so.1.

  Breakpoint 1, main (argc=1, argv=0x36b8) at s1.cpp:27
  27{
  (gdb) list
  22#endif
  23}
  24
  25
  26int main(int argc, char *argv[])
  27{
  28std::thread thr[THR_NUM];
  29
  30for (auto t : thr)
  31t = std::thread(thr_func);
  (gdb) n
  28std::thread thr[THR_NUM];
  (gdb) n
  30for (auto t : thr)
  (gdb) n
  31t = std::thread(thr_func);
  (gdb) n
  [New Thread 0x3fffb72cf170 (LWP 1278)]
  30for (auto t : thr)
  (gdb) n
  31t = std::thread(thr_func);
  (gdb) n
  [New Thread 0x3fffb6acf170 (LWP 1279)]
  30for (auto t : thr)
  (gdb) n
  31t = std::thread(thr_func);
  (gdb) n
  [New Thread 0x3fffb62cf170 (LWP 1280)]
  30for (auto t : thr)
  (gdb) n
  31t = std::thread(thr_func);
  (gdb) n
  [New Thread 0x3fffb5acf170 (LWP 1281)]
  30for (auto t : thr)
  (gdb) n
  33for (auto t : thr)
  (gdb) n
  34t.join();
  (gdb) n
  n
  n
  n
  Here the gdb seems hangs and does not come out...

  
   The same program been tried on Ubuntu 14.10 x86 VM; gdb could able to come 
out and program ends normally.

  I've found that this issue happens also on upstream gdb and not only
  on ppc64 LE, but also on BE. It is also reproducible without STM.

  This is a regression added recently upstream by commit
  2adfaa28b5ba2fb78ba5113977082c4d04752bd6. I'll continue investigating.

  Found this reduced testcase that reproduces the problem without -fgnu-
  tm flag:

  $ cat test.c
  #include stdlib.h
  #include stdio.h
  #include unistd.h
  #include pthread.h

  void *func(void *arg)
  {
  int i,a;
  for (i = 0; i  100; ++i)
  a++;
  return NULL;
  }

  int main()
  {   
  pthread_t thread;

  pthread_create(thread, NULL, func, NULL);
  pthread_join(thread, NULL);
  return 0;
  }

  $ gcc -g -lpthread test.c -o test

  Found that this commit c1a747c10948e2298083179f4e8aeed8b962e2af fixes
  the 

[Touch-packages] [Bug 1418642] Re: GDB hangs at thread join function on Ubuntu 14.10 LE Power

2015-02-05 Thread Luciano Chavez
** Package changed: ubuntu = gdb (Ubuntu)

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to gdb in Ubuntu.
https://bugs.launchpad.net/bugs/1418642

Title:
  GDB hangs at thread join function on Ubuntu 14.10 LE Power

Status in gdb package in Ubuntu:
  New

Bug description:
  ---Problem Description---
  GDB hangs at thread join function while trying to debug STM (software 
transacational memory) code.

  ---uname output---
  Linux lep8aVM1 3.16.0-7-generic #12-Ubuntu SMP Sat Aug 9 05:05:32 UTC 2014 
ppc64le ppc64le ppc64le GNU/Linux
   
  Machine Type = Power 8 

  ---Steps to Reproduce---

  Compile:
  -
  g++ s1.cpp -g -std=c++11 -fgnu-tm -lpthread -D D_STM

  sample source: s1.cpp
  ---
  root@lep8aVM1:~/p# cat s1.cpp
  #include iostream
  #include thread

  static const auto THR_NUM = 4;
  static const auto ITER_NUM = 1000 * 1000;

  static auto a = 0, b = 0, c = 0;

  static void thr_func()
  {
  for (auto i = 0; i  ITER_NUM; ++i)
  #ifdef D_STM
   __transaction_atomic {
  ++a;
  b += 2;
  c = a + b;
  }
  #else
  ++a;
  b += 2;
  c = a + b;
  #endif
  }

  
  int main(int argc, char *argv[])
  {
std::thread thr[THR_NUM];

for (auto t : thr)
t = std::thread(thr_func);

for (auto t : thr)
t.join();

  std::cout  a=  a   b=  b   c=  c 
  std::endl;

return 0;
  }

  Debug a.out using gdb:
  
  root@lep8aVM1:~/p# gdb ./a.out 
  GNU gdb (Ubuntu 7.8-0ubuntu1) 7.8
  Copyright (C) 2014 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.  Type show copying
  and show warranty for details.
  This GDB was configured as powerpc64le-linux-gnu.
  Type show configuration for configuration details.
  For bug reporting instructions, please see:
  http://www.gnu.org/software/gdb/bugs/.
  Find the GDB manual and other documentation resources online at:
  http://www.gnu.org/software/gdb/documentation/.
  For help, type help.
  Type apropos word to search for commands related to word...
  Reading symbols from ./a.out...done.
  (gdb) run
  Starting program: /root/p/a.out 
  Can't read symbols from system-supplied DSO at 0x3fffb7fa: File truncated
  [Thread debugging using libthread_db enabled]
  Using host libthread_db library 
/lib/powerpc64le-linux-gnu/libthread_db.so.1.

  Breakpoint 1, main (argc=1, argv=0x36b8) at s1.cpp:27
  27{
  (gdb) list
  22#endif
  23}
  24
  25
  26int main(int argc, char *argv[])
  27{
  28std::thread thr[THR_NUM];
  29
  30for (auto t : thr)
  31t = std::thread(thr_func);
  (gdb) n
  28std::thread thr[THR_NUM];
  (gdb) n
  30for (auto t : thr)
  (gdb) n
  31t = std::thread(thr_func);
  (gdb) n
  [New Thread 0x3fffb72cf170 (LWP 1278)]
  30for (auto t : thr)
  (gdb) n
  31t = std::thread(thr_func);
  (gdb) n
  [New Thread 0x3fffb6acf170 (LWP 1279)]
  30for (auto t : thr)
  (gdb) n
  31t = std::thread(thr_func);
  (gdb) n
  [New Thread 0x3fffb62cf170 (LWP 1280)]
  30for (auto t : thr)
  (gdb) n
  31t = std::thread(thr_func);
  (gdb) n
  [New Thread 0x3fffb5acf170 (LWP 1281)]
  30for (auto t : thr)
  (gdb) n
  33for (auto t : thr)
  (gdb) n
  34t.join();
  (gdb) n
  n
  n
  n
  Here the gdb seems hangs and does not come out...

  
   The same program been tried on Ubuntu 14.10 x86 VM; gdb could able to come 
out and program ends normally.

  I've found that this issue happens also on upstream gdb and not only
  on ppc64 LE, but also on BE. It is also reproducible without STM.

  This is a regression added recently upstream by commit
  2adfaa28b5ba2fb78ba5113977082c4d04752bd6. I'll continue investigating.

  Found this reduced testcase that reproduces the problem without -fgnu-
  tm flag:

  $ cat test.c
  #include stdlib.h
  #include stdio.h
  #include unistd.h
  #include pthread.h

  void *func(void *arg)
  {
  int i,a;
  for (i = 0; i  100; ++i)
  a++;
  return NULL;
  }

  int main()
  {   
  pthread_t thread;

  pthread_create(thread, NULL, func, NULL);
  pthread_join(thread, NULL);
  return 0;
  }

  $ gcc -g -lpthread test.c -o test

  Found that this commit c1a747c10948e2298083179f4e8aeed8b962e2af fixes
  the problem on upstream gdb. I'm backporting the patch for Ubuntu
  package in order to double