-
Notifications
You must be signed in to change notification settings - Fork 147
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
Patches sometimes do not apply #235
Comments
An initial hypothesis was that it was related to minSdkVersion, but I believe @felangel tried and decided it repro'd with the default v16 from Flutter too? |
Notes:
Logs
|
Log from my run just now:
|
I'm. not sure which version of the updater library the current Time Shift is using, but if it's current to head, then the fact that we don't see a message from "get_base_path" "File does not exist" would suggest the file does exist? Although I would expect to see a "file does not exist" from the first entry "libapp.so", suggesting this may not be fully up to date. |
Felix and I discussed and decided we need to get this current release out (with all the updates to the updater logging) before we can debug this. So this will have to be punted to early next week for fixing. :( |
We have a theory! We think this is just a string handling bug from C++. the .sor.so is likely that it's re-using the same buffer as was used for libflutter.so with libapp.so but libapp.so is a shorter string and when overlayed is libapp.sor.so We'll check our C++ string handling tomorrow, but I think we'll find the bug there. |
Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified.
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
I believe this is fixed. |
Reopening this since it appears we only addressed part of the issue. There still remains a scenario in which the libapp.so is not found. I'm investigating further now and will report back with more notes/observations. Notes
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() << "'.";
}
} |
I have a fix written: shorebirdtech/updater#5 I will figure out a workaround so I can test it. |
… it on disk (#5) Fixes shorebirdtech/shorebird#235 🤞 This moves us away from depending on libapp.so having been extracted from the APK and instead we always extract it ourselves.
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
* Fix unterminated string causing flaky behavior. Fixes shorebirdtech/shorebird#235 The root cause was we were not terminating the strings passed for original_libapp_paths. We used a Vector<char> but didn't append a '\0' to the end before calling data(), so when the c/rust side walked to find the end of the char* it sometimes found extra characters at the end of the string unexpectedly. This fixes to use a shorter (but probably equally dangerous?) method of using c_str() which we had tried before but previously had used c_str() on a temporary. This attempt carefully uses a reference to the string so the c_str()'s lifetime is tied to the string in application_library_paths rather than a temporary copy. This is still slightly dangerous in that c_str() lives as long as a std::string does, so long as it's not modified. * Fix comments
#8) * Bump updater dependency to include fix for shorebirdtech/shorebird#235
I don't think we have an issue tracking this yet, so creating one.
This report came in from a trusted tester. It appears that sometimes the libapp.so path given to the engine does not exist on disk. It's probably a synthetic path that Android apis know how to magically extract from the APK and once they've done that later launches have the libapp.so on disk.
This only seems to happen from playstore installs, not from local installs.
@felangel has reproduced it with TimeShift install from the play store.
The text was updated successfully, but these errors were encountered: