Skip to content

Conversation

uhliksk
Copy link

@uhliksk uhliksk commented Feb 21, 2020

All boost filesystem functions should be handled using error code to prevent random crashes caused by inaccesible files or directories. Increment in iterator should use separate error code variable because it have to be handled specifically to prevent infinite loop in diving to inaccessible directories.

To prevent coding errors in future the lint test is added to check if error code parameters are present.

Previous conversation about issue in #18095

Copy link
Contributor

@practicalswift practicalswift left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

What a great first-time contribution! Hope to see more contributions from you :)

@@ -133,7 +133,7 @@ CDBWrapper::CDBWrapper(const fs::path& path, size_t nCacheSize, bool fMemory, bo
leveldb::Status result = leveldb::DestroyDB(path.string(), options);
dbwrapper_private::HandleError(result);
}
TryCreateDirectories(path);
assert(TryCreateDirectories(path));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert(…):s should not have side-effects :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sorry, I was debugging and I forgot to handle this correctly. I'll add proper error handling here in additional commit.

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 21, 2020

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK.

LogPrintf("%s: Unable to remove PID file: File does not exist\n", __func__);
}
} catch (const fs::filesystem_error& e) {
LogPrintf("%s: Unable to remove PID file: %s\n", __func__, fsbridge::get_filesystem_error_message(e));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems fine as is (catching the error), no?

@DrahtBot
Copy link
Contributor

🐙 This pull request conflicts with the target branch and needs rebase.

@adamjonas
Copy link
Member

Hi @uhliksk - pinging for rebase and response to question above.

@uhliksk
Copy link
Author

uhliksk commented May 22, 2020

Hi @adamjonas , sorry for delay, I'll be back on June 1st.

@adamjonas
Copy link
Member

Hi @uhliksk, friendly monthly ping.

@uhliksk
Copy link
Author

uhliksk commented Jun 22, 2020

Hi @adamjonas, I'm alive but I had to postpone my work again. I'll be back soon.

@fanquake
Copy link
Member

Going to close this for now. Let us know if/when you have time to work on it again and it can be re-opened.

@fanquake fanquake closed this Jul 26, 2020
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants