Just add -proxy=crashme as parameter and on Windows and this will lead to an APPCRASH.
I looked what that parameter causes, which is calling InitError(), which aborts AppInit2() and causes a return 1; to exit the client.
Knowing this I was placing a return false; in AppInit2() to see when the crash starts to occur. This is the case after the first bitdb.open() in Step 5 of the initialisation (https://github.com/bitcoin/bitcoin/blob/master/src/init.cpp#L587).
I digged deeper into this and found out, that the crash is triggered in CDBEnv::EnvShutdown() (https://github.com/bitcoin/bitcoin/blob/master/src/db.cpp#L41), which is called when destroying the bitdb global.
What I did not yet fully understand (because of a bad working Debugger), why would DbEnv(0).remove(GetDataDir().string().c_str() (https://github.com/bitcoin/bitcoin/blob/master/src/db.cpp#L41) cause this. Is it a problem with GetDataDir() or string()?
Anyway, I have a fix ready, which prevents this crash #2024.
Perhaps there is a better way to fix this, so core devs should take a look.
Just add
-proxy=crashmeas parameter and on Windows and this will lead to an APPCRASH.I looked what that parameter causes, which is calling
InitError(), which abortsAppInit2()and causes areturn 1;to exit the client.Knowing this I was placing a
return false;inAppInit2()to see when the crash starts to occur. This is the case after the firstbitdb.open()in Step 5 of the initialisation (https://github.com/bitcoin/bitcoin/blob/master/src/init.cpp#L587).I digged deeper into this and found out, that the crash is triggered in
CDBEnv::EnvShutdown()(https://github.com/bitcoin/bitcoin/blob/master/src/db.cpp#L41), which is called when destroying thebitdbglobal.What I did not yet fully understand (because of a bad working Debugger), why would
DbEnv(0).remove(GetDataDir().string().c_str()(https://github.com/bitcoin/bitcoin/blob/master/src/db.cpp#L41) cause this. Is it a problem with GetDataDir() or string()?Anyway, I have a fix ready, which prevents this crash #2024.
Perhaps there is a better way to fix this, so core devs should take a look.