FYI, please check the following:
- if this file contains the line "exec startkde", delete this line - it's causing a logout error (you'll have to logout twice to actually logout).
If you have no need for the .xinitrc or .xsession files, you can delete these. .xinitrc is called by .xsession which was used by kdm which is not supported by kde5. Unless you have personally modified these files for a specific reason, you can delete them.
Also, I've found confirmation that there is a QXcbConnection bug that causes crashes of kde/plasma processes that use QtSql. Apparently, qtsql connections are being closed asynchronously and randomly before the kde services are ready for their connections to be closed. There is a bugfix for this that will be released with Qt 5.8.https://bugs.kde.org/show_bug.cgi?id=348194
You can read through the whole bug report, but the relevant parts start at comment #27.