Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

[x86/Linux] Get Frame Pointer from CallerSp#9235

Merged
janvorli merged 1 commit into
dotnet:masterfrom
parjong:fix/issue_8980_3rd
Feb 1, 2017
Merged

[x86/Linux] Get Frame Pointer from CallerSp#9235
janvorli merged 1 commit into
dotnet:masterfrom
parjong:fix/issue_8980_3rd

Conversation

@parjong
Copy link
Copy Markdown

@parjong parjong commented Feb 1, 2017

GetGSCookieAddress uses pEbp to get the current frame pointer, but pEbp
is not properly initialized as discussed in #8980.

This commit revises GetGSCookieAddress to use CallerSp (as in other
architectures) to get Frame Pointer in order to fix #8980.

GetGSCookieAddress uses pEbp to get the current frame pointer, but pEbp
is not properly initialized as discussed in #8980.

This commit revises GetGSCookieAddress to use CallerSp (as in other
architectures) to get Frame Pointer in order to fix #8980.
@parjong
Copy link
Copy Markdown
Author

parjong commented Feb 1, 2017

\CC @seanshpark @wateret

@parjong
Copy link
Copy Markdown
Author

parjong commented Feb 1, 2017

To resolve #8980, #9232 is required in addition to this PR.

@janvorli
Copy link
Copy Markdown
Member

janvorli commented Feb 1, 2017

It is still unclear to me how come the pEbp (or pCurrentContext->Ebp in the new world) is not initialized. Looking at the code and the callstack you have dumped in the other issue, it seems that the FillRegDisplay should set it and that it should be called on that code path.
Actually, now that I think about it again, I think that the problem was due to the issue with the context pointers ordering that you've fixed today - we were setting the Ebp context pointer to point to Eax in the context.
So I think it is likely that this change is not needed anymore.

@parjong
Copy link
Copy Markdown
Author

parjong commented Feb 1, 2017

@janvorli I tested whether #9121 resolves #8980, but unfortunately it turns out that #9121 is not enough.

As discussed in #8981, the context pointers that EECodeManager::GetGSCookieAddr takes points to the caller's frame (not the current frame), and thus #9121 will result in the following assertion failure:

Assert failure(PID 2276 [0x000008e4], Thread: 2276 [0x08e4]): !"About to FailFast. set ComPlus_AssertOnFailFast=0 if this is expected"
    File: /home/parjong/projects/dotnet/coreclr/src/vm/jithelpers.cpp Line: 5710
    Image: /home/parjong/projects/dotnet/dotnet-overlay/Linux.x86.Debug.Debug/corerun

@janvorli
Copy link
Copy Markdown
Member

janvorli commented Feb 1, 2017

Ah, I have remembered it wrong then. I have thought the problem was that the pEbp was garbage. The change makes sense then.

Copy link
Copy Markdown
Member

@janvorli janvorli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@janvorli janvorli merged commit 6be2bed into dotnet:master Feb 1, 2017
@parjong parjong deleted the fix/issue_8980_3rd branch February 1, 2017 01:47
@karelz karelz modified the milestone: 2.0.0 Aug 28, 2017
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
GetGSCookieAddress uses pEbp to get the current frame pointer, but pEbp
is not properly initialized as discussed in dotnet/coreclr#8980.

This commit revises GetGSCookieAddress to use CallerSp (as in other
architectures) to get Frame Pointer in order to fix dotnet/coreclr#8980.

Commit migrated from dotnet/coreclr@6be2bed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[x86/Linux] Catch exceptions thrown from unsafe code

4 participants