Skip to content

Commit

Permalink
Added C error message for dlopen failures report.
Browse files Browse the repository at this point in the history
  • Loading branch information
janpfeifer committed Sep 23, 2024
1 parent a1f5a61 commit 83423bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Next

* Included C error message when reporting PJRT plugin failures.

# v0.4.0 - 2024-09-23

* Binary distributed compiled in Ubuntu 24.04 (glibc 2.38), updated dependencies on the C library. This may cause issues in older distributions.
Expand Down
3 changes: 2 additions & 1 deletion pjrt/dynamiclib_dlopen.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ func loadPlugin(pluginPath string) (handleWrapper dllHandleWrapper, err error) {
handle := C.dlopen(nameC, C.RTLD_LAZY)
cFree(nameC)
if handle == nil {
err = errors.Errorf("failed to dynamically load PJRT plugin from %q: check with `ldd %s`, maybe there are missing required libraries.", pluginPath, pluginPath)
msg := C.GoString(C.dlerror())
err = errors.Errorf("failed to dynamically load PJRT plugin from %q: %q -- check with `ldd %s` in case there are missing required libraries.", msg, pluginPath, pluginPath)
klog.Warningf("%v", err)
return
}
Expand Down

0 comments on commit 83423bd

Please sign in to comment.