public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Itanium and GDB on 2.6.x kernels with pthreads
@ 2005-09-07 16:27 David Lecomber
  2005-09-07 22:15 ` Andreas Schwab
  2005-09-10 15:29 ` Daniel Jacobowitz
  0 siblings, 2 replies; 6+ messages in thread
From: David Lecomber @ 2005-09-07 16:27 UTC (permalink / raw)
  To: gdb

[-- Attachment #1: Type: text/plain, Size: 1341 bytes --]

Dear all,

Attached is a simple program, and simple script for GDB (current CVS,
and previous versions)

gcc -o pf -g pf.c -lm -lpthread

gdb ./pf < gdb.script

The script is a break main and then 'next' four times, followed by quit.

On a 2.4.21 Itanium system, it's quick and quits happily.

On a 2.6.5 Itanium, it hangs during the later nexts.  Does anyone have a
more recent Itanium they could try and see if this is a transient kernel
issue?  

Note, the Intel IDB debugger does not have a problem with this test
case.

GDB consumes CPU, and a 'strace' shows it to be doing repeatedly:

wait4(29113, 0x60000fffffffa730, 0, NULL) = -1 ECHILD (No child
processes)
wait4(29113, [{WIFSTOPPED(s) && WSTOPSIG(s) == SIGTRAP}], __WCLONE,
NULL) = 29113
ptrace(PTRACE_CONT, 29113, 0, SIG_0)    = 0
wait4(29113, 0x60000fffffffa730, 0, NULL) = -1 ECHILD (No child
processes)


Also, just generally, signal processing is goofed up -- and if I try to
attach to the running GDB I just see:

Loaded symbols for /lib/tls/libthread_db.so.1
<signal handler called>
(gdb) bt
#0  <signal handler called>
Cannot access memory at address 0x28
(gdb) The program is running.  Quit anyway (and detach it)? (y or n) y


Anyone seen this before?  If someone could verify this is ok on their
system, I'd appreciate it..

d.


-- 
David Lecomber <david@allinea.com>

[-- Attachment #2: pf.c --]
[-- Type: text/x-csrc, Size: 465 bytes --]

#include <pthread.h>
#include <math.h>
#include <stdio.h>

void f(char* s)
{
  int i;
  printf("Hello from : %s\n", s);
  fflush(stdout);
  for (i = 0 ; i < 100000000; i++)
    {
      float f = sqrt(i);
    }
  printf("Goodbye from : %s\n", s);
  fflush(stdout);
}

int main()
{
  pthread_t t1;
  pthread_t t2;

  pthread_create(&t1, NULL, (void*) &f, "One");
  pthread_create(&t2, NULL, (void*) &f, "Two");

  pthread_join(t1, NULL);
  pthread_join(t2, NULL);

}

[-- Attachment #3: gdb.script --]
[-- Type: text/plain, Size: 32 bytes --]

b main
run 
next
next
next
quit

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-09-16 10:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-07 16:27 Itanium and GDB on 2.6.x kernels with pthreads David Lecomber
2005-09-07 22:15 ` Andreas Schwab
2005-09-09 14:48   ` David Lecomber
2005-09-10 15:29 ` Daniel Jacobowitz
2005-09-10 15:57   ` Daniel Jacobowitz
2005-09-16 10:36     ` David Lecomber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).