Jump to content

How I crashed Virtual Studio with "Hello World"

Novistion

So yesterday I was showing my cousin "Hello World" in Virtual Studio and when I compiled it and run it, My computer crashed. I was working on something else and I didn't know I had put my phone on my keyboard which hit enter, so I had though I had opened a new window. I found out that I kept trying to run "Hello World" before my other one, and it didn't like that so they kept opening over each other. My computer did that 11298 times before it crash. Yay computer science!!

 

I'm a noob :P

 

Anyone had any programming fails?

Ran by coffee

Link to comment
Share on other sites

Link to post
Share on other sites

I've written many recursive functions in C where I forgot an end case in the function, so I had infinite recursion, causing programs to crash, but I haven't had any cause the system to crash.

Link to comment
Share on other sites

Link to post
Share on other sites

I've written many recursive functions in C where I forgot an end case in the function, so I had infinite recursion, causing programs to crash, but I haven't had any cause the system to crash.

I've actually never caused infinite recursion in C now that I think about it.

 

I've caused thousands upon thousands of seg faults. I've also caused a couple memory leaks. One time in C# I used 6.5GB of RAM because I forgot to remove something from a list at the end of a nested loop.

 

It's pretty hard to kill a PC these days. I remember causing my computer to lock up once when I was screwing around with system calls. I couldn't figure out how I did it, and I'm not even sure if I did it.

Link to comment
Share on other sites

Link to post
Share on other sites

I've actually never caused infinite recursion in C now that I think about it.

 

I've caused thousands upon thousands of seg faults. I've also caused a couple memory leaks. One time in C# I used 6.5GB of RAM because I forgot to remove something from a list at the end of a nested loop.

 

It's pretty hard to kill a PC these days. I remember causing my computer to lock up once when I was screwing around with system calls. I couldn't figure out how I did it, and I'm not even sure if I did it.

I'm still very new at programming, and have only done a semester of basic C programming so far. next semester is advanced programming with C++ and I'm really excited for it.

Link to comment
Share on other sites

Link to post
Share on other sites

i tried to update glibc on the linux production server of the company i work for by compiling the new version and then pretty much just swap the old file with the new file.

kernel panic.

i had dinner very late that night

Link to comment
Share on other sites

Link to post
Share on other sites

i tried to update glibc on the linux production server of the company i work for by compiling the new version and then pretty much just swap the old file with the new file.

kernel panic.

i had dinner very late that night

Well... I now understand why all the companies I've worked at have had very strict procedures for modifying the prod servers

Link to comment
Share on other sites

Link to post
Share on other sites

i tried to update glibc on the linux production server of the company i work for by compiling the new version and then pretty much just swap the old file with the new file.

kernel panic.

i had dinner very late that night

What caused the kernel panic? Also why were you compiling glibc from source?

 

 

Well... I now understand why all the companies I've worked at have had very strict procedures for modifying the prod servers

Yes.

1. Think before you type.

2. Respect others' privacy.

3. With great power comes great responsibility.

If you work for me, you don't get sudo on production servers--if you even get login.

--Neil Hanlon

Operations Engineer

Link to comment
Share on other sites

Link to post
Share on other sites

 

2. Respect others' privacy.

What does me responding to something posted on a public forum have to do with anyone's privacy?

Link to comment
Share on other sites

Link to post
Share on other sites

memory leaks with C... fun times...

 

managed to freeze the class server when most of us forget to free()...

Link to comment
Share on other sites

Link to post
Share on other sites

memory leaks with C... fun times...

 

managed to freeze the class server when most of us forget to free()...

They're not all that hard to diagnose if you've designed your program in a reasonable way and you have a memory tracker like Dr. Memory or Valgrind.

 

I think Dr. Memory tracks when you lose all of the pointers to memory, so it just becomes a case of figuring out why something happened. That's really only a difficult thing if you get a delayed failure. I remember having to debug why my AVL tree crashed 600000 iterations into an algorithm; all I did was set the height on the wrong side of the tree in one method...

 

 

Those are the three rules of sudo.nothing to do with you...

oh... I'm not too familiar with Linux culture. I know enough about Linux to not accidentally blow up my system.

 

Having to be a server admin would be a scary job. If you're not at a company that's big enough to have redundant prod servers and something blows up, that'd be a nightmare.

Link to comment
Share on other sites

Link to post
Share on other sites

They're not all that hard to diagnose if you've designed your program in a reasonable way and you have a memory tracker like Dr. Memory or Valgrind.

 

We were all noobs back then... imagine a class of thirty leaking around 15-20MB per program run over a three hour period of work...

 

the 'server' was a repurposed netbook with 8GB RAM...

Link to comment
Share on other sites

Link to post
Share on other sites

They're not all that hard to diagnose if you've designed your program in a reasonable way and you have a memory tracker like Dr. Memory or Valgrind.

I think Dr. Memory tracks when you lose all of the pointers to memory, so it just becomes a case of figuring out why something happened. That's really only a difficult thing if you get a delayed failure. I remember having to debug why my AVL tree crashed 600000 iterations into an algorithm; all I did was set the height on the wrong side of the tree in one method...

oh... I'm not too familiar with Linux culture. I know enough about Linux to not accidentally blow up my system.

Having to be a server admin would be a scary job. If you're not at a company that's big enough to have redundant prod servers and something blows up, that'd be a nightmare.

The saying is "if you can't fix it, don't break it". It's not really scary if you know what you're doing. Even so, I've had moments where I hesitate to hit the enter key.

--Neil Hanlon

Operations Engineer

Link to comment
Share on other sites

Link to post
Share on other sites

What caused the kernel panic? Also why were you compiling glibc from source?

the new glibc didn't work. i still don't know why precisely, i don't know if i just compiled it badly or i needed to register the new lib or it was just an incompatible version, but the server refused to execute any program from the moment i replaced the file. and when i say 'any program' i mean that ssh didn't work, local login using a keyboard and a mouse plugged directly in the server didn't work, crontabs didn't work. the only things that kept working were the programs already in execution at the time of the disaster (apache, php, mysql, the system in general).

rebooting the server resulted in a kernel panic, supposedly because the kernel uses glibc and i kinda fucked it up

 

at the time i had just bought the stroustrup c++11 book so i was pretty much doing exercise and experiments on the production code that i needed to get done.

after writing the program on my computer, i put it on the server just to find out that glibc and another library were too outdated to run it. i tried to recompile from source on the server but nothing changed.

i was kinda pissed and, stubborn as i am, i wanted to find a way to make it run c++11 rather than convert the program back to c++0x. i spent way too much hours googling trying to figure out how to do the update, until i entered yolo mode and just blindly tried.

lesson learned: never yolo and sudo at the same time.

 

after that, i converted the program to c++0x, it took about half an hour

Link to comment
Share on other sites

Link to post
Share on other sites

the new glibc didn't work. i still don't know why precisely, i don't know if i just compiled it badly or i needed to register the new lib or it was just an incompatible version, but the server refused to execute any program from the moment i replaced the file. and when i say 'any program' i mean that ssh didn't work, local login using a keyboard and a mouse plugged directly in the server didn't work, crontabs didn't work. the only things that kept working were the programs already in execution at the time of the disaster (apache, php, mysql, the system in general).

rebooting the server resulted in a kernel panic, supposedly because the kernel uses glibc and i kinda fucked it up

 

at the time i had just bought the stroustrup c++11 book so i was pretty much doing exercise and experiments on the production code that i needed to get done.

after writing the program on my computer, i put it on the server just to find out that glibc and another library were too outdated to run it. i tried to recompile from source on the server but nothing changed.

i was kinda pissed and, stubborn as i am, i wanted to find a way to make it run c++11 rather than convert the program back to c++0x. i spent way too much hours googling trying to figure out how to do the update, until i entered yolo mode and just blindly tried.

lesson learned: never yolo and sudo at the same time.

 

after that, i converted the program to c++0x, it took about half an hour

 

Very, very odd. I wonder if glibc on the server had been installed in a custom location to begin with and installing it to the default location caused issues.

 

Glad you worked it out!

--Neil Hanlon

Operations Engineer

Link to comment
Share on other sites

Link to post
Share on other sites

Very, very odd. I wonder if glibc on the server had been installed in a custom location to begin with and installing it to the default location caused issues.

 

Glad you worked it out!

of all the people that worked on that system i don't think that anyone had the experience, the knowledge or the necessity to do any kind of custom weird manouver, so i would think that it's an ubuntu server 10.04 LTE standard installation

 

thanks ;)

Link to comment
Share on other sites

Link to post
Share on other sites

of all the people that worked on that system i don't think that anyone had the experience, the knowledge or the necessity to do any kind of custom weird manouver, so i would think that it's an ubuntu server 10.04 LTE standard installation

thanks ;)

Eww Ubuntu.

Yeah pretty much all applications at my current job get installed to /usr/local just for convenience of knowing where they are, and our bootstrap with puppet puts them there. Unfortunately it means new applications can require a fair bit of rpm hacking to make them install to the right place. If they won't recognize the --prefix or --installroot options. :P

--Neil Hanlon

Operations Engineer

Link to comment
Share on other sites

Link to post
Share on other sites

a few months ago i was working on code generation with visual studio dslTools and c#. i was writting code and some times when i changed tab to check something the program would get stuck and eventually crash.

 

It took me a while to discover that every time i left the tab with the code generation program, visual studio would try to generate a preview of the code it would get so, if i left the tab without writting the stop clause on the loop i would get the crash

The best way to measure the quality of a piece of code is "Oh F*** "s per line

Link to comment
Share on other sites

Link to post
Share on other sites

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

×