Stack Corruption

download Stack Corruption

of 1

description

Scilab is a scientific software package for numerical computationsproviding a powerful open computing environment for engineering andscientific applications. Developed since 1990 by researchers from INRIA(French National Institute for Research in Computer Science and Control) andENPC (National School of Bridges and Roads), it is now maintained anddeveloped by Scilab Consortium since its creation in May 2003 and integratedinto Digiteo Foundation in July 2008. The current version is 5.2.1 (February2010).

Transcript of Stack Corruption

  • 7/4/2015 Stackcorruption

    http://www.keil.com/forum/59751/ 1/1

    Products Download Events Support SearchForum Go

    ProductsDevelopmentToolsARMC166C51C251VisionIDEandDebugger

    Hardware&CollateralULINKDebugAdaptorsEvaluationBoardsProductBrochuresDeviceDatabaseDistributors

    DownloadsMDKARMC51C166C251Filedownloads

    SupportKnowledgebaseDiscussionForumProductManualsApplicationNotes

    ContactDistributorsRequestaQuoteSalesContacts

    ContactUs|SiteFeedback|TermsofUse|PrivacyPolicyCopyright2015ARMLtdandARMGermanyGmbH.Allrightsreserved.

    Home/DiscussionForum

    StackcorruptionNextThread|ThreadList|PreviousThread StartaThread|Settings

    Details Message

    Reply

    AuthorKumarReddyPosted20May201513:24GMTToolsetARM

    StackcorruptionHello,

    IamworkingonAT91SAM9G20,Keil5.10.Iampassingaconstantstructurepointertoafunction.

    typedefstruct{intTestintOkFlag}StructNode

    typedefconstStructNode*constNode_t

    afterpassingthenode3timesrecursivelythroughafunction

    stackdataisgettingcorrupted.

    AmIdoinganymistake,Pleasesuggest.

    Reply

    AuthorPerWestermarkPosted20May201513:44GMTToolsetARM

    RE:StackcorruptionSohaveyouverifiedthatthestackisbigenough?Andhaveyouverifiedifthereareotherstructuresthatareneighbourwiththestackandmightoverwritethestack?Andhaveyouverifiedyouruseofpointersorarraystocheckforuseofinvalidpointersoroutofboundsaccessestoarrays?

    Reply

    AuthorKumarReddyPosted20May201513:58GMTToolsetARM

    RE:StackcorruptionIhaveabundantstack,Iamnotmodifyinganydatainsidethefunction,Ihavetrimmedthefunctiontominimal,forjustpassingaduplicatenodebutdatavariablespresentinthefirstcalleraregettingcorrupted.

    Iamtypecastingaautovariabletoconsttype

    StructNodeNodeNode_tNodePtr=&Node

    IsuspecttheremightbeissuewithNode_ttypecastfromNode

    Reply

    AuthorReinhardKeilPosted28May201512:25GMTToolsetARM

    RE:StackcorruptionPassinganaddressofastackbasedvariablecanbetrickysincethelifetimeofthevariableendsatthefunctionreturn.

    Whenthereferencepointerofsuchavariableisusedafterthat,yougetastackcorruption.Isuggestthatyouanalyzeyourprogramforsuchascenario.

    NextThread|ThreadList|PreviousThread StartaThread|Settings

    Importantinformation

    Don'tshowthismessageagain

    ChangeSettings

    Thissiteusescookiestostoreinformationonyourcomputer.Bycontinuingtouseoursite,you

    consenttoourcookies.