Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
* Problems with thread library in OSF1 V3.2
@ 1996-07-19  4:00 Rajeev Kumar Ranjan
  1996-07-21  4:00 ` Steve Peltz
  1996-07-21  4:00 ` Rajeev Kumar Ranjan
  0 siblings, 2 replies; 4+ messages in thread
From: Rajeev Kumar Ranjan @ 1996-07-19  4:00 UTC (permalink / raw)




I am new to this group. Please pardon any mistakes.

I am trying to use the thread library but have not been successful. 
Strangely, the error shows up even in following simple program:

----------------------------
#include<stdio.h>

main()
{
  printf("hello world\n");
}
---------------------------
The compile command I used is: 	cc -g test.c -lpthreads
After I run the program, it gives segmentation fault. The stack has
the following alternating function calls.

#0  0x3ff81808f5c in port_allocate ()
#1  0x3ff81804a38 in mig_get_reply_port ()
#2  0x3ff81808f94 in port_allocate ()
#3  0x3ff81804a38 in mig_get_reply_port ()
#4  0x3ff81808f94 in port_allocate ()
#5  0x3ff81804a38 in mig_get_reply_port ()
#6  0x3ff81808f94 in port_allocate ()
#7  0x3ff81804a38 in mig_get_reply_port ()
......................
This stack goes on for few hundreds depth.

This is occuring even before the program enters the "main" function.

I got the exact same error trace in the original application program. 

Following is the uname output:
OSF1 susie.EECS.Berkeley.EDU V3.2 41.64 alpha

I would appreciate any light on this problem.

Thanks in advance.

-rajeev
-- 
------------------------------------------------------
Rajeev K. Ranjan
internet address: rajeev@eecs.berkeley.edu
URL: http://www-cad.eecs.berkeley.edu/~rajeev
phone no: 510-642-3234
Department of EECS, University of California, Berkeley
-----------------------------------------------------



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

* Re: Problems with thread library in OSF1 V3.2
  1996-07-19  4:00 Problems with thread library in OSF1 V3.2 Rajeev Kumar Ranjan
@ 1996-07-21  4:00 ` Steve Peltz
  1996-07-21  4:00 ` Rajeev Kumar Ranjan
  1 sibling, 0 replies; 4+ messages in thread
From: Steve Peltz @ 1996-07-21  4:00 UTC (permalink / raw)



In article <utfg26n3k8k.fsf@icw.EECS.Berkeley.EDU>,
Rajeev Kumar Ranjan <rajeev@icw.EECS.Berkeley.EDU> wrote:
>I am trying to use the thread library but have not been successful. 
>---------------------------
>The compile command I used is: 	cc -g test.c -lpthreads

Instead of -lpthreads, just use -threads (or -pthread if you upgrade to
DU 4.0).



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

* Re: Problems with thread library in OSF1 V3.2
  1996-07-19  4:00 Problems with thread library in OSF1 V3.2 Rajeev Kumar Ranjan
  1996-07-21  4:00 ` Steve Peltz
@ 1996-07-21  4:00 ` Rajeev Kumar Ranjan
  1996-07-22  4:00   ` Steve Peltz
  1 sibling, 1 reply; 4+ messages in thread
From: Rajeev Kumar Ranjan @ 1996-07-21  4:00 UTC (permalink / raw)




In article <4ss7rt$sm1@vixen.cso.uiuc.edu> peltz@jaka.ece.uiuc.edu (Steve Peltz) writes:

   From: peltz@jaka.ece.uiuc.edu (Steve Peltz)
   Keywords: Cc:

   In article <utfg26n3k8k.fsf@icw.EECS.Berkeley.EDU>,
   Rajeev Kumar Ranjan <rajeev@icw.EECS.Berkeley.EDU> wrote:
   >I am trying to use the thread library but have not been successful. 
   >---------------------------
   >The compile command I used is: 	cc -g test.c -lpthreads

   Instead of -lpthreads, just use -threads (or -pthread if you upgrade to
   DU 4.0).

The OS version that I have (OSF1 V3.2 41.64 alpha)  does not have
libthread.a. But is it certain that the presence of libthread.a will
solve the problem?
Thanks.

-rajeev
-- 
------------------------------------------------------
Rajeev K. Ranjan
internet address: rajeev@eecs.berkeley.edu
URL: http://www-cad.eecs.berkeley.edu/~rajeev
phone no: 510-642-3234
Department of EECS, University of California, Berkeley
-----------------------------------------------------



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

* Re: Problems with thread library in OSF1 V3.2
  1996-07-21  4:00 ` Rajeev Kumar Ranjan
@ 1996-07-22  4:00   ` Steve Peltz
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Peltz @ 1996-07-22  4:00 UTC (permalink / raw)



In article <utfhgr1t1aa.fsf@susie.EECS.Berkeley.EDU>,
Rajeev Kumar Ranjan <rajeev@susie.EECS.Berkeley.EDU> wrote:
>   From: peltz@jaka.ece.uiuc.edu (Steve Peltz)
>   Keywords: Cc:
>   >The compile command I used is: 	cc -g test.c -lpthreads
>
>   Instead of -lpthreads, just use -threads (or -pthread if you upgrade to
>   DU 4.0).
>
>The OS version that I have (OSF1 V3.2 41.64 alpha)  does not have
>libthread.a. But is it certain that the presence of libthread.a will
>solve the problem?

Use -threads, NOT -lthreads or -lthread or -lpthreads or anything else.
-threads is a flag to cc that tells it to use the thread-safe versions
of libraries. When you explicitly specified libpthreads.a, you got some
thread-safe versions and some non-thread versions, and the two sets of
incompatible routines obviously don't work very well together.

-pthread is similar (but only available on DU 4.0), but specifies to use
the final version of the POSIX threads interface. -threads uses a draft
version (-threads is still available in 4.0).



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

end of thread, other threads:[~1996-07-22  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-07-19  4:00 Problems with thread library in OSF1 V3.2 Rajeev Kumar Ranjan
1996-07-21  4:00 ` Steve Peltz
1996-07-21  4:00 ` Rajeev Kumar Ranjan
1996-07-22  4:00   ` Steve Peltz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox