944,008 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Marked Solved
  • Views: 5190
  • C++ RSS
You are currently viewing page 1 of this multi-page discussion thread
Dec 23rd, 2006
0

turbo c processor fault

Expand Post »
when I exit a function i get 'general protection exception' -' processor fault'. Function writes to file and works ok except won't exit. What does this mean please, and where should I look ? Am using Turbo C 4.5 & Windows xp. Must be overwriting memory somehow I suppose but can't see where. Have increased stack size in .def file- no use.
All suggestions welcome !!
Reputation Points: 10
Solved Threads: 0
Newbie Poster
danijohn is offline Offline
4 posts
since Dec 2006
Dec 23rd, 2006
0

Re: turbo c processor fault

Could you post the code you're having trouble with? Most likely you're trying to acess memory you shouldn't be, such as using a pointer that isn't pointing to what you expect it to, but it's kind of hard to guess unless you actually show us what you're trying to do.
Team Colleague
Reputation Points: 2240
Solved Threads: 338
Vampirical Lurker
John A is offline Offline
5,055 posts
since Apr 2006
Dec 23rd, 2006
1

Re: turbo c processor fault

Click to Expand / Collapse  Quote originally posted by danijohn ...
when I exit a function i get 'general protection exception' -' processor fault'. Function writes to file and works ok except won't exit. What does this mean please, and where should I look ? Am using Turbo C 4.5 & Windows xp. Must be overwriting memory somehow I suppose but can't see where. Have increased stack size in .def file- no use.
All suggestions welcome !!
I think it's waste of time solving your problem for Turbo C. Better get a new compiler Check this link
http://www.daniweb.com/techtalkforums/thread50370.html
SpS
Reputation Points: 70
Solved Threads: 32
Posting Pro
SpS is offline Offline
598 posts
since Aug 2005
Dec 24th, 2006
0

Re: turbo c processor fault

His problem is almost certainly not caused by using TC 4.5 (which though old is still somewhat servicable and can produce 32 bit Windows code) but by a bug in his code.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Dec 28th, 2006
0

Re: turbo c processor fault

Thanks for encouraging me to look for coding bug.
You are right. Eventually I traced it to repeated calls to a library routine, fcvt, which converts floats to strings. I didn't expect a problem here because I've used it elsewhere, but not with repeated calls. It seems I have to store the ouput in a static variable. Hence the return addresses getting screwed up, and the bizarre error messages.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
danijohn is offline Offline
4 posts
since Dec 2006
Dec 28th, 2006
0

Re: turbo c processor fault

Yes you are right. It turned out to be repeated calls to a library routine, fcvt, that converts floats to strings. The small print which I missed says the ouput must be stored in a static variable. I hadn't, which accounts for the return addresses getting screwed up and the bizarre error messages.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
danijohn is offline Offline
4 posts
since Dec 2006
Dec 28th, 2006
0

Re: turbo c processor fault

Thanks for reply. You are probably right that I'm missing some goodies staying with an old compiler, but I don't want the cost of a new one, or learning a new environment.
In spite of the bizarre error messages, it turned out to be a simple coding error.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
danijohn is offline Offline
4 posts
since Dec 2006
Dec 28th, 2006
0

Re: turbo c processor fault

Click to Expand / Collapse  Quote originally posted by danijohn ...
Thanks for reply. You are probably right that I'm missing some goodies staying with an old compiler, but I don't want the cost of a new one, or learning a new environment.
In spite of the bizarre error messages, it turned out to be a simple coding error.

cost is no excuse -- some such as Dev-C++ are free.

>> or learning a new environment
If you want to do this as a hobby that's ok. But no company uses that compiler any more.
Last edited by Ancient Dragon; Dec 28th, 2006 at 5:51 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Dec 29th, 2006
0

Re: turbo c processor fault

and no company uses Dev-C either.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Dec 29th, 2006
0

Re: turbo c processor fault

Depends on what exactly do you mean by a company -- a big time software gaint or a small time budding organization with no more than 10 people.

If the former, then yes, you are correct. But if the latter, then no, I have seen small time companies (like those in embedded development etc.) using free IDE's like Code::Blocks and Dev C++.
Super Moderator
Featured Poster
Reputation Points: 3233
Solved Threads: 720
Failure as a human
~s.o.s~ is offline Offline
8,872 posts
since Jun 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: What is the purpose of registers
Next Thread in C++ Forum Timeline: c++ data structres -trees





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC