LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 2008 - -fstack-check is not supported (catching infinite recursion)
Summary: -fstack-check is not supported (catching infinite recursion)
Status: NEW
Alias: None
Product: tools
Classification: Unclassified
Component: gnat (show other bugs)
Version: trunk
Hardware: Other Linux
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-10 07:17 PST by Duncan Sands
Modified: 2013-06-25 09:12 PDT (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Duncan Sands 2008-02-10 07:17:16 PST
Compiling a program with -fstack-check is supposed to add
code to check for stack overflow.  This does not happen
with llvm-gcc.  I've filed this option under tools/gnat
because in mainline this option only works with the Ada
front-end.  However patches to mainline have been proposed
that generalize this functionality to all languages.  It
seems like a useful feature for LLVM to support.
Comment 1 Chris Lattner 2008-02-10 11:36:38 PST
Is this related to the -fstack-protector option?  I thought 4.2 had some support for stack canaries. 
Comment 2 Duncan Sands 2008-02-10 12:13:20 PST
It's not related to -fstack-protector: that's trying to prevent people
from overwriting your stack.  -fstack-check is about checking that (via
recursion or whatever) you do not make the stack so big that it runs into
the heap or some other bad place.  Ada doesn't really have a buffer overflow
problem since the compiler is required to insert code to check that there
are no out of range accesses, so -fstack-protector isn't really useful for
it.  However stack overflow is a potential problem.
Comment 3 Chris Lattner 2008-02-10 12:17:46 PST
ah, ok!
Comment 4 Duncan Sands 2012-06-26 14:14:19 PDT
This is the reason for the ACATS test c52104y failing.
Comment 5 Markus Hanauska 2013-06-25 09:12:48 PDT
Are there any plans to ever fix this bug? It seems that even in the latest version of clang the option "-fstack-check" has no effect on the generated code. At least a test case, that should definitely crash if stack checking was supported (and it does crash on Darwin, when building with GCC), does not crash if compiled with clang.