Skip to content

Tasks issues on Mac Catalyst #52460

Closed

Description

@directhex

Description

* thread #11, name = 'com.apple.NSEventThread', stop reason = EXC_BAD_ACCESS (code=1, address=0x2ee00)
    frame #0: 0x00007fff20243ed1 libsystem_malloc.dylib`tiny_malloc_from_free_list + 162
libsystem_malloc.dylib`tiny_malloc_from_free_list:
->  0x7fff20243ed1 <+162>: movq   %rax, (%r9)
    0x7fff20243ed4 <+165>: jmp    0x7fff20243f9d            ; <+366>
    0x7fff20243ed9 <+170>: movq   0x828(%r15), %rax
    0x7fff20243ee0 <+177>: shrq   %cl, %rax
Target 0: (System.Threading.Tasks.Tests) stopped.

Approx the same failure with System.Threading.Tasks.Dataflow.Tests

Configuration

./build.sh -ci -arch x64 -os MacCatalyst -s libs.tests -c Release /p:ArchiveTests=true /p:MonoForceInterpreter=true /p:CrossBuild=false

Regression?

No

Other information

Related PR: #51139

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on May 7, 2021
  2. steveisok commented on May 7, 2021

    @steveisok
    Member
  3. removed
    untriagedNew issue has not been triaged by the area owner
    on May 7, 2021
  4. added this to the 6.0.0 milestone on May 7, 2021
  5. modified the milestones: 6.0.0, 7.0.0 on Aug 16, 2021
  6. lambdageek commented on Aug 16, 2021

    @lambdageek
    Member

    Fails in various ways, but the upshot seems to be that a LowLevelLifoSemaphore (probably s_semaphore in PortableThreadPool.WorkerThread is not initialized when methods are called on it.

    Sometimes we get a null sem_ptr in

    gint32
    ves_icall_System_Threading_LowLevelLifoSemaphore_TimedWaitInternal (gpointer sem_ptr, gint32 timeout_ms)
    

    Sometimes instead the TimedWait throws a NRE, or sometimes there's an access violation.

    It seems like PortableThreadPool.WorkerThread.WorkerThreadStart sees a null s_semaphore sometimes. Not clear how that can happen - or why it only happens on catalyst.

  7. lambdageek commented on Sep 24, 2021

    @lambdageek
    Member

    This is failing because there are two tests disabled with [ActiveIssue("...", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))]

    [ActiveIssue("https://github.com/dotnet/runtime/issues/38817", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))]

    and

    [ActiveIssue("https://github.com/dotnet/runtime/issues/38817", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))]

    The problem is that GetIsRunningOnMonoInterpreter is wrong on mobile (including catalyst) - we don't set the MONO_ENV_OPTIONS variable to turn on the interpreter, we use the embedding API.

    private static bool GetIsRunningOnMonoInterpreter()
    {
    #if NETCOREAPP
    if (IsBrowser)
    return RuntimeFeature.IsDynamicCodeSupported;
    #endif
    // This is a temporary solution because mono does not support interpreter detection
    // within the runtime.
    var val = Environment.GetEnvironmentVariable("MONO_ENV_OPTIONS");
    return (val != null && val.Contains("--interpreter"));
    }

    So the fix is to do correct interpreter detection.

  8. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Sep 24, 2021
  9. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Sep 25, 2021
  10. ghost locked as resolved and limited conversation to collaborators on Nov 3, 2021
  11. danmoseley commented on Dec 16, 2021

    @danmoseley
    Contributor

    @lambdageek I happened to notice that this issue is closed but we are still excluding tests against it

    <!-- Crashes randomly during test runs https://github.com/dotnet/runtime/issues/52460 -->

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions