It still crashes at that dynamic cast line in sdl.cpp and then it doesn't.
I have one build where it works and another where it didn't. I can't get my head around why it work in the one build and not the other, they are completely the same when it comes to using sobjs and source.
It might be related to your DSI issue. I have a very pecualiar condition on my system that zero page accesses are not caught (!), so on my system some DSIs go unnoticed (have reported it to Hyperion). ISI might happen if DSI is ignored.
So maybe you can try my simpler example and check does it trigger either DSI or ISI, or nothing?
Is there anything else needed to build shared objects (apart from -fPIC, -use-dynld and sometimes -shared)? I'm suspecting a missing switch in my linker line, probably.
Also, could you post your libc.so and libstdc++.so sizes anyway, please?
And one more thing just, to understand. If an app uses threading, but I use -athread=single, would the app still work? iuc -athread=single means only one thread is used, while -athread=native allows more than one thread(?)
For creating a shared object: -fPIC is need to compile files for a shared object (library parts) -shared is needed when linking the shared object file itself
For using a shared object: -use-dynld is needed when you want to link an executable file with some shared object (.so instead of .a)
I will check the files at some point but they are really the ones that came with the GCC.
You can try to use -athread=single and I think linker will give you errors if that's a no-go. Generally it's not usable for SDL games, for example, because audio runs in its own thread.
I tested the latest ScummVM and it seems that the internal stack cookie 600000 bytes is not enough. It crashes for me before the menu appears. My default stack is around 132 kilobytes.
If I increase stack to 1000000 and monitor it, it seems that ScummVM is using 69% (690000 bytes) of stack (without game) so it needs more stack.
Please verify this finding and increase the stack cookie value.
Would you maybe have time to update your canary and malloc_hack patch to the latest source?
I apllied them and neither do i get into the game nor does it log any canaries (the database in ram: is always empty).
I'm in contact with the engine author and so far we found absolutely nothing which could cause the crash, even the debug logs on his annd my computer are exactly the same, until i crash suddenly.
Then my "malloc" is not compiled into binary. Introduce some compiler error in "malloc" function and see if compiler reacts to that. If not, then code is not being compiled and it maybe due to preprocessor switches (#if 0 ... #endif).
Hmm, i added some warning() to void realloc() void free() void malloc() and all of those warnings pop up when i start the engine, so the code is at least compiled in.
And i did, by mistake, introduce a compiler error (due to the warnings) and it also showed up.
Something is going wrong while executing i'm afraid.
wrt the repo Yes, after the PR was merged ideleted it again