multithreaded c++ program gives segmentation fault coredump

N

nrhayyal

hi guys,
i am using AIX 5.2 OS and working on c++ and the compiler is gcc-3.3.2
i have a c++ application which was developed on solaris. now i am
porting it to AIX.
most of my modules work fine.
But when i tried to port one of the module which uses multithreading,
it gives me segmentation Fault coredump for more than one thread.
i am using pthread library.
for one thread it works fine.
for more than one it coredumps.
is there anything need to be set on AIX for thread support. or is there
anything which needs to be put in Makefile?
please help me to solve this issue.
thanks in advance.

regards
Nagaraj Hayyal
 
R

Razvan Cojocaru

g++ -pthread -DREENTRANT

Though -pthread should already define REENTRANT IIRC. Of course, your
compiler should be compiled with threads support itself. You can check
this with:

gcc -dumpspecs | grep -i thread

or:

gcc -v

which should output a line similar to "Thread model: posix"
 
N

nrhayyal

hi,
thanks for ur reply..
i didnt get when u said " Of course, your
compiler should be compiled with threads support itself."

did u mean that the gcc itself should be compiled with thread support?
when i checked with gcc -v i found that thread model is aix.
here is the stuff :
gcc -v :

Reading specs from
/usr/local/gcc-3.3.2/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/specs
Configured with: ../configure --prefix=/usr/local/gcc-3.3.2
Thread model: aix
gcc version 3.3.2

so if my thread model is aix, cant i use posix threads on it?
if not can u please help me in setting this thread model to posix.

thanks again
nagaraj
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top