Golinduc was the wife of a court magician who served King Khosrau I of Persia. This places the story in the sixth century.
She was blessed with a vision of Heaven, perhaps because she meditated to find Truth after becoming disillusioned with Zoroastrianism, the prevalent religion in Persia before (and even after) the Muslim conquest. Golinduc found some Christians, received instructions, and was baptized as Mary. Abandoning her influential husband might have seemed a normal consequence of salvation to her, but he took it badly and complained to his boss. Although Khosrau has a broad reputation for wisdom and tolerance, he didn't take kindly to his chief magician's wife deserting him for adherents to the Roman religion. After all, Sassanid Persia and Byzantine Rome were mortal enemies.
G-Mary was arrested, and when she refused to re-apostatize (repostize?), she was exiled to a fortress called Oblivion. She spent eighteen years there, but the harsh conditions seemed to strengthen her faith.
Khosrau I was succeeded by his son, Hormizd IV. Although history is generally not kind to H4, he favored toleration of the Christians. This may have led to conflicts with Sassanid nobility, which always winds up in executions, confiscations, and tears, but the legends of the saints sometimes portray him favorably. He permitted a Byzantine ambassador named Aristobalus to visit G-Mary in prison. She learned the Psalms from him, which gave her something to sing while she was languishing since "Swing Low, Sweet Chariot," had not yet been written.
H4 also has a reputation for being imperious, petty, and cruel. For example, he sent for G-Mary and tried to torture all the Christianity out of her. The legend records that she was shielded from all this, including being made invisible when first she was condemned to a brothel and then to the executioner. I'm not so sure about the invisibility thing, but I can imagine that a woman had lived on a near-starvation diet in a place called Oblivion wasn't going to rate in the top ten escorts at the Ctesiphon House of Pleasure. As for the executioner, there are all sorts of reasons why the axe didn't fall, the most likely being H4's mercurial character.
According to the legend, G-Mary protested her escape from the chopping-block, noting that she wanted martyrdom. An angel was promptly dispatched to assure her that given the eighteen years in prison, including six months in a snake pit which was supposed to have been fatal, her martyrdom was secured. In the remaining years of her life, she made pilgrimages and testified for The Lord, which was a productive use of the time.