* Q: OSF1 -lpthreads -> core - why ?
@ 1996-04-02 5:00 Yury July
1996-04-03 5:00 ` Vepa V Sirish
0 siblings, 1 reply; 3+ messages in thread
From: Yury July @ 1996-04-02 5:00 UTC (permalink / raw)
Here's my stupid program:
main(){
printf("hello\n");
}
Should work, isn't it ?
However, when linked with -lpthreads it coredumps!
gdb says:
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/shlib/libpthreads.so...done.
Reading symbols from /usr/shlib/libdce.so...done.
Reading symbols from /usr/shlib/libc.so...done.
Reading symbols from /usr/shlib/libmach.so...done.
Reading symbols from /usr/shlib/libc_r.so...done.
#0 0x3ff805188ec in port_allocate () at ./mach_user.c:6039
OS version is still OSF1 V3.2 17 alpha.
Did I missed something or the reason is wrong release,
or lack of options in kernel configuration ?
Many thanks in advance.
--
Regards,
Yury July
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Q: OSF1 -lpthreads -> core - why ?
1996-04-02 5:00 Q: OSF1 -lpthreads -> core - why ? Yury July
@ 1996-04-03 5:00 ` Vepa V Sirish
1996-04-03 5:00 ` Thomas Hopfner
0 siblings, 1 reply; 3+ messages in thread
From: Vepa V Sirish @ 1996-04-03 5:00 UTC (permalink / raw)
Yury July (july@Gemini.relcom.EU.net) wrote:
: Here's my stupid program:
:
: main(){
: printf("hello\n");
: }
:
: Should work, isn't it ?
: However, when linked with -lpthreads it coredumps!
:
: gdb says:
: Program terminated with signal 11, Segmentation fault.
: Reading symbols from /usr/shlib/libpthreads.so...done.
: Reading symbols from /usr/shlib/libdce.so...done.
: Reading symbols from /usr/shlib/libc.so...done.
: Reading symbols from /usr/shlib/libmach.so...done.
: Reading symbols from /usr/shlib/libc_r.so...done.
: #0 0x3ff805188ec in port_allocate () at ./mach_user.c:6039
:
: OS version is still OSF1 V3.2 17 alpha.
: Did I missed something or the reason is wrong release,
: or lack of options in kernel configuration ?
:
: Many thanks in advance.
: --
: Regards,
: Yury July
--
Well, here is my program, and take a look at the compiler options i
supplied. It ran fine for me. And this was executed on a DCE Alpha
OSF/1 V3.2. do not ask me about all these compiler options/linker
options. They have worked for me for a long time (1 1/2 yrs).
I understand, the order in which the libs are linked is very important.
Hope this helps
/v$
csdeca [131] [7:53pm] [/usr/users/c632692/test] > cat hello.script
Script started on Tue Apr 02 19:50:39 1996
csdeca [101] [7:50pm] [/usr/users/c632692/test] >
csdeca [101] [7:50pm] [/usr/users/c632692/test] > hello.sh
#! /bin/sh -v
cat hello.c
#include <pthread.h>
#include <stdio.h>
main(){
printf("hello world\n");
}
cc hello.c
ls -al
total 37
drwx--x--x 2 c632692 grad 512 Apr 2 19:50 .
drwxr-xr-x 28 c632692 grad 2048 Apr 2 19:43 ..
-rwx--x--x 1 c632692 grad 32768 Apr 2 19:50 a.out
-rw------- 1 c632692 grad 76 Apr 2 19:44 hello.c
-rw------- 1 c632692 grad 0 Apr 2 19:50 hello.script
-rwx------ 1 c632692 grad 168 Apr 2 19:50 hello.sh
a.out
hello world
cc hello.c -Dalpha -D_SHARED_LIBRARIES -D_REENTRANT -w -ldce -lpthreads
-lc_r - lmach -lm
ls -al
total 165
drwx--x--x 2 c632692 grad 512 Apr 2 19:50 .
drwxr-xr-x 28 c632692 grad 2048 Apr 2 19:43 ..
-rwx--x--x 1 c632692 grad 155648 Apr 2 19:50 a.out
-rw------- 1 c632692 grad 76 Apr 2 19:44 hello.c
-rw------- 1 c632692 grad 0 Apr 2 19:50 hello.script
-rwx------ 1 c632692 grad 168 Apr 2 19:50 hello.sh
a.out
hello world
csdeca [102] [7:50pm] [/usr/users/c632692/test] > exit
exit
script done on Tue Apr 02 19:51:00 1996
csdeca [132] [7:55pm] [/usr/users/c632692/test] >
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
! Vepa V Sirish !
! 1205 University Avenue, #236 Columbia, MO 65201 !
! sirish@csdeca.cs.missouri.edu 573-874-8720 (R) !
! \o/ \o __| \ / |__ o _ \o/ _ o !
! | /\ __\o \o | o/ o/__ /\ | /\ \__/ !
! _/_\__|_\__/)_|____(_\__/o\__/_)____|__(\__/_|__/_\__|_\__/ /o !
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Q: OSF1 -lpthreads -> core - why ?
1996-04-03 5:00 ` Vepa V Sirish
@ 1996-04-03 5:00 ` Thomas Hopfner
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Hopfner @ 1996-04-03 5:00 UTC (permalink / raw)
Hi there,
we use OSF/1 V2.0 and Digital UNIX V3.2C here and ``man cc'' states:
-threads
Tell the linker to use the threadsafe version of libc, and - if it
exists - the threadsafe version of any library specified with the -l
flag, when linking programs. This flag also tells the linker to
include libpthreads and its support libraries when linking with a pro-
gram. Note that when you use this flag, it should appear last on the
command line.
This works well for me.
CU, Tom.
c632692@cclabs.missouri.edu (Vepa V Sirish) writes:
>Yury July (july@Gemini.relcom.EU.net) wrote:
>: Here's my stupid program:
>:
>: main(){
>: printf("hello\n");
>: }
>:
>: Should work, isn't it ?
>: However, when linked with -lpthreads it coredumps!
[...]
>cc hello.c -Dalpha -D_SHARED_LIBRARIES -D_REENTRANT -w -ldce -lpthreads
>-lc_r - lmach -lm
[...]
--
--
http://www.lpr.e-technik.tu-muenchen.de/~hopfner/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1996-04-03 5:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-04-02 5:00 Q: OSF1 -lpthreads -> core - why ? Yury July
1996-04-03 5:00 ` Vepa V Sirish
1996-04-03 5:00 ` Thomas Hopfner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox