Thanks for the answer. I tried to get gdbstub running but when it crashes, I can't get a backtrace because the connection gets cut.
It's strange, because I don't think it something related to nwindowGetDefault(), because if I call that function elsewhere it returns a valid handle just fine. So...