Safina was serving at 1-1 in the first set when she stopped play, walked over to her chair and covered her face with a towel. She then told the chair umpire she could not continue.
Organizers said Safina will decide on Thursday whether she can continue playing in the lucrative tournament.
Safina's margin over Williams is so slim that the player who performs best in Doha will end the year as No. 1. Williams won her first match Tuesday and played her sister Venus later Wednesday.
The tournament features the top eight players in the world, with a group stage before the semifinals.
Earlier on Wednesday, Caroline Wozniacki saved a match point in the final set and beat Victoria Azarenka 1-6, 6-4, 7-5.
Azarenka was up a break four times in the third set but failed to put the match away, letting the 19-year-old Dane break back each time.
Wozniacki, who had just two winners in the first set, saved a match point with Azarenka leading 5-4 in the third before finally holding serve for the first time in the decider.
"I just felt like I hadn't lost the match yet," Wozniacki said. "She still had to win one more point."
Wozniacki broke again for 6-5 after the Belarusian was docked a point for smashing her racket. Azarenka had already been warned in that game after hitting the ball out of the court following another unforced error.
Wozniacki sealed the win with a service winner after 2 hours, 58 minutes.
It was the 19-year-old Dane's first match in the tournament, while Azarenka defeated Jankovic in her opener.
Each group stage win is worth $100,000, with the eventual winner taking home up to $1.55 million.
Wozniacki seemed bothered by the sore hamstring that forced her to retire from her first-round match at the Luxembourg Open last week. She wore strapping around her left thigh, icing it during changeovers and stretching repeatedly between points.
"The strapping definitely helped," she said. "You try not to think about it too much, especially in the important moments. ... It's not great for the leg, running this much."