Skip to content

[NativeAOT] reintroduce the use of personality routines in PInvoke stubs #73429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
VSadov opened this issue Aug 5, 2022 · 4 comments
Open
Assignees
Milestone

Comments

@VSadov
Copy link
Member

VSadov commented Aug 5, 2022

RhpPInvokeExceptionGuard is supposed to be used by PInvokes. Somehow that was lost and should be reintroduced.

Also consider use in suspension hijack probes and other assembly helpers.
Perhaps either all should use a personality routine or none.

Re: #73216 (comment)

@ghost ghost added area-NativeAOT-coreclr untriaged New issue has not been triaged by the area owner labels Aug 5, 2022
@jkotas jkotas added this to the 8.0.0 milestone Aug 5, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Aug 5, 2022
@janvorli
Copy link
Member

janvorli commented Aug 8, 2022

Personality routine should be used only in helpers where there is a possibility that an exception could get propagated through the helper. So I don't think that all asm helpers should have it.

@VSadov
Copy link
Member Author

VSadov commented Aug 8, 2022

@janvorli In a case of Hijack helpers, which do not call any user code, do we need personality routines?
If they do not have any, will it result in failfast in a case of a bug? (like null deref due to a race or smth like that).

@VSadov
Copy link
Member Author

VSadov commented Aug 8, 2022

Aslo, there is one caveat - we check and may throw ThreadAbort when resuming from suspension. That can happen in a hijack helper.
Will that make it required to have a personality routine?

@janvorli
Copy link
Member

janvorli commented Aug 8, 2022

When there is no personality routine, the exception handling doesn't "see" the helper, so the exception flows from the callee to the caller of the helper. If we want to cause fail-fast or do some special handling if an exception crosses the frame of the helper, then we need a personality routine to achieve that.

@agocke agocke added this to AppModel Apr 3, 2023
@agocke agocke modified the milestones: 8.0.0, 9.0.0 Aug 16, 2023
@agocke agocke modified the milestones: 9.0.0, 10.0.0 Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

4 participants