turbo c processor fault

Please support our C++ advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Dec 2006
Posts: 4
Reputation: danijohn is an unknown quantity at this point 
Solved Threads: 0
danijohn danijohn is offline Offline
Newbie Poster

turbo c processor fault

 
0
  #1
Dec 23rd, 2006
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 !!
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 5,051
Reputation: John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold John A is a splendid one to behold 
Solved Threads: 332
Team Colleague
John A's Avatar
John A John A is offline Offline
Vampirical Lurker

Re: turbo c processor fault

 
0
  #2
Dec 23rd, 2006
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.
"Technological progress is like an axe in the hands of a pathological criminal."

All my posts may be freely redistributed under the terms of the MIT license.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 598
Reputation: SpS is on a distinguished road 
Solved Threads: 32
SpS's Avatar
SpS SpS is offline Offline
Posting Pro

Re: turbo c processor fault

 
1
  #3
Dec 23rd, 2006
Originally Posted by danijohn View 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 !!
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
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: turbo c processor fault

 
0
  #4
Dec 24th, 2006
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.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 4
Reputation: danijohn is an unknown quantity at this point 
Solved Threads: 0
danijohn danijohn is offline Offline
Newbie Poster

Re: turbo c processor fault

 
0
  #5
Dec 28th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 4
Reputation: danijohn is an unknown quantity at this point 
Solved Threads: 0
danijohn danijohn is offline Offline
Newbie Poster

Re: turbo c processor fault

 
0
  #6
Dec 28th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 4
Reputation: danijohn is an unknown quantity at this point 
Solved Threads: 0
danijohn danijohn is offline Offline
Newbie Poster

Re: turbo c processor fault

 
0
  #7
Dec 28th, 2006
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,653
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1500
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: turbo c processor fault

 
0
  #8
Dec 28th, 2006
Originally Posted by danijohn View Post
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: turbo c processor fault

 
0
  #9
Dec 29th, 2006
and no company uses Dev-C either.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,650
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: turbo c processor fault

 
0
  #10
Dec 29th, 2006
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++.
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum


Views: 3791 | Replies: 15
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC