Community
cancel
Showing results for 
Search instead for 
Did you mean: 
ankit_m_
Beginner
108 Views

hello world throwing seg fault

Hello,

I am trying to compile and run a very simple Hello world program using icpc. Nothing fancy, what I do is following,

#include <iostream>

using namespace std;

int main()
{
        cout << " hello " << endl;
        return 0;
}

~

I compile the above code using

icpc hello.cpp -o hh

compilation works just fine but when I try to run this I get "segmentation fault" I am not sure what is causing this error. Could anyone please help trouble shoot this.

 

0 Kudos
5 Replies
Bernard
Black Belt
108 Views

Can you provide dump file?I suppose that you are using Linux.

QIAOMIN_Q_
New Contributor I
108 Views

Please provide the icc and gcc's version ,and which operating system are you using? and what's the output of 'ulimit -s'?

 

Thank you.
--
QIAOMIN.Q
Intel Developer Support

User forums:                   http://software.intel.com/en-us/forums/

Bernard
Black Belt
108 Views

>>> I get "segmentation fault" I am not sure what is causing this error>>>

By inspecting your code I suppose that possible "candidate" for segfault error could be hello string.One of the reason could be unbalanced stack when the push offset hello instruction generates segfault.Without the seeing the disassembly it is just speculation.

bernaske
New Contributor I
108 Views

Hi,

i have your simple, sample program compile under openSUSE Factory ( Version 13.2 ) with

the Intel Parallel Studio XE Sp1 for Linux ( 64 Bit )

no problems, the same under openSUSE 12.3 and openSUSE 13.1

regards

 

Franz

 

 

Bernard
Black Belt
108 Views

On the other hand the segfault could have originated inside cout object code.

Reply