Boeing’s huge 787 Dreamliner could see its engines shut down if it is left running for too long, because of a software glitch.

If the plane is left turned on for 248 days, it will go into a failsafe mode that will lead to the plane losing all of its power, according to a new directive from the US Federal Aviation Administration. If the bug is triggered, the generator control units (GCUs) will shut off, leaving the plane without power and loss of control of the plane.

“If the four main GCUs (associated with the engine mounted generators) were powered up at the same time, after 248 days of continuous power, all four GCUs will go into failsafe mode at the same time, resulting in a loss of all AC electrical power regardless of flight phase,” the directive warns.

Boeing is working on a software upgrade that will address the problems, the FAA says. The company is said to have found the problem during laboratory testing of the plane, which is also known as the Dreamliner.

The company told the Guardian that the problem has only occurred in the lab and that all of the planes in service have been turned off and on again as part of regular maintenance.

It is the latest problem to hit the plane, which is also said to be vulnerable to hacking attacks and to have seen difficulties with batteries that have seen them catching fire. Such problems have seen the planes grounded, though they were returned to service shortly after.