A method for processing an endless loop of a game server includes the steps of firstly, detecting the endless loop, after judging that a main thread enters the endless loop, hanging up the main thread through a monitoring thread, and temporarily stopping running of the main thread; secondly, after a Lua language program of the main thread enters the endless loop, actively triggering errors in the running process of the Lua language program by processing the monitoring thread, and stopping running of the Lua language program, then jumping back to C/C++, relieving from the endless loop, preventing the same codes from running again through subsequent processing, and preventing the game server from entering the endless loop again. The method for processing the endless loop of the game server is stable and effective.