From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f8c9b,7946aa2e5601a031 X-Google-Attributes: gidf8c9b,public X-Google-Thread: fc89c,7946aa2e5601a031 X-Google-Attributes: gidfc89c,public X-Google-Thread: fee84,7946aa2e5601a031 X-Google-Attributes: gidfee84,public X-Google-Thread: ffc1e,7946aa2e5601a031 X-Google-Attributes: gidffc1e,public From: c632692@cclabs.missouri.edu (Vepa V Sirish) Subject: Re: Q: OSF1 -lpthreads -> core - why ? Date: 1996/04/03 Message-ID: <4jsm22$18u6@news.missouri.edu>#1/1 X-Deja-AN: 145527781 references: <4js6bu$gai@news1.relcom.eu.net> followup-to: comp.programming.threads,comp.unix.osf.osf1,comp.unix.questions,comp.unix.programmer organization: University of Missouri - Columbia newsgroups: comp.programming.threads,comp.unix.osf.osf1,comp.unix.questions,comp.unix.programmer 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 #include 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 ! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<