ikt Posted November 7, 2017 Share Posted November 7, 2017 My Manual Transmission mod suffers from crashes for people with specific hardware and software (ScriptHookVDotNet and a Logitech G920) and I wanna know what's going wrong. Hasn't been very fruitful though, and I'm basically out of options and my search for finding what causes it just makes me more depressed. Current build Solution used Result:A nice stack trace for non-C++ exceptions, like dereferencing a null pointer or going out of an arrays bounds TranslateSecurityAttributesGetHistoryFileDirectoryMetaDataGetDispenserRtlNormalizeStringRtlLookupFunctionEntryKiUserExceptionDispatcherstd::_Debug_message (17)std::array<bool,8>::operator[] (152)WheelDirectInput::IsButtonJustPressed (206)configHPattern (1321)update_wheelmenu (540) Nothing for C++-style exceptions.[br] [03:43:14.669] Crash: Your program has crashed.<nothing>[03:43:14.670] CRASH: Init shutdown Or at least, it was when I did a `std::throw std::runtime_error("bla")`. Now I want to be able to catch that too or at least know where it's thrown from, but by the gods I can't find a library or something that can do this. There's something mentioned about `_set_se_translator(...)` but I'm failing to find an implementation for this. It's not like I'm throwing the real exception or error myself either, it's probably DirectInput. Basically I just want to know what causes my script to cock up and I really *really* don't want to be bothered with anything else, like clean exits. GTAV.exe can crash and burn. Is there a way to just have print where the entire thing explodes and not worry about anything else? Also it's got to not depend on the running system to have specific libs that I can't just redistribute in a zip but that's a second step. The original StackOverflow answer where I got `Dump.h` from mentions something: // if you use C++ exception handling: install a translator function// with set_se_translator(). In the context of that function (but *not*// afterwards), you can either do your stack dump, or save the CONTEXT// record as a local copy. Note that you must do the stack dump at the// earliest opportunity, to avoid the interesting stack-frames being gone// by the time you do the dump.I have no idea how to use this information, but it sounds like it could magically work if set_se_translator() is used. Link to comment Share on other sites More sharing options...
frakka Posted November 7, 2017 Share Posted November 7, 2017 You could try modifying exception handling in VStudioProject properties -> C/C++ -> Code Generationand trying /EHaLook at THISI don't know, however, if using an arbitrary exception handling scheme in the thread of an injected dll (which ASIs are) can be done reliably, disregarding the EH scheme used by GTA5.exe This is dangerous territory... you might end up being even more depressed Link to comment Share on other sites More sharing options...
ikt Posted November 7, 2017 Author Share Posted November 7, 2017 You could try modifying exception handling in VStudio Project properties -> C/C++ -> Code Generation and trying /EHa Look at THIS I don't know, however, if using an arbitrary exception handling scheme in the thread of an injected dll (which ASIs are) can be done reliably, disregarding the EH scheme used by GTA5.exe This is dangerous territory... you might end up being even more depressed I've come a bit further. I already compiled with /EHa but that doesn't make the __catch()+dump thing point where the exception is thrown, for stuff like std::string.at(1);. Also got the two combined, but I'll see further on how it all ties in together. Link to comment Share on other sites More sharing options...