Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 9324 [details]
Stack Traces and Sample Code
Since updating to the Unified API, intermittent NRE errors are happening. The same code is shared with iOS and is not having this issue. Please see the attached doc for examples and stack traces.
**Steps to Reproduce:**
A sample is not possible at this time as it is intermittent.
Varying stack traces, but they all seem to be NullReferenceExceptions.
**Build Date & Platform:**
The problem is intermittent and hard to reproduce. The same shared code on iOS does not seem to reproduce the intermittent issues. These issues only surfaced after updating to the Unified API. The Classic API did not produce these exceptions in this code.
So, the first error could be related to the issue posted here:
"excluding System.Core and System.Runtime.Serialization from linking fixes the issue".
Have you enabled linking in the project settings? If so, try adding --linkskip=System.Core --linkskip= System.Runtime.Serialization or disable linking to see if that "fixes" the issue.
Is your iOS application also Unified? If so, you need to have both of these check boxes enabled:
"Use the SGen generational garbage collector"
"Use the reference counting extension"
to have the same behavior as iOS. Try checking both, and see if the other issue(s) go away.
Cheers Chris, here's my results:
- Adding those linkskip options does indeed make Json.Net work fine.
- My iOS version did have reference counting disabled, so I also disabled it on Mac and these random crashes seem to have disappeared.
Now that the app runs, there seems to be a few problems in other areas, but I'll raise those on the forum since they seem to be API differences and not related to this bug.
Good to know. We have some long term work needed to make the linkskip lines unnecessary.
You might want to track down the reference counting issue and file a specific bug, as removing that option in a future version for Mac on Unified.
Closing since this should be fixed on master (b5f51d542379ef51e64b0267952d945838571097) that the linker xml file has been ported from iOS but we don't have a repro for it to validate.