1
Utilities and 3rd Party Applications / Re: Dwarf Therapist (Maintained Branch) v.37.0 | DF 42.06
« on: October 30, 2017, 07:27:32 pm »And finally, could you say a bit more about DF crashing when quitting therapist. I've yet to experience it as therapist has closed without having this effect but I have yet to unpause a game with 38.1. What use conditions are likely to trigger it, and possible workarounds for safe(ish) use with linux 64 in the meantime.Writing strings on Linux replace the string data pointer with a buffer that was not properly allocated. This make DF crash when it try to deallocate the buffer, this can happen when quitting (destroying the string after saving), it doesn't seem to corrupt the save, or when replacing the string (changing the same string from the game after it was changed from DT). The safe workaround is to not change strings from DT.
I am experimenting with injecting a call to std::string::assign instead so the memory is managed correctly.
tip: ptrace is painful enough as it is, don't try to reimplement ld.so, I suggest just shell out to gdb. it will have minimal problems as long as you make sure that df is stopped by SIGSTOP and not just by ptrace attachment.
