same here. I'll spare everyone the rant, but in a nutshell: at first I thought it was a hardware error. took it to tech support, spent time and money, and came out empty. they were very helpful, but underprepared (they used cloud tools straight from Apple that detected nothing).
then I thought it was due to there not being an upgrade path from Mavericks to Yosemite. so I wiped the whole thing and installed from zero. the problem came back a few months later.
now I'm about to downgrade to Mavericks.
the funniest thing is that I installed Windows 8.1 via Bootcamp, played lots of games in Steam, and never had any problems. I remember those "I'm a Mac, I'm a PC" ads making fun of Vista because its user base was downgrading to Windows XP... oh well. (ok sorry I had to mention this)
so anyway, I found a tragicomic solution: either downgrade to Mavericks (fingers crossed) or install Windows 8.1 via Bootcamp and never boot into Mac OS again. of course I'm getting a PC after this, and I'm taking legal action as well. see you in court, Apple.