Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [DFHack] [plugins] Catching serious exceptions/errors  (Read 1206 times)

jeancallisti

  • Bay Watcher
    • View Profile
[DFHack] [plugins] Catching serious exceptions/errors
« on: November 08, 2013, 08:12:21 pm »

Hello everyone,

I'm encountering the following situation :

  • 1. Inside stonesense, I add the following code :
Code: [Select]
vector<int> v;
int i = v[-1];
    • 2. This code is obviously faulty as index -1 is out of boundaries
    • 3. It causes the main Dwarf Fortress window to hang, instead of stonesense crashing or exiting

    the same kind of annoying hanging happens with null pointers exceptions.

    Anybody knows if it's because Allegro or SDL or DFHack's design?
    Is there a way to debug more efficiently? (at least, have a crash with an actual error message). Logging doesn't help there. There's nothing in stonesense.log -- everything just hangs.
    « Last Edit: November 08, 2013, 08:14:37 pm by jeancallisti »
    Logged

    Warmist

    • Bay Watcher
    • Master of unfinished jobs
      • View Profile
    Re: [DFHack] [plugins] Catching serious exceptions/errors
    « Reply #1 on: November 09, 2013, 07:50:24 am »

    I'm not sure 100% but i think it's because of dfhack design. Because it runs in the same process any error that happens is in effect a df error. The only difference being that not the main thread crashes (and thus all of df) but a different stonesense thread. This in effect hangs the df waiting for plugin to return.