Skip to content

Conversation

@grendello
Copy link
Contributor

@grendello grendello commented Oct 15, 2019

The crash is:

10-15 14:25:04.854  3342  3342 E mono    :
10-15 14:25:04.854  3342  3342 E mono    : Unhandled Exception:
10-15 14:25:04.854  3342  3342 E mono    : System.DllNotFoundException: __Internal assembly:<unknown assembly> type:<unknown type> member:(null)
10-15 14:25:04.854  3342  3342 E mono    :   at (wrapper managed-to-native) Android.Runtime.JNIEnv.monodroid_timing_start(string)
10-15 14:25:04.854  3342  3342 E mono    :   at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs* args) [0x0001c] in <1260048817b5414c97481e16c94f6621>:0

It's one of those cases that are "impossible", try to find out how possible is
the impossible

@grendello grendello added do-not-merge PR should not be merged. full-mono-integration-build For PRs; run a full build (~6-10h for mono bumps), not the faster PR subset (~2h for mono bumps) labels Oct 15, 2019
@grendello grendello requested a review from jonpryor as a code owner October 15, 2019 20:10
@grendello grendello changed the title Try to find out reason for a weird runtime crash Try to find the reason for a weird runtime crash Oct 15, 2019
@grendello
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jonpryor
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@grendello grendello force-pushed the dlopen-logging branch 2 times, most recently from f80c9bb to 32ad3f4 Compare November 5, 2019 08:18
@grendello
Copy link
Contributor Author

/azp run

3 similar comments
@grendello
Copy link
Contributor Author

/azp run

@grendello
Copy link
Contributor Author

/azp run

@grendello
Copy link
Contributor Author

/azp run

@grendello
Copy link
Contributor Author

/azp run

1 similar comment
@grendello
Copy link
Contributor Author

/azp run

The crash is:

  10-15 14:25:04.854  3342  3342 E mono    :
  10-15 14:25:04.854  3342  3342 E mono    : Unhandled Exception:
  10-15 14:25:04.854  3342  3342 E mono    : System.DllNotFoundException: __Internal assembly:<unknown assembly> type:<unknown type> member:(null)
  10-15 14:25:04.854  3342  3342 E mono    :   at (wrapper managed-to-native) Android.Runtime.JNIEnv.monodroid_timing_start(string)
  10-15 14:25:04.854  3342  3342 E mono    :   at Android.Runtime.JNIEnv.Initialize (Android.Runtime.JnienvInitializeArgs* args) [0x0001c] in <1260048817b5414c97481e16c94f6621>:0

It's one of those cases that are "impossible", try to find out how possible is
the impossible
@grendello
Copy link
Contributor Author

/azp run

See if embedded DSO mode is enabled - it should be, but sometimes it appears as
if it isn't set and thus we get invalid paths where to look for our DSOs
@grendello grendello closed this Nov 7, 2019
@grendello grendello deleted the dlopen-logging branch November 7, 2019 19:58
jonpryor pushed a commit that referenced this pull request Nov 12, 2019
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.
jonpryor pushed a commit that referenced this pull request Nov 12, 2019
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.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

do-not-merge PR should not be merged. full-mono-integration-build For PRs; run a full build (~6-10h for mono bumps), not the faster PR subset (~2h for mono bumps)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants