1. 25 9月, 2020 1 次提交
    • L
      Wait on runtime threads to park on joinable thread list during shutdown. · 9a8ff4e3
      lateralusX 提交于
      https://github.com/mono/mono/pull/5599 fixed a race condition during shutdown
      when runtime threads have come parts of their way through detach, but still
      depend on runtime resources, like GC memory. The fix added runtime threads
      to the joinable thread list just before they vanished from mono_thread_manage
      radar making sure shutdown waited upon the thread before cleaning up.
      
      The above fix slightly changed the behavior of the finalizer thread since it
      waits on joinable threads and will now potential block on threads still
      executing code (that involves runtime resources). There’s was an assumption
      around the threads on the joinable thread list that they should be very close
      to complete when added, so join calls coming from the finalizer thread should
      almost never block and if it does, the code that remains to execute should not
      involve runtime operations risking deadlock situations. Adding the thread to
      the list earlier than previously done expose the shutdown to some potential
      theoretical problems.
      
      To mitigate the risk and still solve the race condition this commit adds a
      mechanism to keep track of active runtime threads until they park on joinable
      thread list. The pending counter will be waited upon by the shutdown
      thread, just before it does its regular wait on all joinable threads
      (after finalizer thread has stopped) to make sure all runtime threads have
      been added to the joinable thread list before waiting upon them. Threads are
      added to the joinable thread as late as possible, exactly how it’s been done
      in the past by sgen_client_thread_detach_with_lock. Shutdown thread will wait
      on runtime threads to appear on the list for a short time and if timeout (pending
      runtime thread count not reaching 0 before timeout), it will just print a warning
      and continue shutdown.
      
      Getting into a wait state during shutdown due to runtime threads not yet added to
      joinable threads list should be very rare (hitting previous race condition that was rare),
      triggering the timeout should be even more rare, and if that ever happens, we are exposed
      to shutdown race condition as we have had in the past, but now we at least get a warning in
      the log making it simpler to analyze further.
      
      This commit also fixes a problem with the debugger thread hitting the same race condition as above.
      The shutdown thread stopping the debugger thread didn't completely wait for it to stop using runtime
      resources before continue shutdown sequence. This triggers the same race condition as when shutting
      down regular runtime threads. This commit makes sure stop_debugger_thread waits on the debugger thread
      handle to become signaled (happens at the very end of thread lifetime) before continuing the shutdown
      logic.
      9a8ff4e3
  2. 24 9月, 2020 1 次提交
  3. 22 9月, 2020 1 次提交
  4. 18 9月, 2020 1 次提交
  5. 17 9月, 2020 1 次提交
  6. 14 9月, 2020 1 次提交
  7. 29 8月, 2020 1 次提交
  8. 27 8月, 2020 2 次提交
  9. 21 8月, 2020 3 次提交
  10. 14 8月, 2020 1 次提交
  11. 11 8月, 2020 1 次提交
    • U
      Exposing functions: mono_custom_attrs_construct_by_type and mono_unity_error_convert_to_exception · 984812bc
      UnityAlex 提交于
      * mono_custom_attrs_construct_by_type allows unity to have a chance at handling the error if one arises instead of fatally asserting
      * mono_unity_error_convert_to_exception allows unity to take the provided MonoError and fetch the MonoException object within to log into the editor as the exception that was thrown.
      
      This change has associated unity changes in order to fix (case 1255935)
      984812bc
  12. 06 8月, 2020 1 次提交
  13. 16 7月, 2020 1 次提交
  14. 15 7月, 2020 1 次提交
    • A
      X509ChainImplUnityTls reports status now · c12ef373
      andreasr 提交于
      Fixes Fogbugz ticket 1261388.
      Impl sticks close to current Mono Btls implementation on _master_ - the implementation on our fork has the same issues as prior to this fix and throws NotImplementedException
      c12ef373
  15. 13 7月, 2020 1 次提交
  16. 08 7月, 2020 1 次提交
  17. 02 7月, 2020 1 次提交
  18. 16 6月, 2020 1 次提交
    • T
      [debugger] Fixing two crashes while debugging an Android app. (#13373) · 54f8e9ab
      Thays Grazia 提交于
      * [debugger] Fixing two crashes while debugging an Android app.
      
      -> Doing stepping into in VSM in some situation the frame saved in TLS is not synchronised with what is really been executed in the main thread. This makes the debugger-agent crashes because it tries to get variable info in some memory that is not available anymore.
      	-> To fix it I forced the update of stack when CMD_THREAD_GET_FRAME_INFO is called.
      
      -> Doing step over in Visual Studio for Windows, if you have the threads debugger window enabled, VSW calls frame_commands for each thread that is showed, and if the thread is not really_suspended it tries to get variable info from a memory that is not available anymore because the thread is not suspended yet.
      	-> To fix it I don't send variable info of a frame if the thread is not really_suspended and doesn't have an async_state valid.
      
      Cherry-picked with some light massaging by Alex Thibodeau (case 1249172)
      54f8e9ab
  19. 15 6月, 2020 4 次提交
  20. 07 6月, 2020 1 次提交
  21. 03 6月, 2020 2 次提交
    • J
      Alternate function to set valuetypes for ref-ness · 8df4a082
      Joe Valenzuela 提交于
      Same method that ldloc.s uses, which incorporates the byref test.
      8df4a082
    • J
      Fix for ldloc/ldfld of ref to valuetype · ae43e908
      Joe Valenzuela 提交于
      When we have the following sequence:
      
          ldloc n
          ldfld valuetype [Unity.Mathematics]Unity.Mathematics.int2 Foo::bar
      
      and local n is a reference to value, when walking the instructions in
      mono_method_to_ir, we generally try to avoid loading a whole value
      type just to load one of the fields.  I believe this is an
      optimization.
      
      The test here is not quite complete, though, as we have ref valuetypes
      where the object stored at the location is actually an address, in
      which case we still need to treat it as we would a normal reference.
      
      This optimization isn't present in the ldloc.n coded forms and is
      written in a slightly more robust way in ldloc.s, so no changes are
      necessary there.
      
      As an alternative to this commit, we might adopt the ldloc.s test for
      ldloc as well, or merge in
      https://github.com/mono/mono/commit/29428d951637ff85b593ea5c9cc5d5236579906d/mono/mini/method-to-ir.c
      from master which encapsulates much the same intent.
      ae43e908
  22. 01 6月, 2020 1 次提交
  23. 19 5月, 2020 1 次提交
  24. 14 5月, 2020 1 次提交
  25. 07 5月, 2020 1 次提交
  26. 29 4月, 2020 4 次提交
  27. 13 4月, 2020 1 次提交
    • T
      [debugger] Fix NOT_IMPLEMENTED while debugging. (#19248) · 3e40bf79
      Thays Grazia 提交于
      - Changed the behavior on debugger-agent, if we can't parse the new behavior is to return invalid_argument and not assert and stop debugging
      - Changed the mono_domain_set_fast before return from assembly_commands.
      - Add error message when return INVALID_ARGUMENT
      
      Fixes #19146
      3e40bf79
  28. 07 4月, 2020 3 次提交