- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- pthread_create is failing in HP Unix server
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2009 05:32 AM
тАО02-10-2009 05:32 AM
pthread_create is failing in HP Unix server
/usr/lib/dld.sl: Unresolved symbol: U_get_unwind_table (code) from /opt/langtools/lib/libpthread_tr.1
/usr/lib/dld.sl: Unresolved symbol: U_get_unwind_table (code) from /opt/langtools/lib/libpthread_tr.1
/usr/lib/dld.sl: Unresolved symbol: U_get_unwind_table (code) from /opt/langtools/lib/libpthread_tr.1
/usr/lib/dld.sl: Unresolved symbol: U_get_unwind_table (code) from /opt/langtools/lib/libpthread_tr.1
Pid 4074 received a SIGSEGV for stack growth failure.
Possible causes: insufficient memory or swap space,
or stack size exceeded maxssiz.
^CSegmentation fault (core dumped)
Source Code:
#include
#include
#include
#define NUM_THREADS 5
void *PrintHello(void *threadid)
{
long tid;
tid = (long)threadid;
printf("Hello World! It's me, thread #%ld!\n", tid);
pthread_exit(NULL);
}
int main(int argc, char *argv[])
{
pthread_t threads[NUM_THREADS];
int rc;
long t;
for(t=0;t
rc = pthread_create(&threads[t], NULL, NULL, (void *)t);
if (rc){
printf("ERROR; return code from pthread_create() is %d\n", rc);
exit(-1);
}
}
pthread_exit(NULL);
}
I used the following command for compilation.
g++ -lpthread hello.cpp
Please check and provide your feedback.
- Tags:
- pthread
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2009 05:48 AM
тАО02-10-2009 05:48 AM
Re: pthread_create is failing in HP Unix server
This indicates you forgot to link with -lcl. Any reason you are linking with the tracing libpthread?
>g++ -lpthread hello.cpp
The -lpthread should go at the end, after the objects. Also, doesn't g++ have a special option to indicate threading?
- Tags:
- libunwind
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2009 02:25 PM
тАО02-10-2009 02:25 PM
Re: pthread_create is failing in HP Unix server
That's -pthread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2009 10:33 PM
тАО02-10-2009 10:33 PM
Re: pthread_create is failing in HP Unix server
/* this is create.c */
#include
#include
#include
#include
void fatal_error(int err_num, char *function);
void thread1_func();
/* Print "Hello World!", then "Good-bye World!" */
main()
{
pthread_t tid;
int return_val;
printf("start of program \n");
sleep(30);
/*
* Create a new thread to execute thread1_func().
*/
return_val = pthread_create(&tid, (pthread_attr_t *)NULL,
(void *(*)())thread1_func,
(void *)NULL);
if (return_val != 0)
fatal_error(return_val, "pthread_create()");
printf("doing more work\n");
sleep(30);
/*
* Wait for the thread to finish executing, then...
*/
return_val = pthread_join(tid, (void **)NULL);
if (return_val != 0)
fatal_error(return_val, "pthread_join()");
/* Say Good-bye */
printf("Good-bye World!\n");
exit(0);
}
/* Print error information, exit with -1 status. */
void
fatal_error(int err_num, char *function)
{
char *err_string;
err_string = strerror(err_num);
fprintf(stderr, "%s error: %s\n", function, err_string);
exit(-1);
}
/* Function to print "Hello World!". */
void
thread1_func()
{
printf("the thread is execuitng\n");
sleep(30);
printf("Hello World!\n");
pthread_exit((void *)NULL);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2009 04:03 AM
тАО02-11-2009 04:03 AM