Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Suprising seg fault!!!

Reply
Thread Tools

Suprising seg fault!!!

 
 
Vinod
Guest
Posts: n/a
 
      09-27-2003
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
 
Reply With Quote
 
 
 
 
Kevin Goodsell
Guest
Posts: n/a
 
      09-27-2003
Vinod wrote:

> 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
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.

 
Reply With Quote
 
 
 
 
Mike Wahler
Guest
Posts: n/a
 
      09-27-2003
"Vinod" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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.


 
Reply With Quote
 
Ron Natalie
Guest
Posts: n/a
 
      09-27-2003

"Vinod" <(E-Mail Removed)> wrote in message news:(E-Mail Removed) om...

> 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Suprising behaviour with "def property=" method Farrel Lifson Ruby 13 02-26-2008 06:31 AM
suprising output !! onkar C Programming 5 02-21-2008 03:36 AM
Suprising result.... Scraggy Computer Support 8 04-07-2005 08:05 PM
Getting seg faults in destructors. Possibly a newbie problem. Andrew King C++ 1 04-07-2004 05:09 PM
seg fault because stdexcept.cc not found? Corrine C++ 1 11-27-2003 06:15 AM



Advertisments