Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[umf] extend error message for disjoint pool #841

Merged
merged 1 commit into from
Sep 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions source/common/umf_pools/disjoint_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,15 @@ Slab::~Slab() {
} catch (MemoryProviderError &e) {
std::cout << "DisjointPool: error from memory provider: " << e.code
<< "\n";
if (e.code == UMF_RESULT_ERROR_MEMORY_PROVIDER_SPECIFIC) {
const char *message = "";
int error = 0;

umfMemoryProviderGetLastNativeError(
umfGetLastFailedMemoryProvider(), &message, &error);
std::cout << "Native error msg: " << message
Copy link
Contributor

Choose a reason for hiding this comment

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

On second thought, coverity will complain that this can throw.
Can we use our logging framework?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, right. Yeah, ideally we would use some logger here but I don't want to hardcode our UR logger since we plan to move DisjointPool to another repo anyway. There are other places in this file that use cout so perhaps we can just ignore the issues on coverity for now?

<< ", native error code: " << error << std::endl;
}
}
}

Expand Down