Skip to content

Commit

Permalink
Log dlopen errors in opt builds (flutter#41477)
Browse files Browse the repository at this point in the history
As the Engine uses `dlopen` to find the `libapp.so`, flutter/flutter#59834 can happen which will prevent `dlopen` from finding the binary. In theory this should be mitigated by flutter#9762, but an internal customer observed errors that could be related. 

The additional logging here can help to rule out that hypothesis. For Googlers, see b/276657840 for more details.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
  • Loading branch information
jiahaog authored Apr 26, 2023
1 parent 87f5f4e commit 321f801
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fml/platform/posix/native_library_posix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ NativeLibrary::NativeLibrary(const char* path) {
::dlerror();
handle_ = ::dlopen(path, RTLD_NOW);
if (handle_ == nullptr) {
FML_DLOG(ERROR) << "Could not open library '" << path << "' due to error '"
<< ::dlerror() << "'.";
// TODO(jiahaog): Use FML_DLOG:
// https://github.com/flutter/flutter/issues/125523
FML_LOG(ERROR) << "Could not open library '" << path << "' due to error '"
<< ::dlerror() << "'.";
}
}

Expand Down

0 comments on commit 321f801

Please sign in to comment.