From: "MuthuKumar-15" <kmuthukumar@mail15.com>
To: <gdb@sources.redhat.com>
Subject: thread debugging
Date: Tue, 25 May 2004 09:21:00 -0000 [thread overview]
Message-ID: <021301c44239$bad6e0b0$2e0110ac@mukco> (raw)
Hello All.
I have a problem in thread debugging with GDB on HP-UX platform.
*** Sample program ***
/* thrd.c */
#include <pthread.h>
#include <stdio.h>
#include <errno.h>
void *func()
{
printf("Thread function\n"); pthread_exit(NULL);
}
main()
{
pthread_t *t1; int result=0;
t1=(pthread_t)malloc(sizeof(pthread_t));
bzero((void *)t1,sizeof(pthread_t));
result = pthread_create(t1, NULL, func, NULL);
if (result == EAGAIN) {
printf("EAGAIN Error\n"); free(t1); exit(1);
}
else if (result == -1) {
printf("Negative return value\n"); free(t1); exit(1);
}
pthread_exit(NULL);
free(t1);
}
**************************
$ cc -g -o thrd thrd.c
gdb execution:
$ gdb -q thrd
gdb> b main
gdb> b func
gdb> r
...
< After finishing the pthread_exit in main(),it is going to func()'s pthread_exit.>
gdb> s
It is hanging over here.........!! It is not responsing.
1. What is the problem on program? How to debug this?
2. Is it good to debug memory leaks with GDB + librtc library on HP-UX platfrom?
Regards,
Muthukumar.
---
=============== It is a "Virus Free Mail" ===============
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.690 / Virus Database: 451 - Release Date: 5/22/2004
reply other threads:[~2004-05-25 9:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='021301c44239$bad6e0b0$2e0110ac@mukco' \
--to=kmuthukumar@mail15.com \
--cc=gdb@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox