Skip to content

[x86 Windows] GC stackwalking crash with R2R PInvoke frames #31809

Closed

Activity

  1. added
    untriaged
    on Feb 5, 2020
  2. jkotas commented on Feb 5, 2020

    @jkotas
    Member

    We crash during GC while stackwalking GetFullPathNameW:

    08 00dfc9e0 712d180b coreclr!WKS::GCHeap::WaitUntilGCComplete+0x24 [F:\workspace\_work\1\s\src\coreclr\src\gc\gcee.cpp @ 292] 
    09 00dfca24 7134bcfe coreclr!Thread::RareDisablePreemptiveGC+0xc9 [F:\workspace\_work\1\s\src\coreclr\src\vm\threadsuspend.cpp @ 2530] 
    0a 00dfcaa0 70d68b6b coreclr!JIT_PInvokeEndRarePath+0x2e [F:\workspace\_work\1\s\src\coreclr\src\vm\jithelpers.cpp @ 4923] 
    0b 00dfcaf0 099055f7 Interop+Kernel32.GetFullPathNameW(Char ByRef, UInt32, Char ByRef, IntPtr)+0x57
    0c 00dfcb08 09907cc2 System_Private_CoreLib!System.IO.PathHelper.GetFullPathName(System.ReadOnlySpan`1<Char>, System.Text.ValueStringBuilder ByRef)+0x989fbb47 [/_/src/libraries/System.Private.CoreLib/src/System/IO/PathHelper.Windows.cs @ 91] 
    
  3. jkotas commented on Feb 5, 2020

    @jkotas
    Member

    #31659 hit it as well. That one crashes under:

    08 0a66e4c0 73a5bcfe coreclr!Thread::RareDisablePreemptiveGC+0xc9 [F:\workspace\_work\1\s\src\coreclr\src\vm\threadsuspend.cpp @ 2530] 
    09 0a66e53c 7347a038 coreclr!JIT_PInvokeEndRarePath+0x2e [F:\workspace\_work\1\s\src\coreclr\src\vm\jithelpers.cpp @ 4923] 
    0a 0a66e584 0af36ddd Interop+Ole32.CoCreateGuid(System.Guid ByRef)+0x38
    0b 0a66e5a4 0a698408 System_Private_CoreLib!System.Guid.NewGuid()+0x97a54e5d [/_/src/libraries/System.Private.CoreLib/src/System/Guid.Windows.cs @ 23] 
    0c 0a66e658 0a6983ad CoreFx_Private_TestUtilities!System.IO.FileCleanupTestBase..ctor()+0x40
    0d 0a66e664 0b2f0c8d System_IO_FileSystem_Tests!System.IO.Tests.FileSystemTest..ctor()+0x1d
    
  4. added
    blocking-clean-ci
    area-CodeGen-coreclr
    tenet-reliability
    and removed on Feb 5, 2020
  5. changed the title [-]System.Xml.Xsl.XslTransformApi.Tests crashing[/-] [+][x86 Windows] GC stackwalking crash with R2R PInvoke frames[/+] on Feb 5, 2020
  6. jkotas commented on Feb 5, 2020

    @jkotas
    Member

    @fadimounir This is most likely caused by #26834. I am going to revert it. Sorry...

  7. jkotas commented on Feb 5, 2020

    @jkotas
    Member

    Revert in #31811

  8. fadimounir commented on Feb 5, 2020

    @fadimounir
    Contributor

    @jkotas Ok thanks. I'll take a look at it. Quite interesting... I've been running a couple of instances of gcstress tests with the fix for a couple of days, and none of them crashed

  9. jkotas commented on Feb 5, 2020

    @jkotas
    Member

    This may be the type of issue that gc stress is not good at catching. Let me know if you need to help with a repro. I think running Guid.NewGuid and some allocations, on multiple threads, with release build, and tiered compilation disabled should reproduce it reliably.

  10. added this to the 5.0 milestone on Feb 6, 2020
  11. added and removed
    untriaged
    area-CodeGen-coreclr
    on Feb 6, 2020
  12. removed
    blocking-clean-ci
    on Mar 1, 2020
  13. fadimounir commented on Mar 5, 2020

    @fadimounir
    Contributor

    Let me know if you need to help with a repro

    @jkotas I tried to repro this with a multi-threaded test that calls Guid.NewGuid() and does a bunch of allocations, and GC.Collect calls in parallel, but couldn't get it to fail (tested with the pinvoke changes that you reverted). Tried both release and checked builds, with tiered compilation disabled as you suggested to keep using the R2R code.
    I'll leave the test running for a while longer, maybe it would get luck and fail...

    I think at this point, it would be more useful to investigated a dump file but looks like the one mentioned in this issue is no longer available.

    Any suggestions? Create a PR with the changes and keep running CI until it fails?

  14. jkotas commented on Mar 5, 2020

    @jkotas
    Member

    I am not able to reproduce it either. Yes, create PR and try to rerun x86 legs on it a few times. If you are not able to hit it after a day of trying, commit it and hopefully we are going to get a dump eventually.

  15. jkotas commented on Apr 17, 2020

    @jkotas
    Member

    Duplicate of #34279

  16. ghost locked as resolved and limited conversation to collaborators on Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-x86os-windowstenet-reliability

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions