473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

multithreaded c++ program gives segmentation fault coredump

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

Jul 23 '05 #1
2 4278
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"
--
Razvan Cojocaru
KeyID: 1024D/04CA34DE
Jul 23 '05 #2
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

Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: zhouhaiming | last post by:
On our test machine I can compile my c source code on AIX5.1(ML4) by "- q32" option and "OBJECT_MODE=32" environment variable, and it can correctly running. My operation system environment is:...
2
by: nagaraj_hayyal | last post by:
Hi All, thanks for reading this post. just wanted to know about the ratio of threads and processors. i am working on c++ on AIX5.2 platform. my c++ program are multithreaded programs. ...
3
by: nrhayyal | last post by:
Hi All, thanks for reading this post. just wanted to know about the ratio of threads and processors. i am working on c++ on AIX5.2 platform. my c++ program are multithreaded programs. In a...
4
by: cpptutor2000 | last post by:
Could some C guru help me please? I am using the following program to open a SSH connection to a remote host and eventually run a program on that remote host. #include <stdio.h> #include...
3
by: madunix | last post by:
My Server is suffering bad lag (High Utlization) I am running on that server Oracle10g with apache_1.3.35/ php-4.4.2 Web visitors retrieve data from the web by php calls through oci cobnnection...
20
by: Francine.Neary | last post by:
I am learning C, having fun with strings & pointers at the moment! The following program is my solution to an exercise to take an input, strip the first word, and output the rest. It works fine...
5
by: rasmidas | last post by:
I have written a file as below: #include<stdio.h> #include<string.h> #include<stdlib.h> int main() { char* items; int i; for(i=0;i<2;i++)
1
by: sathishc58 | last post by:
Hi All The below tries to fetch the details of the group to which I belongs to. But due to some reason it seg faults. #include <grp.h> #include <stdio.h> main() { gid_t gid;
2
by: sathishc58 | last post by:
Hi All Please review the program and let me know whether my program will cause memory leak or not. 1 #include <stdio.h> 2 3 struct emp 4 { 5 int empno; 6 ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.