Sign in to follow this  

Errors that effect a computer's system.

This topic is 474 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am using just simple c++  and some DirectX libraries.  I'm wondering are there any programming mistakes that can actually permanently harm a user's computer.  

 

Maybe to start it off:  dangling pointers, out of range arrays, out of bound strings and pointers?

 

Hopefully these only harm the programs running and don't cause permanent computer system failures?

 

 

Thank you,

 

Josh

Share this post


Link to post
Share on other sites

Depends on the hardware and operating system. Since you mentioned DirectX, I'm assuming you're using a Windows OS.

 

In modern OSes like Windows, the RAM is sandboxed (i.e. protected), so dangling pointers and etc... are unlikely to cause permanent damage.

 

Yes, it's possible to permanently damage pieces of a computer, but it's so very very very very very very unlikely, that it's not worth any of your time to even consider worrying about.

 

You're much more likely to mess up your operating system by deleting the wrong files in Windows Explorer than you are by using code.

 

It's unlikely you'll even crash your computer (crash your program? Sure! The entire OS? Rarely), and when you do (likely from crashing your videocard), your computer will almost certainly boot back up just fine.

 

Again, it is possible, but so unlikely as to not be worth your time (as a beginner) worrying about.

Share this post


Link to post
Share on other sites

It can still happen, primarily as damage to graphics cards or CPUs that have had safeguards removed. 

 

 

There are a small number of games that disable several good features on graphics cards (notably vsync and rate limiting) on top of the player manually overclocking and overvolting their graphics cards.  The game does a ton of heavy processing work for an extended time and with the safeguards removed, it overheats and takes damage.

 

Similarly there are games that heavily tax the CPU. While fewer people do it today, extreme overclocking was more popular than today. Games that were already known to severely tax a CPU, coupled with someone who intentionally disables the safeguards and increases CPU temperature, can overheat and damage their processor.

 

 

 

As a beginner you should't worry about it.

 

Even as a professional it is something you shouldn't worry about, unless perhaps you are developing the graphics code; then you can implement a hard limit of something like 300 FPS as a rate limiter, just in case someone manually overrides vsync settings and you are on your menu screens that run at an unlimited framerate.

 

And even then, it would be mostly the consumer's fault for disabling the safeguards on the system.

Share this post


Link to post
Share on other sites

To my knowledge, any critical failure that would cause damage to a user's computer will likely come from some sort of instruction error or exposure. Still very rare though. The worst I have honestly seen was caused by Portal 2, for some motherboards. The most it'd cause would be a BSOD after loading the game. This however was fixed by updating the BIOS

Share this post


Link to post
Share on other sites

The most happening thing in the early days of this century was misusing of assembler instructions in C/C++ game code on the hunt of more and more performance getting over the boundaries of the limited hardware in these days paired with old OSes like Win XP or Win 2k. Ive had more GPU related bluescreens running games on my first maschine then I have had CDs and Floppies all together and one HDD crash since 1997.

 

Most crashes today rely on memory based exceptions I could imagine when writing over pointer boundaries but as anyone above already mentions, that would be captured by a good OS these days.

 

But it is still possible to do very bad things in code when rotating the head and take a view into the virus programming world

Share this post


Link to post
Share on other sites

Here's the most likely scenario a develop will encounter that will damage their computer irreparably.

 

(1) Write a program with a tight infinite loop that taxes the GPU to the maximum of its ability.

(2) Leave the program running on a laptop and go an make a soothing, relaxing mug of chai latte.

(3) Sit down and relax, inhaling the intoxicating aroma from the mug in anticipation.

(4) Pull the laptop on your lap to check how far to completion of the infinite loop has gotten.

(5) Scream in pain and jump to your feet cursing uncontrollably as the heat from the processors sears your sensitive lap flesh with second degree burns.

(6) Spill your sugary sweet and deliciously spiced chai latte all over your laptop keyboard.

(7) Watch as the laptop shuts down, never to boot again.

 

Sure, it's a complex series of steps but it's about the only likely way you;re ever going to fry your computer as a game developer.

Share this post


Link to post
Share on other sites

back in the DOS days, throwing the vidcard into an unsupported mode was a common trick for frying monitors. nowadays, you'd have to purpose write low level driver/kernel code to even try it. and the hardware would probably trap it, even if you bypassed the OS.

 

Latte on the laptop sounds like the most likely scenario you'll have to worry about.

 

of course there are all kinds of other low level stuff you can purpose code as well, like reformatting sectors and such. but none of these are things you'll be doing while writing games - while writing viruses maybe - but not games.  <g>.

Edited by Norman Barrows

Share this post


Link to post
Share on other sites

what is BSOD and what are the blue screens about?

 

Wow you all made my day, I think!

 

In the DirectX (yes Windows) thread it was mentioned that perhaps even these simple directx7 and directx8 SDK libraries could (rarely?) not work on the newer OSs because some GPUs don't thoroughly test for the older libraries.

 

Well, when I read this I was very concerned and thought I might need to port everything over to the current 3d libraries even for a 2D game because I thought an error in this manner could do problems to the system.

 

So it just really can't cause system failures from this type of programming is what I'm understanding!

 

 

Thank you,

Josh

Share this post


Link to post
Share on other sites

So it just really can't cause system failures from this type of programming is what I'm understanding!

 

Most computer parts have several layers of protection against self-harm.

 

I mean, you can intentionally damage hardware if you try hard enough, but it is extremely unlikely to happen by accident.

Share this post


Link to post
Share on other sites

what is BSOD and what are the blue screens about?

 

When the Windows OS encounters an error, it'll auto-recover from the error and sometimes pop up an error message, or even silently just record it and keep on going. This happens pretty frequently. In the last two months or so, your computer probably encountered several hundred errors and automatically recovered without you even knowing about it. A quick check (Windows key + eventvwr, on 'System' filter by 'Error'/'Critical') shows I encountered three yesterday, and 2,168 in the past year. That's very normal and isn't a blue screen.

 

When Windows can't automatically recover silently, it crashes and displays an error screen, which is displayed as a blue screen with white text. Here's an example:

 

unmountable-boot-volume.png

 

(Note how it says Windows automatically is shutting down to prevent harm - this is one of the reasons why you don't need to worry)

 

Here's the more modern one:

BSOD_Windows_8.png

 

Usually, after restarting, Windows continues to work fine, having recovered during the restart. Sometimes you have to do some repair work though. For example, if the blue screen was caused because a piece of hardware naturally wore out and broke (unrelated to any code you run), then obviously that piece would need to be replaced before the blue screen would go away.

 

Note: After 11 years of programming, I only saw a blue screen once (okay three times - I repeated the exact same process to see if it happened again :P), it didn't damage my computer, just crashed it and it restarted fine. That was eight years ago, and I haven't seen one since then.

 

I was under the impression that people incorrectly call blue screens "BSODs", but they are merely blue screens, and the true Blue Screen of Death is when Windows crashes so badly, the blue screen is shown but no error message - it's just a blank blue screen, and your system is bricked. However, I can't see anything to verify that on google.

Share this post


Link to post
Share on other sites

This topic is 474 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this