Home > Mobile >  Is buffer overflow the only possible bug associated with program stack?
Is buffer overflow the only possible bug associated with program stack?

Time:12-13

Is buffer overflow the only possible bug associated with C/C program stack? are there any other bugs which can happen at program stack in a single/multi threaded C/C program.

I was reading this paper (Learning from Mistakes — A Comprehensive Study on Real World Concurrency Bug Characteristics) on concurrency bugs, and started thinking that such concurrency bugs do not happen at stack as it is private to threads.

Thanks

CodePudding user response:

You can attempt to use too much stack, typically resulting in a segmentation fault (a report by the hardware that the program has attempted to access memory that is not mapped or not mapped for the type of access attempted and that the operating system does not handle by changing the memory mapping to provide access).

You can use pointers or array indices incorrectly (not just buffer overflows but “underflows” going in the other direction or other incorrect address calculations), corrupting the stack, which can alter program execution in a variety of ways, causing transfer of program control to undesired locations or corrupting data and causing undesired computations.

  • Related