Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Finalizer thread throws unhandled native exception on OSX #1690

Closed

Description

@christianscheuer

I am getting the following native error in my console output when running my natively compiled application on OSX.

libc++abi.dylib: terminating with uncaught exception of type char const*
Abort trap: 6

cptsbackend is the name of my assembly.
I am on the current master branch of corert with a debug build.
When I remove finalizers in my assembly, there are no problems.

Here is the stacktrace when debugged with lldb:

    frame #0: 0x00007fff8f0ff286 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff883309f9 libsystem_pthread.dylib`pthread_kill + 90
    frame #2: 0x00007fff8ca469ab libsystem_c.dylib`abort + 129
    frame #3: 0x00007fff842a9a21 libc++abi.dylib`abort_message + 257
    frame #4: 0x00007fff842d19d1 libc++abi.dylib`default_terminate_handler() + 267
    frame #5: 0x00007fff8e87b7eb libobjc.A.dylib`_objc_terminate() + 124
    frame #6: 0x00007fff842cf0a1 libc++abi.dylib`std::__terminate(void (*)()) + 8
    frame #7: 0x00007fff842ceb30 libc++abi.dylib`__cxa_throw + 121
    frame #8: 0x0000000107aecdb9 cptsbackend`WaitForMultipleObjectsEx + 41
    frame #9: 0x0000000107aee4eb cptsbackend`RhpWaitForFinalizerRequest + 107
    frame #10: 0x0000000107b3aaa2 cptsbackend`ProcessFinalizers + 42
    frame #11: 0x0000000107af0286 cptsbackend`FinalizerStart(void*) + 70
    frame #12: 0x00007fff8832f05a libsystem_pthread.dylib`_pthread_body + 131
    frame #13: 0x00007fff8832efd7 libsystem_pthread.dylib`_pthread_start + 176
    frame #14: 0x00007fff8832c3ed libsystem_pthread.dylib`thread_start + 13

This seems to come from:

throw "WaitForMultipleObjectsEx";

    uint32_t WaitForMultipleObjectsEx(uint32_t, void*, uint32_t, uint32_t, uint32_t)
    {
        throw "WaitForMultipleObjectsEx";
    }

Activity

  1. changed the title [-]Finalizer thread throws unhandled native exception[/-] [+]Finalizer thread throws unhandled native exception on OSX[/+] on Aug 22, 2016
  2. christianscheuer commented on Aug 22, 2016

    @christianscheuer
    ContributorAuthor

    I created a workaround for this:
    #1693

  3. christianscheuer commented on Aug 22, 2016

    @christianscheuer
    ContributorAuthor

    Closing since a workaround has been merged and that the todo implementations in Platform.Unix.cpp is probably tracked better elsewhere.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions