Software problems that played a role in two deadly plane crashes involving Boeing’s new 737 Max commercial jetliners are proving to be financially calamitous for the Chicago-based aerospace giant, which reported its largest-ever quarterly loss Wednesday.

Boeing lost $3.38 billion for the quarter on $15.7 billion revenue, sending its stock down close to 3 percent by early afternoon. Executives said the company may have to temporarily shut down its 737 Max production, an extraordinary step that would send ripple effects throughout the global aerospace industry. The company already slowed the production rate.

Boeing faces a crisis with no end in sight, as its once-promising 737 Max commercial jetliner has been grounded for well over four months.

“This is a defining moment for Boeing, and we’re committed to coming through this challenging time better and stronger as a company,” chief executive Dennis Muilenburg said in a call with investors.

The company is working to fix a host of technical problems related to the plane’s flight control systems, and executives have estimated the planes will be deemed flight worthy early in the fourth quarter of 2019, noting regulators control the timing.

So far, regulators have provided no firm timeline for when they will allow the planes to fly again, and Boeing executives emphasized the timeline could slip further depending on regulators’ decisions. Airlines are assuming the crisis will continue late into the fall, canceling hundreds of flights every day.

The 737 Max is the newest version of Boeing’s best-selling commercial jet. It was pitched as an even more reliable version of a long-trusted plane, complete with engine updates that made the plane more fuel efficient.

However, the company added a new flight control system called the Maneuvering Characteristics Augmentation System, or MCAS. That system was designed to make the plane behave as similarly as possible to past models, with minimal new training for pilots. It was later discovered that the system can override pilots’ manual controls in certain rare but dangerous situations, pushing the plane into a nose-dive.

These problems played a role in the October 2018 crash of a 737 Max 8 that killed 189 people in Indonesia, according to investigation reports and Boeing executives. Then, in March, another Max 8 crashed under similar circumstances, killing 157 people.

The Federal Aviation Administration ordered the planes to be grounded soon after the second crash. It initially mandated a set of fixes “no later than April,” but the timeline slipped as Boeing and the FAA discovered more problems with the plane’s flight control software.

In the meantime, the financial effects are mounting for Boeing and airline customers. Executives said Wednesday they could not estimate how much the crisis would affect the company’s earnings for the year.

Last week the company reported a $5.6 billion charge needed to compensate 737 Max customers. It faces lawsuits from the family members of the 346 people who died aboard the doomed Indonesia and Ethiopia flights, as well as continued scrutiny from Congress.

Teal Group aerospace analyst Richard Aboulafia said Boeing is doing “a decent job” managing the financial fallout of the Max crisis given the tremendous uncertainties at play.

“It’s unclear how much guidance they can offer given how much is out of their control,” Aboulafia said. Boeing’s “track record has been that they will say one thing, and then news is broken elsewhere . . . from an airline or the FAA.”

Issues with the 737 Max overshadowed what was an otherwise successful quarter for Boeing’s other business units. The company’s defense, space and security division saw a 159 percent jump in quarterly earnings over the previous year, and the company’s new global services unit continued to grow.