Skip to content

Fix unwinding out of Main on OSX #4065

@kangaroo

Description

@kangaroo

See PR dotnet/coreclr#509 for some background.

The PR itself isn't correct, since unw_step will return 0 in two cases:

  1. When it unwinds all the way past main().
  2. When it unwinds to a managed frame, since it doesn't know what to do.

The PR as is, will break dotnet/coreclr#2, so we need to come up with a plan to differentiate dotnet/coreclr#1 and dotnet/coreclr#2, so that we can bail out and dump the unhanded exception for dotnet/coreclr#1.

It seems the Rip == 0 is llvm libunwind specific, OS X leave the $pc unchanged, so one possibility would be to track the previous pc and cur pc, and enter the guard if they matched.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions