Bug 98687
Summary: | Applications crash with -fstack-check on compile | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Sean Bruno <sean.bruno> |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED WONTFIX | QA Contact: | Brian Brock <bbrock> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 2 | CC: | mitr, tao |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i686 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2004-10-07 14:30:57 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Sean Bruno
2003-07-07 15:33:57 UTC
gcc generates code that "extends" the stack by touching every page when extending the stack, but does so by touching data below %esp. This is not allowed by the kernel (do_page_fault () in arch/i386/mm/fault.c). The more interesting question is why is the kernel not killed every time. Same in FC2 (gcc-3.3.3-7). The kernel expects the compiler either to move esp first or to use mmap to map anonymous pages over the new pages. Indeed, the implementation of this feature is completely borked. As to why this doesn't happen all the time, and why randomly on FC2, it's due to /proc/sys/kernel/exec-shield-randomize varying the top of the stack. My preferred "solution" to this problem is to remove this code from the compiler. The concept of the compiler generating code to check for stack overflow doesn't make a whole lot of sense in a normal Unix environment. Yeah, just don't use -fstack-check. |