-
Notifications
You must be signed in to change notification settings - Fork 564
Allocate directory array with correct type #3888
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
Conversation
Context: dotnet#3759 Context: dotnet@6d85759#diff-e99739c16155208685952aa52870d4cdL33-L39 When switching from C-style `xcalloc` to C++-style `new` I failed to use the proper type to allocate array which holds directories where Android placed the APK files of the application. This mistake manifested itself only when using AppBundles, which is where we allocate more than one entry of the array. The resulting error was the following runtime exception: 11-04 12:27:55.722 3339 3339 E mono : Unhandled Exception: 11-04 12:27:55.722 3339 3339 E mono : System.DllNotFoundException: __Internal assembly:<unknown assembly> type:<unknown type> member:(null) 11-04 12:27:55.722 3339 3339 E mono : at (wrapper managed-to-native) Android.Runtime.JNIEnv.monodroid_timing_start(string) Which occurred because Xamarin.Android runtime failed to load `libmonodroid.so` from one of the directories that should have been stored in the array mentioned above - usually found in the *last* entry of the array. When iterating over the array, the XA runtime would end up with a null pointer after the end of the array instead of a pointer to the last entry. This commit uses the proper type when allocating the array.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
build |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Considering all the grief we went through with PR #3796, is it possible to create a test case which triggers the scenario? Do we know why this only "randomly" failed instead of consistently failed? |
I was thinking about it and I can't figure out why it failed intermittently. The AppBundle is, however, THE test case that triggered it so I think we are at least partially covered |
Context: 6d85759 Context: #3796 Context: 6d85759#diff-e99739c16155208685952aa52870d4cdL33-L39 When switching from C-style `xcalloc()` to C++-style `new` I failed to use the proper type to allocate the array which holds directories where Android placed the `.apk` files of the application. This mistake manifested itself only when using AppBundles, which is where we allocate more than one entry of the array. The resulting error was the following runtime exception: Unhandled Exception: System.DllNotFoundException: __Internal assembly:<unknown assembly> type:<unknown type> member:(null) at (wrapper managed-to-native) Android.Runtime.JNIEnv.monodroid_timing_start(string) which occurred because the Xamarin.Android runtime failed to load `libmonodroid.so` from one of the directories that should have been stored in the array mentioned above - usually found in the *last* entry of the array. When iterating over the array, the XA runtime would end up with a null pointer after the end of the array instead of a pointer to the last entry. This commit uses the proper type when allocating the array.
Context: #3759
Context: 6d85759#diff-e99739c16155208685952aa52870d4cdL33-L39
When switching from C-style
xcallocto C++-stylenewI failed to use theproper type to allocate array which holds directories where Android placed the
APK files of the application. This mistake manifested itself only when using
AppBundles, which is where we allocate more than one entry of the array. The
resulting error was the following runtime exception:
Which occurred because Xamarin.Android runtime failed to load
libmonodroid.sofrom one of the directories that should have been stored in the array mentioned
above - usually found in the last entry of the array. When iterating over the
array, the XA runtime would end up with a null pointer after the end of the
array instead of a pointer to the last entry.
This commit uses the proper type when allocating the array.