Skip to content
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
6 changes: 5 additions & 1 deletion cpp/velox/udf/UdfLoader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ void* loadSymFromLibrary(
const std::string& libPath,
const std::string& func,
bool throwIfNotFound = true) {
// Clear any existing dlerror() state before calling dlsym.
dlerror();
Copy link
Member

Choose a reason for hiding this comment

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

Is this a redundant call?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will clear the dlerror before.

Copy link
Member

Choose a reason for hiding this comment

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

This will clear the dlerror before.

Got it, thanks.

void* sym = dlsym(handle, func.c_str());
if (!sym && throwIfNotFound) {
throw gluten::GlutenException(func + " not found in " + libPath);
const char* error = dlerror();
throw gluten::GlutenException(
fmt::format("Failed to load {} in {}: {}", func, libPath, error != nullptr ? error : "unknown error"));
}
return sym;
}
Expand Down