- fixes #3136
- the problem is related to Boost path and a static initialized internal pointer
- using a std::string in CDBEnv::EnvShutdown() prevents the problem
fix crash on shutdown when e.g. changing -txindex and abort action #6282
pull Diapolo wants to merge 1 commits into bitcoin:master from Diapolo:fix_shutdown changing 2 files +9 −7-
Diapolo commented at 5:49 am on June 15, 2015: none
-
in src/wallet/db.h: in 38693906f8 outdated
27@@ -28,6 +28,7 @@ class CDBEnv 28 bool fDbEnvInit; 29 bool fMockDb; 30 boost::filesystem::path path;
laanwj commented at 6:07 am on June 15, 2015:Shouldn’t this field go away, then?
Diapolo commented at 6:17 am on June 15, 2015:I didn’t replace all occurances, because it’s used when building paths still.
laanwj commented at 7:26 am on June 15, 2015:Do add a comment then, on why the duplicated field was added. Otherwise people will be really confused to read this code.laanwj commented at 7:31 am on June 15, 2015: memberIf
boost::path
gives any problems at static deinitialization, I still dont feel good with this.My suggestion would be to precompute all the usages of
path
inCDBEnv::Open
. E.g.0std::string strPath; 1std::string strPathLogDir;
Then in the initialization
0strPath = pathIn.string(); 1strPathLogDir = pathLogDir.string();
Remove the
boost::filesystem::path path
field. Replace the usages ofpath
outsideCDBEnv::Open
with these precomputed strings.laanwj added the label Bug on Jun 15, 2015Diapolo commented at 12:36 pm on June 15, 2015: none@laanwj See pull after rebase, I removed thepath
field, but as quite some functions require a boost::filesystem::path I couldn’t eliminate all uses (e.g.TryCreateDirectory()
andboost::filesystem::remove_all()
). And also I didn’t want to play with the/
operator used in boost::path as dir separator, so I didn’t replace it with the string/
, which could cause problems on certain OSes, where a native path separator is perhaps different.Diapolo commented at 1:13 pm on June 15, 2015: noneSeems the build faulire is unrelated to the pull: “No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.
The build has been terminated”
laanwj commented at 1:41 pm on June 15, 2015: memberLooks good to me, utACK, travis error is the misbehaving comparison tool again…Diapolo commented at 10:19 am on June 16, 2015: noneNow it passed, great!laanwj commented at 12:09 pm on June 16, 2015: memberI removed the path field, but as quite some functions require a boost::filesystem::path I couldn’t eliminate all uses
Right. Eliminating the uses of boost::filesystem is not the goal here, just avoiding that a static
filesystem::path
field stays around as part of CDBEnv, which this does now.fix crash on shutdown when e.g. changing -txindex and abort action
- fixes #3136 - the problem is related to Boost path and a static initialized internal pointer - using a std::string in CDBEnv::EnvShutdown() prevents the problem - this removes the boost::filesystem::path path field from CDBEnv
in src/wallet/db.h: in 0a821300e9 outdated
26@@ -27,7 +27,7 @@ class CDBEnv 27 private: 28 bool fDbEnvInit; 29 bool fMockDb; 30- boost::filesystem::path path; 31+ std::string strPath;
laanwj commented at 12:11 pm on June 16, 2015:Please add a comment here why this field is a string instead of aboost::filesystem::path
, so that a future smart-ass doesn’t think “hey let’s use that type directly” and changes it back.
Diapolo commented at 1:04 pm on June 16, 2015:Done!sipa commented at 1:43 pm on June 16, 2015: memberutACKlaanwj merged this on Jun 18, 2015laanwj closed this on Jun 18, 2015
laanwj referenced this in commit cbec57fd71 on Jun 18, 2015Diapolo deleted the branch on Jun 19, 2015laanwj referenced this in commit daf956b7b1 on Jun 23, 2015MarcoFalke locked this on Sep 8, 2021
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-18 21:12 UTC
More mirrored repositories can be found on mirror.b10c.me