PI Freezes

Do you have the same issue if you use C or Python? In my case both worked but XOJO did not. Also if memory serves me correctly, if you are running an update to date version of Raspian sudo should not be needed.

I tried the example pwm.c that comes with wiringPi.
It is a simple fade out / fade in for GPIO 18.

That also crashes the Pi if not run root/sudo.

One of the release comments for wiringPi states that PWM access non-root
is very likely to crash the system.