Merged. Now the fun begins.
Malcolm III Canmore was more or less reliably reported to have married Ingibjorg, widow of Thorfinn Sigurdarson of Orkney. She would have been close to his own age, of known fertility (two sons of her own, Paul and Erlend, joint Jarls of Orkney as of 1066 - they may possibly have been twins, as they are *always* mentioned together), and nominally in control of Caithness and Sutherland in Scotland (in her sons' name) as well as regent of Orkney. Through her Malcolm could and probably did lay claim to the territories that his great-grandfather (and namesake) had bestowed upon Thorfinn.
He had at least three sons (Duncan, Donald and Malcolm) by the time he married Margaret of Wessex (aka Saint Margaret) circa 1170.
When his first wife died is a matter of conjecture. It is generally assumed that he was a widower when he married Margaret - but Harald Hardraada was certainly no widower when *he* took a second wife, nor Harold Godwinson for that matter. (Nor had Cnut been, earlier in the century, when he married Emma alias AElfgifu.)
On the other hand, Margaret probably had some say in all this, and wouldn't have agreed to "bigamy".
His known children by Margaret were (birth order not necessarily exact):
1. Edward, killed 1093
2. Edmund of Scotland
3. Ethelred, abbot of Dunkeld
4. King Edgar of Scotland
5. King Alexander I of Scotland
6. King David I of Scotland
7. Edith of Scotland, also called Matilda, married King Henry I of England
8. Mary of Scotland, married Eustace III of Boulogne
Ethelred of Dunkeld is often equated with the Aedh or "Heth" or "Beth" (= Hugh) who made claims on Fife and/or Moray in the early 12th century and witnessed some royal charters between c. 1114 and 1130; but this is probably incorrect because the actual ruler of Fife in his time was one Causantin, a descendant of King Dubh (or Duffus, > "MacDuff") .
Moray had been MacBeth's stronghold, and had passed from him to his (step)son Lulach, to Lulach's son and then daughter, and through her to her son Angus (father unknown).
Getting back to Ethelred, he may have had some disability (such as a club foot) which would have disqualified him from the succession but was no bar to his success in the Church.