Holodeck Malfunction

"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."

- Futurama

Some manner of simulator (whether Hard Light Holograms, a Cyberspace Virtual Reality program, or even just robot mannequins) suffers a Phlebotinum Breakdown. Naturally, said breakdown targets the safety features of the simulator first (rather than, say, shutting the whole thing down) and everything Goes Horribly Wrong, turning the sim, originally intended for training or pleasure, deadly.

The heroes inside the sim may be able to fight their way out, or make the sim release them by completing the game. Sometimes however, all they can do is Try Not to Die 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 becoming self-aware. For the other common way for simulations to become deadly, see Your Mind Makes It Real. Compare Orphean Rescue. Compare and contrast Hologram Projection Imperfection.

Anime

 * The Detective Conan Non Serial Movie Phantom of Baker Street has this as the main premise. The VR game console was, and the 50 players have to Win to Exit... or their brains will be literally fried.
 * To Aru Kagaku no Railgun has the cast modeling swimsuits inside a holodeck. Naturally, it malfunctions, and they start getting transported to random "locations," culminating in a 2001 Homage on the surface of the moon.

Comic Books

 * The X-Men's Danger Room goes haywire almost as often as 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 sentient all along) and decide to kill the X-Men.

Film

 * Westworld features the killer robot variant of this plot. As does its sequel Futureworld.
 * Used briefly in the MST3K-worthy Overdrawn At the Memory Bank. 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.

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 Ray Bradbury 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 Revelation Space by Alastair Reynolds, deliberate sabotage turns a training sim into a deadly trap.
 * Vivian Vande Velde's Heir Apparent and User Unfriendly 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.
 * In Piers Anthony'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.

Live Action TV
"Worf: We were like warriors from the ancient sagas. There was nothing we could not do.
 * The Holodeck from Star Trek the Next Generation is the trope namer. 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 Professor Moriarty gaining complete control of the Enterprises's computer. The tendency for the holodeck to malfunction like this has become rather infamous.
 * Between Star Trek the Next Generation, Star Trek Deep Space Nine and Star Trek Voyager this basic plot tended to happen at least Once a Season. 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.
 * 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..
 * 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:

O'Brien: Except keep the holodecks working right."


 * And then, of course, they had their own Holodeck Malfunction episode soon thereafter.
 * A large part of the premise of Virtuality (the failed 2009 pilot, not the film).
 * Red Dwarf: 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, it's so good you don't want to leave. End result: you starve to death. The Dwarfers exit only by
 * The Stargate SG-1 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 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? If this were a real fight, Teal'c wouldn't quit for any reason, so the program disabled it.
 * In Power Rangers in Space, lightning somehow results in simulated monsters breaking free, going to Earth, and impersonating townspeople to lie in wait for the Rangers.
 * The X Files episode "First Person Shooter" featured a video game designer's fantasy wish-fulfillment character gaining sentience and infiltrating another designer's prototype virtual reality First-Person Shooter game to kill players (who, of course, 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 backup copy of the game onto a different mainframe or something.
 * In Warehouse Thirteen, a prototype game consul 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.

Videogames

 * This was the plot of the X-Men game for the Sega Genesis. 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 Kid Chameleon.
 * The game had an relatively subtle reference to Star Trek the Next Generation, in that when the simulation ended, the simulation room looked exactly like the TNG holodeck.
 * Star Soldier: Vanishing Earth's first stage is a training exercise that gets hijacked by the Big Bad near the end.
 * Optic Sunflower's stage in Mega Man X 8. 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.

Webcomics

 * Gunnerkrigg Court parodies this: Dr Disaster sees several students and a teacher disappear from his simulator, and immediately assumes that the sim has trapped them. (Unknown to him, they had merely teleported to another building.)
 * Lampshaded in 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.
 * Doctor Forrester's CFVDEWTOD from The Way of the Metagamer is specifically designed to fail and trap the user within a lethal "simulation", so that he can use it to take over the world.
 * Bob and George 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.

Web Original

 * In one story in the Whateley Universe, 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 Pyrrhic Victory.

Western Animation

 * The Futurama episode "Kif Gets Knocked Up a Notch" parodied Star Trek 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 Evil Lincoln. Judging by the other characters' reactions, this sort of thing is distressingly common.
 * Made all the funnier by Zap's line: "Damn! Last time that happened I got slapped with three paternity suits!"
 * The Itchy-And-Scratchy Land episode of The Simpsons (a parody of Westworld).
 * Star Trek the Animated Series 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 Winx Club, once in the first season and once in the second. The Trix had sabotaged the simulator both times.
 * Re Boot has a variant with one of its Game Cubes . 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.
 * Young Justice has the episode '"Failsafe," in which
 * Speed Racer the Next Generation: 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, the X3 Melange, and the Mammoth Car.