I have this issue where a perl script will sometimes freeze Xorg. It's an extension for urxvt that detects URLs and allows me to "launch" them in the browser. Sometimes, upon launching, Xorg will freeze. I have not seen a pattern as to when it happens and when it doesn't. My main issue is obtaining more information. The computer won't let me do anything in Xorg, nor switch to another virtual terminal. Should I try looking at the Xorg logs?
Try looking at
If Xorg locks up and you can't change to a console, then Magic SysRq can allow you to bail out.