Skip to content
Snippets Groups Projects
  1. Apr 20, 2022
  2. Apr 19, 2022
  3. Apr 05, 2022
  4. Mar 22, 2022
  5. Feb 17, 2022
  6. Feb 14, 2022
    • github-actions[bot]'s avatar
      [Tools] Fix mono-api-html MarkdownFormatter.cs to avoid a NRE (#21431) · 4efc825e
      github-actions[bot] authored
      One of the changes in macios revealed a bug in which @new can be null
      resulting in a NRE like the one that follows:
      
      System.NullReferenceException: Object reference not set to an instance of an object
      2022-01-26T09:23:11.9538790Z   at Mono.ApiTools.MarkdownFormatter.DiffModification (System.Text.StringBuilder output, System.String old, System.String new, System.Boolean breaking) [0x00013] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/MarkdownFormatter.cs:181
      2022-01-26T09:23:11.9543530Z   at Mono.ApiTools.ApiChange.AppendModified (System.String old, System.String new, System.Boolean breaking) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/ApiChange.cs:49
      2022-01-26T09:23:11.9547700Z   at Mono.ApiTools.FieldComparer.Equals (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target, Mono.ApiTools.ApiChanges changes) [0x0008c] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/FieldComparer.cs:123
      2022-01-26T09:23:11.9551430Z   at Mono.ApiTools.MemberComparer.Compare (System.Collections.Generic.IEnumerable`1[T] source, System.Collections.Generic.IEnumerable`1[T] target) [0x00053] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/MemberComparer.cs:111
      2022-01-26T09:23:11.9554840Z   at Mono.ApiTools.MemberComparer.Compare (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x00064] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/MemberComparer.cs:66
      2022-01-26T09:23:11.9558230Z   at Mono.ApiTools.ClassComparer.Modified (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target, Mono.ApiTools.ApiChanges diff) [0x00172] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/ClassComparer.cs:238
      2022-01-26T09:23:11.9562840Z   at Mono.ApiTools.Comparer.Compare (System.Collections.Generic.IEnumerable`1[T] source, System.Collections.Generic.IEnumerable`1[T] target) [0x00084] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/Comparer.cs:94
      2022-01-26T09:23:11.9566810Z   at Mono.ApiTools.ClassComparer.Compare (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x0002c] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/ClassComparer.cs:68
      2022-01-26T09:23:11.9570610Z   at Mono.ApiTools.NamespaceComparer.Modified (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target, Mono.ApiTools.ApiChanges differences) [0x00017] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/NamespaceComparer.cs:79
      2022-01-26T09:23:11.9574480Z   at Mono.ApiTools.Comparer.Compare (System.Collections.Generic.IEnumerable`1[T] source, System.Collections.Generic.IEnumerable`1[T] target) [0x00084] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/Comparer.cs:94
      2022-01-26T09:23:11.9578000Z   at Mono.ApiTools.NamespaceComparer.Compare (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target) [0x0002c] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/NamespaceComparer.cs:51
      2022-01-26T09:23:11.9581650Z   at Mono.ApiTools.AssemblyComparer.Modified (System.Xml.Linq.XElement source, System.Xml.Linq.XElement target, Mono.ApiTools.ApiChanges diff) [0x00055] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/AssemblyComparer.cs:89
      2022-01-26T09:23:11.9586220Z   at Mono.ApiTools.Comparer.Compare (System.Collections.Generic.IEnumerable`1[T] source, System.Collections.Generic.IEnumerable`1[T] target) [0x00084] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/Comparer.cs:94
      2022-01-26T09:23:11.9589520Z   at Mono.ApiTools.AssemblyComparer.Compare () [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/AssemblyComparer.cs:63
      2022-01-26T09:23:11.9592880Z   at Mono.ApiTools.ApiDiffFormatted.Generate (Mono.ApiTools.AssemblyComparer ac, System.IO.TextWriter outStream, Mono.ApiTools.State state) [0x00013] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/ApiDiff.cs:222
      2022-01-26T09:23:11.9596490Z   at Mono.ApiTools.ApiDiffFormatted.Generate (System.String firstInfo, System.String secondInfo, System.IO.TextWriter outStream, Mono.ApiTools.State state) [0x00008] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/ApiDiff.cs:208
      2022-01-26T09:23:11.9600250Z   at Mono.ApiTools.ApiDiffFormatted.Generate (System.String firstInfo, System.String secondInfo, System.IO.TextWriter outStream, Mono.ApiTools.ApiDiffFormattedConfig config) [0x00007] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/ApiDiff.cs:202
      2022-01-26T09:23:11.9603590Z   at Mono.ApiTools.Program.Main (System.String[] args) [0x002f9] in /Users/builder/jenkins/workspace/archive-mono/2020-02/ios/release/mcs/tools/mono-api-html/ApiDiff.cs:159
      
      The change that exposed the bug is: https://github.com/xamarin/xamarin-macios/commit/d78aa6712b15659b0fed259952364c060ffedcea
      
      
      
      The above exception is avoided by ensuring that nor old or @new are
      null.
      
      Co-authored-by: default avatarManuel de la Pena <mandel@microsoft.com>
  7. Feb 07, 2022
  8. Feb 02, 2022
  9. Jan 24, 2022
  10. Jan 13, 2022
    • Vlad Brezae's avatar
      [interp] Remove hack for nint/nfloat (#21395) · 45efaa3b
      Vlad Brezae authored
      These structures are valuetypes, but their mint_type is a primitive. This means that a LDFLD applied on the type would have attempted to do a pointer dereference, because it saw that the current top of stack is not STACK_TYPE_VT. This was fixed in the past by passing the managed pointer to the valuetype rather than the valuetype itself, against the normal call convention, which lead to inconsistencies in the code.
      
      This commit removes that hack and fixes the problem by ignoring LDFLD applied to nint/nfloat valuetypes in the first place.
  11. Jan 04, 2022
  12. Dec 13, 2021
    • github-actions[bot]'s avatar
      [2020-02] [cominterop] Add coop handle enter/return on native CCW methods (#21366) · b8d75251
      github-actions[bot] authored
      
      * [tests] Add CCW GetIUnknownForObject leak test
      
      * [cominterop] Add coop handle enter/return on native CCW methods
      
      The CCW methods for IUnknown (and in principle IDispatch - except they all have
      trivial bodies) are native C code in the runtime that may allocate coop
      handles.  Add a coop handle frame around the entire call in order to make sure
      they're cleaned up and don't retain a reference.
      
      This helps fix managed object leaks with code like:
      
      ```
         var o  = new SomeClass();
         var pUnk = Marshal.GetIUnknownForObject(o);
         int c = Marshal.Release(pUnk);
         o = null;
      ```
      
      Which retains a reference to the `SomeClass` instance that won't be collected
      until the thread dies, despite cleaning up the IUnknown refcount. The underling
      ccw addref/release methods leak coop handles on the thread.
      
      This is not an issue when the CCW calls some managed method because there are
      no coop handles there until some icall (at which point it will set up the
      coop handle stack properly).
      
      Co-authored-by: default avatarAleksey Kliger <alklig@microsoft.com>
  13. Nov 30, 2021
  14. Nov 19, 2021
  15. Nov 10, 2021
  16. Nov 03, 2021
  17. Oct 07, 2021
  18. Sep 30, 2021
  19. Sep 28, 2021
  20. Sep 27, 2021
    • Matt Ward's avatar
      [MacSDK] Add F# targets to VisualStudio/v17.0 directory (#21218) · 66e81934
      Matt Ward authored
      .NET 6 RC 2 adds an MSBuild check to see that the VisualStudioVersion
      property is below 17.0 and reports a not supported warning if this is
      the case. Updating the VisualStudioVersion to 17.0 used in Visual
      Studio for Mac 17.0 to fix this warning breaks F# SDK projects and
      classic F# projects since Mono's MSBuild tries to load F# targets
      files from a directory which does not exist:
      
         xbuild/Microsoft/VisualStudio/v17.0/FSharp
      
      Adding a v17.0 directory to Mono allows Visual Studio for Mac 17.0
      to define VisualStudioVersion to be 17.0 and restore and build F#
      projects.
      66e81934
  21. Sep 03, 2021
  22. Aug 30, 2021
  23. Aug 19, 2021
  24. Aug 13, 2021
  25. Jun 25, 2021
  26. Jun 24, 2021
    • Aleksey Kliger (λgeek)'s avatar
      [2020-02] Start a dedicated thread for MERP crash reporting (#21126) · 63035635
      Aleksey Kliger (λgeek) authored
      Related to #21009.
      
      There are two scenarios:
      1.  When someone force quits Mono (or just runs `kill -TERM <pid>`), the process can receive the signal on any thread,
      2. or - if a thread in the process crashes, but the thread is not attached to the runtime, Mono's signal handlers still run.
      
      The crash reporter assumes that the crashing thread is either attached to the runtime, or at least `mono_thread_info_current` or the JIT TLS data are set for the thread.  If the thread is truly foreign and it never interacted with Mono, and it crashes, both of those assumptions are false, but Mono's crash reporter signal handlers still run.
      
      The solution from this PR is: if crash reporting is enabled, start a dedicated thread at process startup that is a "crash report leader" - when a crash happens, the crashing thread (the crash originator) wakes the leader, and the leader collects the crash report.  The crash originator does not do any work that requires being attached to the runtime or to the JIT such as iterating over thread IDs or stack walking.
      
      
      ---
      
      * Add a standalone test of crash on a foreign thread
      
      * Sketch out crash leader implementation
      
         At process startup, start a separate thread that is attached to the runtime and can collect crash reports.  Crashing threads will wake it and wait for it to collect the crash reports
      
      * Start moving responsibilities to the crash leader
      
      * Watch for nil jit_tls data if crash is on a foreign thread
      
      * Start adding a state machine for the crash leader
      
         We need to coordinate the originator and the leader in a few places.
      
         The leader needs to pause to after collecting the thread ids before suspending the non-originator threads, and again while the originator is dumping its own stack.
      
         The originator needs to wait for the leader to collect the thread IDs and to tell it its assigned slot. Then it tells the leader to suspend the others, dumps its own memory, then tell the leader to dump the whole crash report and wait for it to reply when it's done.
      
      * Move remaining summarizer work to the summarizer leader thread
      
      * change some debug printfs
      
      * Successfully summarize a foreign thread crash
      
      * Add test to merp-crash-test.cs
      
      * delete standalone test
      
      * if the crash leader is the originator, collect the report synchronously
      
         either because the crash leader crashed, or because the process got a SIGTERM and it arrived on the crash leader thread
      
      * fixup comments
      
      * turn off crash leader printf debugging
      
      * Don't create leader thread if crash reporting is disabled
      
      * Fix test on win32
      
      * Update mono/tests/libtest.c
      
      * fixup logging and comments around managed stack collection
      
      * Disable the merp dlopen crasher
      
      * Remove crash leader state machine
      
         It's straightline code with two early exits. State machine is overkill
      
      * remove remnants of leader state machine
  27. May 27, 2021
  28. May 10, 2021
  29. Apr 30, 2021
  30. Apr 29, 2021
  31. Apr 19, 2021
  32. Apr 13, 2021
Loading