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
add -gx to add stack smash code #1542
Conversation
Maybe a different name? The term "stack smashing" is usually used in the context of the stack smashing protector that GCC and LLVM support: http://llvm.org/docs/LangRef.html#llvm-stackprotector-intrinsic (see also the ssp, sspreq, and sspstrong attributes in that document) |
I don't see the word "smash" in the linked page. |
|
Why do you have this disabled for win64? |
Sorry, I'm tried. What I meant to ask was - is this really equivalent to all of the other epilogs? And if so, could they be merged together instead of having a universal stack smash version and several target dependent versions? |
The other ones are optimal for different purposes, as the if statements set out. The win64 is different because the win64 api says it should be that way, see the supplied url. |
I know I've used So maybe »overwrite stack with garbage when returning from a function« or something along the lines would be a better description for a flag? A reference to »stack smashing code« would probably need further explanation in the (non-existent?) docs, unless you are building an exploit kit. ;) |
On Thu, Jan 24, 2013 at 05:53:28AM -0800, David Nadlinger wrote:
A similar technique is (optionally) used in the GC to debug memory https://github.com/D-Programming-Language/druntime/blob/master/src/gc/gcx.d#L23 |
stomping sounds good |
add -gx to add stack smash code
@@ -47,7 +47,8 @@ void out_config_init( | |||
int symdebug, // add symbolic debug information | |||
// 1: D | |||
// 2: fake it with C symbolic debug info | |||
bool alwaysframe // always create standard function frame | |||
bool alwaysframe, // always create standard function frame | |||
bool stacksmash // add stack smashing code |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, it looks like you're using smashing in the code after all :P
With -gx switch, adds code to smash the local variables upon function exit. Useful for flushing out heisenbugs.
A partial implementation of bug http://d.puremagic.com/issues/show_bug.cgi?id=9242