This would definitely appear to be a software problem. First, I'd check for any software updates available for your unit. That could resolve the issue.
Second, you could try rebooting your computer, holding down the shift key on the keyboard once you hear the startup chime. This will boot the computer into safe mode, bypassing any third party software that may be contributing to the issue.
If the problem persists, you will probably need to reinstall your operating system.
If booting into safe mode resolves your problem, you'll need to troubleshoot what software is causing your issue. I usually start by looking for suspicious third party software in the following locations:
/Library/LaunchAgents
/Library/LaunchDaemons
/Library/StartupItems
~/Library/LaunchAgents
~/Library/LaunchDaemons