Suprising seg fault!!!

V

Vinod

Hi!!

I am having a very strange problem with my C++ code.

I am developing a simulator which converts a source language into
intermediate code (C++). This code when compiled with a library
API(C++) creates a final executable. The executable shows the behavior
of the simulator.

The problem that I am currently facing is that the executable seg
faults based on the directory in which i compile the intermediate
code.

I am using libtools so I do not expect any linking problems. Infact I
donot have any errors during compilation/linking stage. The
intermediate code when compiled always produces the executable. I do
both the intermediate code generation and compilation in the same
directory. When I do these 2 steps in directory A it works. However it
fails when I do the same in directory B. How is this possible???

Thanks in advance for your reply.

Vinod Chamarty
 
K

Kevin Goodsell

Vinod said:
Hi!!

I am having a very strange problem with my C++ code.

I am developing a simulator which converts a source language into
intermediate code (C++). This code when compiled with a library
API(C++) creates a final executable. The executable shows the behavior
of the simulator.

The problem that I am currently facing is that the executable seg
faults based on the directory in which i compile the intermediate
code.

I am using libtools so I do not expect any linking problems. Infact I
donot have any errors during compilation/linking stage. The
intermediate code when compiled always produces the executable. I do
both the intermediate code generation and compilation in the same
directory. When I do these 2 steps in directory A it works. However it
fails when I do the same in directory B. How is this possible???

Thanks in advance for your reply.

I can't see any way that this could possibly be related to the C++
language. It seems to be an issue with your development tools.

http://www.slack.net/~shiva/welcome.txt
http://www.slack.net/~shiva/offtopic.txt

-Kevin
 
M

Mike Wahler

Vinod said:
Hi!!

I am having a very strange problem with my C++ code.

But you don't describe anything about C++.
When I do these 2 steps in directory A it works. However it
fails when I do the same in directory B. How is this possible???

Directory A is for applications with (A)wesome performance.

Directory B is for applications which (B)omb when launched
from there.
Thanks in advance for your reply.

Thanks in advance for reading:
http://www.slack.net/~shiva/welcome.txt
before posting here again.

-Mike
Blame it on the seg. Yeah, that's it, it's the seg's fault.
 
R

Ron Natalie

Vinod said:
I am developing a simulator which converts a source language into
intermediate code (C++). This code when compiled with a library
API(C++) creates a final executable. The executable shows the behavior
of the simulator.

This is often a feature of some miscoding that leads to something that in the C++
language is "undefined behavior." One of the insidious problems with undefined
behavior is that it works normally in some cases and not in others.
 

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

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top