stack-overflow

Does a program stack truly overflow?

大憨熊 提交于 2019-12-06 06:11:05
Won't the processor cause a TRAP to the operating system if the stack size limit is reached(thus preventing a stackoverflow :P) I believe Windows does have a stack that grows when you reach the end. In the Visual Studio compiler the code responsible for this is in the chkstk.obj module. Since this code is open-source I can post it here: ;*** ;_chkstk - check stack upon procedure entry ; ;Purpose: ; Provide stack checking on procedure entry. Method is to simply probe ; each page of memory required for the stack in descending order. This ; causes the necessary pages of memory to be allocated via

“Normal” UIButton causing obj_stack_overflow or EXC_BAD_ACCESS exception

允我心安 提交于 2019-12-06 05:19:14
问题 It sure looks innocuous enough. In my App Delegate, I check NSUserDefaults for a flag to show tips at startup. If it’s set then, at the end of applicationDidFinishLaunching: , I do this: TipsViewController *vc = [[TipsViewController alloc] initWithNibName:@“TipsView" bundle:nil]; [window addSubview:vc.view]; [vc release]; The idea is to show this view temporarily. (Note that it’s not a modal VC. No Navigation Controller at this point, plus there’s no navigation bar in this view anyway.) Once

“Recursive on All Control Paths” error when implementing factorial function

浪子不回头ぞ 提交于 2019-12-06 04:13:11
问题 For class I have an assignment: Write a C++ program that will output the number of distinct ways in which you can pick k objects out of a set of n objects (both n and k should be positive integers). This number is given by the following formula: C(n, k) = n!/(k! * (n - k)!) Your program should use two value-returning functions. The first one should be called factorial and should return n! . The second function should be called combinations and should return n!/(k! * (n - k)!). Test your

Max number Activities support in android?

一世执手 提交于 2019-12-06 03:56:38
I created an application with tab and many number of activities and child activities.But am getting an StackoverFlow error .Its because more number of layers of activity remaining in the stack.Now am planing it to rebuild with separate activities.Near to 30 activities will be needed for the app and I have also more functionalities in activities.So I want to know is there any limit for the number of activities .If not will any thing happen to app if the the number of activities are more than 25 like memory issues and stackoverflow.if yes what is the limit of the number of activities in app.

Different Methods of Performing FloodFill

為{幸葍}努か 提交于 2019-12-06 03:23:37
问题 OK everyone I have several different methods of performing a FloodFill. All of them cause problems. I will list the 3 methods and explain what happens with each one. If anyone could give me some pointers that would be great. I have seen some similar posts but none of them have been for C#, java, or VB.net (the only languages I know). The givens for this are that I have a class called PixelData which stores a Color in a CellColor member variable. I have an array that is 50x50 of PixelData

libsigsegv and responding to a stack overflow

天大地大妈咪最大 提交于 2019-12-06 03:06:58
问题 We are attempting to test student code, and in an effort to automate the process, we'd like to detect if a student's code overflows the stack. I've met with some success using the libsigsegv library and its corresponding stackoverflow_install_handler. It works brilliantly, until the student's code blows the stack twice. For example, here's some sample output: [# ~]$ ledit ./interpreter -> (use solution) -> (fun 1 2) *** Stack overflow detected *** -> (fun 1 2) Signal -10 [# ~] The initial " *

Which versions of GCC, or flags, should I use when studying buffer overflows?

爱⌒轻易说出口 提交于 2019-12-06 02:49:17
问题 Recently, I've been studying buffer overflows as an undergraduate student in Computer Engineering. Simply out of interest, I began researching and studying buffer overflows, but have gotten stuck when attempting to implement them in my own C programs on my computer, compiled with GCC 4.9.1 (in Debian Jessie). I've heard that there are sorts of stack overflow protection in newer compilers, so I'm thinking that my issue is that my compiler version is too new. Either that, or I'm not compiling

Detecting that the stack is full

*爱你&永不变心* 提交于 2019-12-06 00:54:20
问题 When writing C++ code I've learned that using the stack to store memory is a good idea. But recently I ran into a problem: I had an experiment that had code that looked like this: void fun(const unsigned int N) { float data_1[N*N]; float data_2[N*N]; /* Do magic */ } The code exploted with a seqmentation fault at random, and I had no idea why. It turned out that problem was that I was trying to store things that were to big on my stack, is there a way of detecting this? Or at least detecting

Stack Overflow of 8086 microprocessor

痞子三分冷 提交于 2019-12-06 00:10:59
What'll be the behaviour of the 8086 Microprocessor when the stack is full and even then I push something into it? On the 8086, a PUSH instruction or implicit stack push will decrement the SP register by two and store the appropriate quantity at SS:SP (i.e. 16*SS+SP). If the SP register was $0000, the data will go to SS:$FFFE. If the SP register was $0001, the MSB of the data will go to SS:$0000 and the LSB will go to SS:$FFFF. The processor will not take any special notice of the stack wraparound. While stack wraparound would typically be a bad thing, there are some situations on the 8086

Programmatic button click throws 'System.StackOverflowException' exception

蓝咒 提交于 2019-12-05 20:18:02
问题 I have written a WinForms program in C#.Net to click a button programmatically within a password form. Form1 loads and shows Form2 as a dialogue box. The application will close if DialogResult is anything other that DialogResult.OK. So far I have a button click event, which is coded as follows: if (txtpass.Text == "") { MessageBox.Show("You need to enter a password", "Password", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); txtpass.Focus(); } else { if (txtpass.Text == "1234") { radButton1