This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

can -fstack-protector-all be used to find leaks

   Is it possible to leverage the new -fstack-protector-all feature
in gcc 4.1 branch to discover the origin of memory leaks that are
clobbering the stack? I have a fortran program which segfaults in
the next write it attempts after a particular read. I have compiled
this fortran code with -fstack-protector-all and the segfault is
suppressed and replaced with a runtime error 02 exit of the
program. Since the problem seems to occur during a fortran read call,
I have rebuilt the gcc 4.1 branch libgfortran using the 
-fstack-protector-all option and will try debugging the fortran
program with that library in place.
    What I am uncertain about is exactly what behavior I should expect
from the code generated by -fstack-protector-all. My hope is that
I will see a runtime error generated by the stack protector code
in libgfortran's io routines when the stack gets clobbered. Is this
scenario reasonable or am I expecting too much from the stack
protector code? Thanks in advance for any insights on this issue.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]