[[quoteright:350:[[Series/StarTrekTheNextGeneration http://static.tvtropes.org/pmwiki/pub/images/moriarty_leaves_the_holodeck_9847.jpg]]]]
[[caption-width-right:350:So, Moriarty is just a {{Hologram}}, right? He can't exist outside of the holodeck, right? Think again! Cogito ergo sum: He thinks, therefore, he is.[[spoiler: Well, that's what he wants you to think...]]]]
->'''Kif:''' This is the holo-shed. It can simulate anything you desire, and nothing can hurt you. Except when it malfunctions and the holograms become real.\\
'''Amy:''' Well, I'm sure that won't happen this time.
--> -- ''WesternAnimation/{{Futurama}}''

%% One quote is sufficient. Please place additional entries on the quotes tab.

Some manner of simulator (whether HardLight {{Hologram}}s, a {{Cyberspace}} Virtual Reality program, or even just robot mannequins) suffers a PhlebotinumBreakdown. Naturally, said breakdown [[FailsafeFailure targets the safety features of the simulator first]] (rather than, say, shutting the whole thing down) and everything [[GoneHorriblyWrong Goes Horribly Wrong]], turning the sim, originally intended for [[VirtualTrainingSimulation training]] or [[TheRuleOfFirstAdopters pleasure]], deadly.

A less complicated variant may simply change the DifficultyLevels of the training simulation. The hero got inside for an EasierThanEasy training, and suddenly discovers that he's in a HarderThanHard (and usually deadly) training. This can be either the result of an enemy hack, or some imprudent dude who saw the BigRedButton of hardest level and asked: "WhatDoesThisButtonDo"

The heroes inside the sim may be able to fight their way out, or [[WinToExit make the sim release them by completing the game]]. Sometimes however, all they can do is TryNotToDie while their friends on the outside repair the sim. And this is never as simple as turning off the power. Either pulling the plug would kill the occupants or it turns out to be impossible for some reason.

Sometimes involves part of the simulator software [[InstantAIJustAddWater becoming self-aware]]. For the other common way for simulations to become deadly, see YourMindMakesItReal. Compare OrpheanRescue. Compare and contrast HologramProjectionImperfection.
----
!!Examples:

[[foldercontrol]]

[[folder: Anime ]]
* The ''Manga/DetectiveConan'' NonSerialMovie ''Phantom of Baker Street'' has this as the main premise. The VR game console was [[spoiler:hacked by an AI called Noah's Ark]], and the 50 players have to WinToExit... or their brains will be literally fried.
* ''Manga/ACertainScientificRailgun'' has the cast modeling swimsuits inside a holodeck. Naturally, it malfunctions, and they start getting transported to random "locations," culminating in a ''[[TheMonolith 2001]]'' {{homage}} on the surface of the moon.
* The entire premise of ''LightNovel/SwordArtOnline'''s Aincrad arc--though, as the game's creator notes in the first episode, the game's deathtrap nature is not a bug, but a ''feature''.
[[/folder]]

[[folder: Comic Books ]]
* The [[Comicbook/{{X-Men}} X-Men's]] Danger Room goes haywire almost as often as [[Franchise/StarTrek Star Trek's]] holodecks. While it's usually because some enemy has intentionally tampered with it rather than a random malfunction or user error, it did eventually develop sentience (or rather, turn out to have been [[RetCon sentient all along]]) and decide to kill the X-Men.
* Weird Pete's 'Virtual Dungeon' in ''ComicStrip/KnightsOfTheDinnerTable'' turns into this, when a malfunction of the VR headsets reults in the players attacking each other and one player jumping out of the window in an attempt to get away from giant spiders.
* Explained in ''LegionOfSuperHeroes'' when the "unique electrical nature" of Lighting Lad's body causes the simulator to go on the fritz. Safety protocols disabled, manual shutdown disabled...
[[/folder]]

[[folder: Fanfiction]]
* In the ''Fanfic/EmpathTheLuckiestSmurf'' story "Virtual Smurfality", the Imaginarium upon its trial run overloads when the Smurfs go off into their own fantasy worlds, trapping them inside the worlds until Empath and several other Smurfs use the mindlink ability to get them all out before the crystals shatter.
[[/folder]]

[[folder: Film ]]
* ''Film/{{Westworld}}'' features the killer robot variant of this plot. As does its sequel ''Futureworld''.
* Used briefly in the MST3K-worthy ''OverdrawnAtTheMemoryBank''. Aram Fingal gets "doppled" into a baboon in an Africa simulation; everything goes south when he gets attacked by an elephant. The technicians are able to pull him out of the simulator quickly enough, but can't find his body to plug his mind back into.
[[/folder]]

[[folder: Literature ]]
* A virtual reality adventure gone out of control provides the basis of the plot of Dennis L. [=McKiernan=]'s novel ''Caverns of Socrates''.
* The Creator/RayBradbury story "The Veldt" featured an educational holodeck program about the animals of the African plains. When the kids begin bypassing the safety protocols, their parents get worried about how real the simulation seems and try to shut the simulator down. When they try to retrieve the kids, the kids send the lions to eat their parents, so they can stay with the animals forever.
* In ''Literature/RevelationSpace'' by Creator/AlastairReynolds, deliberate sabotage turns a training sim into a deadly trap.
* Vivian Vande Velde's ''Literature/HeirApparent'' and ''Literature/UserUnfriendly'' both deal with virtual reality games gone wrong; both games, ironically, were made by Rasmussem Enterprises. In ''Heir Apparent,'' people protesting the violence in Rasmussem's fantasy games (and fantasy in general) damage the computer equipment to which the protagonist is connected, forcing her to either win the game or die. in ''User Unfriendly,'' the protagonists have gotten a hold of an illegal copy of another of Rasmussem's games rather than pay for time, and are playing it at their home. That doesn't go as planned either, and again, the only way out is to win. --Note: By "Win," here, we mean solve the puzzles/defeat the game. You can die as many times as you like in Heir Apparent without dying in real life. The conflict is that she has a limited time before the game shuts down her brain, and she has to keep redoing everything she already did.
* In PiersAnthony's ''Killobyte'', the titular VR game is full-body immersion. A hacker calling himself Phreak makes a virus that keeps people from exiting normally, forcing them to wait until someone can manually pull them out, crashing their character and making them start over. While normally a harmless prank (he enjoys taunting his victims and messing up their games while they're locked in), this turns into a life-threatening situation when he traps a diabetic and a man with a pacemaker that could be shocked into malfunctioning by the game's death-penalty.
* [[IKnowWhatYouFear The Nightmare Machine]] from ''Literature/GalaxyOfFear''. It's actually ''intended'' to take visitors through their worst fears, one by one. The Arrandas try it out, don't like it, leave, and go about their day, but later find they're actually still inside and can't just cut the simulation. Actually it is [[spoiler: a psychic monster]] and they were ''intentionally'' trapped by order of the BigBad.
* In ''The Star Kings'' by Creator/EdmondHamilton the League's secret weapon used similar principle. [[spoiler:During a battle Cloudmen would tap "telestereo" beams and insert recordings of shooting weapons. The energy output would be enough to destroy everything on the bridge within sight of a receiver, putting the ship out of battle or making it a sitting duck. Looks like telestereo receivers were built unreasonably powerful.]] Fortunately, all ships already had countermeasures [[spoiler:portable dampers that can suppress the shots leaving the receiver pad]] and started using them when the hero figured out how the weapon worked. Probably the League was not the first to invent those.
[[/folder]]

[[folder: Live Action TV ]]
* Franchise/StarTrek:
** The Holodeck from ''Series/StarTrekTheNextGeneration'' is the trope namer. Five deadly words: ''The safeties are now off.''
** The most common "simple" breakdown is to lock the senior officers inside and turn off the safety protocols. More extravagant scenarios can occur, such as poorly-worded instructions resulting in a fully sentient simulation of [[Literature/SherlockHolmes Professor Moriarty]] gaining complete control of the ''Enterprises'''s computer. The tendency for the holodeck to malfunction like this has become rather infamous.
** In "11001001", a group of hypercommunicative aliens take over the Enterprise while Captain Picard and Commander Riker are locked in the holodeck, accompanied by [[DistractedByTheSexy a very alluring (and remarkably advanced) barfly program.]]
** "The Big Goodbye" is the first episode featuring a holodeck malfunction, trapping Picard, Data, Crusher, and a Red Shirt inside the "Dixon Hill" program with absent safety protocols.
** Between ''Series/StarTrekTheNextGeneration'', ''Series/StarTrekDeepSpaceNine'' and ''Series/StarTrekVoyager'' this basic plot tended to happen at least OnceASeason. [[LongRunner That's a lot of episodes.]] Some explored issues regarding the tech that didn't require it to technically malfunction, usually someone becoming addicted to the fake reality it created.
*** At least three times their holographic technology has accidentally created fully actualized sentient beings. Though in each instance, there was a deliberate action taken that simply had an unintended consequence. Which is really rather [[FridgeLogic ironic]] when one considers how much significance is attached to Data (and his sibling Lore) being fully-sentient ''androids'', a technology which apparently only their creator fully-understood and which the Federation cannot duplicate (at one point they wanted to disassemble Data to try to figure it out). Yet it would seem that starship computers can generate fully-sentient ''holograms'' with just a poorly-worded command from a user.
*** One time they left a program running too long and eventually the perceptual filters (which apparently keeps them holograms from noticing anything that doesn't fit the parameters of their program) futzed out and they became aware something weird was going on. The crew fixed that up by letting the holograms believe they were real, but the crew were time-travelers.
** Lampshaded when Worf joined the crew of [=DS9=], and reminisced about his time on the ''Enterprise'' with an old shipmate:
---> '''Worf:''' We were like warriors from the ancient sagas. There was nothing we could not do.
--->'''O'Brien:''' Except keep the holodecks working right.
*** And then, of course, they had their own HolodeckMalfunction episode soon thereafter.
** In an unusual nod to capitalism, notably averted with Quark's privately owned holosuites on ''[[Series/StarTrekDeepSpaceNine Deep Space Nine]]''. [[ProudMerchantRace Having an unreliable holodeck drives away paying customers]], so not only did they rarely endanger anyone, Quark was able to use them to save the crew's lives at least once.
*** Though there was that one time ("Our Man Bashir") that everyone's "genetic patterns" got transferred into Bashir's Film/JamesBond {{Expy}} Holonovel for safekeeping while the transporter got repaired, and the safeties were turned off. Bashir at one point shoots Garak to stop him from leaving the holosuite and potentially dooming the crewmembers who were still caught mid-transport. In this case the holodeck "malfunction" (really an unusual data-storage stopgap for a [[TeleporterAccident transporter malfunction]]) actually saved their lives, as without a body to return to all the crewmembers in question would have simply ceased to be.
** Averted -- or maybe inverted -- in the Series/StarTrekDeepSpaceNine episode ''Badda-Bing, Badda-Bang''. The holographic Vic Fontaine is threatened by mobsters, and if the crew doesn't save him, he'll be [[KilledOffForReal permanently deleted]]. Deleting the bad guys or reprogramming the holodeck simply won't work: they have to solve the problem in-game and in-character. What's notable is that it's ''not'' a malfunction: it was programmed into the story as an "expansion pack" of sorts. (And resetting isn't an option, as the crew would consider overwriting Vic's memories as the death of a good friend.) This is likely the only time in Star Trek that a crisis is caused by the holodeck operating ''exactly as intended''. (Except perhaps for "Our Man Bashir" above.)
** ''Voyager'' played with this in one rather trippy episode, which starts off with the Doctor embroiled in an apparently "mundane" crisis, only for increasingly weird things to happen. Eventually, he's told that the whole thing is a Holodeck Malfunction. [[spoiler: It is, but not the one he's being told it is]].
*** That and the time in ''Voyager'' that a program was deliberately turned into a DeathTrap by an actual villain with previously established engineering skill.
** In ''Bride of Chaotica'', the problem is actually the result of the holodeck operating exactly as it should when interdimensional explorers stumble into one of Tom Paris' "Captain Proton" stories. Doctor Chaotica reacts to the newcomers just like a campy, over-the-top {{expy}} of [[ComicStrip/FlashGordon Ming the Merciless]] should: trying to conquer their civilization with his army of robots and giant DeathRay. The aliens don't realize that Chaotica is a fictional character, and its the ensuing war that puts ''Voyager'' in danger; not the holodeck, itself.
* A large part of the premise of ''Virtuality'' (the failed 2009 pilot, not the film).
* ''Series/RedDwarf'': The simulation program in "Gunmen of the Apocalypse".
** A subversion involves one of the game characters coming to life and Rimmer ends up shooting him with a bazookoid, helping to gain the confidence to become Ace Rimmer. Turned out, Lister had dressed up to play the part and loaded the gun with blanks.
** The "Better Than Life" simulation in the books inverts this by working exactly as designed - it really is 'better than life'. Trouble is, once you're in, you aren't aware it's a game and even if you are, [[LotusEaterMachine it's so good you don't want to leave]]. End result: you starve to death. The Dwarfers exit only by [[spoiler:Rimmer being such a twisted and bitter human being that his neurosis first turns his own fantasy, then the others', into hell.]]
* The ''Series/StargateSG1'' episode "Avatar", where Teal'c gets trapped in a training simulation of the SGC getting invaded by Goa'uld. Problem is, despite all the successes they had, Teal'c still believes on a subconscious level that the Goa'uld cannot be beaten. Therefore, the game won't let him win because it's programmed to learn from the user, even by [[NintendoHard spawning nigh-invulnerable enemies]] and even if the electric shocks caused by dying in the simulation puts the user in cardiac arrest. Oh, and the failsafe-exit he could use to abort the simulation at any time? [[ProudWarriorRaceGuy If this were a real fight, Teal'c wouldn't quit for any reason]], [[GoneHorriblyRight so the program disabled it]].
* In ''Series/PowerRangersInSpace'', [[LightningCanDoAnything lightning]] somehow results in simulated monsters breaking free, going to Earth, and impersonating townspeople to lie in wait for the Rangers.
* ''Series/TheXFiles'' episode "First Person Shooter" featured a video game designer's fantasy wish-fulfillment character gaining sentience and infiltrating another designer's prototype [[{{Cyberspace}} virtual reality]] FirstPersonShooter game to kill players (who, of course, [[YourMindMakesItReal die in real life]]). A famous gamer is brought in (but fares no better) and ultimately Mulder and Scully end up going in to take down the marauding avatar. Rather than, you know, just scrapping the killer video game or loading a [[NoPlansNoPrototypeNoBackup backup copy]] of the game onto a different mainframe or something.
* In ''Series/{{Warehouse 13}}'', a prototype game console traps the users inside, and started to use their own fears against them. One of these fears grows strong enough to steal the controllers from the players, effectively trapping them inside.
[[/folder]]

[[folder: Videogames]]
* This was the plot of the ''Franchise/{{X-Men}}'' game for the SegaGenesis. Magneto infects the Danger Room computer with a virus to turn its simulations deadly; every level except for the last one involves beating these simulations.
* Pretty much the whole backstory of ''KidChameleon''.
** The game had an relatively subtle reference to ''Series/StarTrekTheNextGeneration'', in that when the simulation ended, the simulation room looked exactly like the TNG holodeck.
* ''StarSoldier: Vanishing Earth''[='=]s first stage is a training exercise that gets hijacked by the BigBad near the end.
* Optic Sunflower's stage in ''VideoGame/MegaManX8''. The stage is a Maverick Hunter training base that makes heavy use of VR; to progress safely, you have to pass the "tests" with flying colors.
* One quest in the Citadel DLC of ''VideoGame/MassEffect3'' ends with a glitched fight in the Armax Arsenal Arena that throws waves of the toughest mooks in the game at you. Unlike other Arena battles, falling in this fight ''will'' result in a [[GameOver Critical Mission Failure]]. Unusually, Shepard is actually ''trying'' to cause a malfunction, as the maintenance crew has asked him to tax the simulator as much as possible in order to pinpoint an elusive glitch and this plan [[GoneHorriblyRight works better than they thought it would.]]
* The premise of the ''VideoGame/{{Doom}}'' WAD "Cleimos."
[[/folder]]

[[folder: Webcomics ]]
* ''Webcomic/GunnerkriggCourt'' parodies this: Dr Disaster sees several students and a teacher disappear from his simulator, and immediately assumes that the sim has trapped them. ([[WrongGenreSavvy Unknown to him]], they had merely [[TeleportersAndTransporters teleported]] to another building.)
* Lampshaded in ''{{Webcomic/Intragalactic}}''. When the cast gets their spacecraft repaired, the mechanic points out their holodeck is an unsafe model, prone to malfunctioning, to which captain Benjamin replies that it's the whole point of it. Holodecks just aren't fun unless they periodically lock people inside and turn off safety protocols.
* [[MST3K Doctor Forrester's]] [[FunWithAcronyms CFVDEWTOD]] from ''TheWayOfTheMetagamer'' is specifically designed to fail and trap the user within a lethal "simulation", so that he can use it to take over the world.
* ''Webcomic/BobAndGeorge'' has Proto Man lampshade this during X's introduction. The second time the holodeck is used, it breaks while Proto Man is attempting a convoluted plot to get X's buster and holodecks even gets referenced by another character at one point. It's even implied that ''it never got fixed to begin with.''
* To repair Samus's Varia Suit, JD had to upload Samus's consciousness to his computer in ''Webcomic/MetroidThirdDerivative''. JD had Samus take the Space Pirate training program to help pass the time. Unfortunately JD uploaded Samus's mind on [[http://bobandgeorge.com/comics/metroid/367/1 Mother Brain's Tourian network]]. Mother Brain wasted no time in attacking Samus.
[[/folder]]

[[folder: Web Original]]
* In one story in the WhateleyUniverse, two hackers went after Team Kimba by trapping them in a sim without their armour or weapons, facing a group of pissed-off simulated attackers. The Kimbas manage to use their smarts to get out, but it's a PyrrhicVictory.
[[/folder]]

[[folder: Western Animation ]]
* The ''WesternAnimation/{{Futurama}}'' episode "Kif Gets Knocked Up a Notch" parodied ''Franchise/StarTrek'' with the ''Nimbus'''s Holo-Shed, which malfunctions and causes History's Greatest Villains to come back to life: Attila the Hun, Professor Moriarty, Jack the Ripper, and ''[[EvilTwin Evil Lincoln]]''. Judging by the other characters' reactions, this sort of thing is distressingly common.
** Made all the funnier by Zapp Brannigan's line: "Damn! Last time that happened [[NoodleIncident I got slapped with three paternity suits!"]]
* The Itchy-And-Scratchy Land episode of ''TheSimpsons'' (a parody of ''Westworld'').
* ''WesternAnimation/StarTrekTheAnimatedSeries'' gives the ''original'' NCC-1701 Enterprise's rec room a hologram feature, a full decade and then some before TNG's (in)famous holodeck. You get ''no'' points for guessing what happens.
** The episode "Once Upon a Planet" featured the crew returning to the amusement park planet of "Shore Leave" (see Live Action TV) to find that it was now actually hostile.
* Happens twice in ''WesternAnimation/WinxClub'', once in the first season and once in the second. The Trix had sabotaged the simulator both times.
* ''{{ReBoot}}'' has a variant with one of its Game Cubes[[note]] normally only dangerous if they lose, and limited to the area caught in the game[[/note]]. When Megabyte extracts Mainframe's core energy from the Principal Office, a Game Cube that lands on it gets corrupted, blending aspects of the game reality and the Principal Office. If the User wins the Principal Office gets destroyed and Mainframe crashes, but if anyone else wins the core energy leaves with the game and Mainframe crashes. Bob has to keep the game running until he can get the core energy back inside the Principal Office to stabilize the game and let it leave safely.
* ''WesternAnimation/YoungJustice'' has the episode [[spoiler: '"Failsafe,"]] in which [[spoiler: Miss Martian, unable to process that she is in a training simulation after watching Artemis "die" in front of her, loses control of her powers and rewrites the entire team's memories so they believe the simulation is real - including their own deaths, causing them to slip into comas in reality.]] Although strictly speaking, this wasn't a holodeck malfunction; the only problem was the person using it.
* ''SpeedRacerTheNextGeneration'': In the three-parter "The Fast Track", the energy amplifier used to allow Speed and Annalise to escape the sabotaged virtual track also allows some of the virtual constructs to exit the track into the real world. They are: a giant version of Conor, [[Anime/SpeedRacer the X3 Melange, and the Mammoth Car]].
* In the ''[[TMNT2003 Teenage Mutant Ninja Turtles]]'' (2003) "Secret Origins" arc, the turtles and Splinter are taken to the Utroms' Oracle Pod Chamber, which allows them to experience the aliens' collective memory in a virtual reality environment. Unfortunately, after some sabotage by Baxter Stockman, the environment becomes deadly, and the turtles are forced to look for the failsafe embedded inside the simulation before their minds can return to their bodies.
* In ''StevenUniverse'', Rose Quartz's room in the temple can create things and simulations of people using clouds. In the two episodes it has appeared so far, a poorly-worded or accidental request caused problems. Also, asking it to do a lot (such as simulating an entire town) can overload it and cause glitches.
** In its first episode "Rose's Room" it inverts the classic form of this trope: [[spoiler: something from the simulator doesn't become real but the simulator instead attempts to replicate the entire town surrounding it in itself such that it's almost inescapable.]]
[[/folder]]
----