ya because increase of stack limit is not in our hand.
you have to talk with MDs of intel and amd
Actually, this is not correct. The stack is allocated by the programme, but is set to a default value. You will have to look in the compiler's or IDE's manual to set the stack size. You can also set this when spawning a new thread, but is a bit overkill if you are writing a single-threaded app.
If you want help with setting the default stack size, state the compiler and IDE (if any) you are using. Someone may be able to point you in the right direction.
That said, the stack is usually big enough for most apps, so it could be you have a infinite recursion problem in your code. Posting the output stating where the problem is occurring, the function where this is occurring and probably the function that is calling the function that is causing the error would allow us to help in that regard. If you don't know where the problem is occurring, take a look in your code for recursive functions and post them, and we will see what we can do.
Actually, this is not correct. The stack is allocated by the programme, but is set to a default value. You will have to look in the compiler's or IDE's manual to set the stack size. You can also set this when spawning a new thread, but is a bit overkill if you are writing a single-threaded app.
If you want help with setting the default stack size, state the compiler and IDE (if any) you are using. Someone may be able to point you in the right direction.
That said, the stack is usually big enough for most apps, so it could be you have a infinite recursion problem in your code. Posting the output stating where the problem is occurring, the function where this is occurring and probably the function that is calling the function that is causing the error would allow us to help in that regard. If you don't know where the problem is occurring, take a look in your code for recursive functions and post them, and we will see what we can do.
Hope this helps.
Adrian
Thanks for your valuable time… I have solved this problem….
ya because increase of stack limit is not in our hand.
you have to talk with MDs of intel and amd
Thanks for ur valuable time..... Stack size is something related with system software i.e compiler.. as per I know stack is a block of memory with LIFO principle, created by system software i.e compiler.... Please correct me if i am wrong
Thanks for ur valuable time..... Stack size is something related with system software i.e compiler.. as per I know stack is a block of memory with LIFO principle, created by system software i.e compiler.... Please correct me if i am wrong
I don't need to correct you as you are correct. That is the definition of the programme stack.
stack is a block of memory not created by compiler,but assigned to it by the processor
Originally posted by bawa
Thanks for ur valuable time..... Stack size is something related with system software i.e compiler.. as per I know stack is a block of memory with LIFO principle, created by system software i.e compiler.... Please correct me if i am wrong
stack is a block of memory not created by compiler,but assigned to it by the processor
Hey, you want to get technical, there has to be a base stack that needs to be created for the programme. It is not assigned by the processor as the processor doesn't care. (boy this is going to get involved)
Here is a simplified but fairly accurate step by step of what is going on:
You start off with an OS and an executable image file.
The image file is loaded into memory.
Somewhere in the image file states the size of the default stack.
This stack memory is allocated by the OS.
Somewhere in the image file states the code entry point.
The OS sets the stack pointer register to the base of the stack and then executes the code at the entry-point. (there are also registers saved prior to this so that the OS’s task system can come back and possibly pass the execution to another task if it is a multitasking system)
So, yes, the default stack isn't created by the compiler, it is defined by it. Also, every time you create a new thread, you must state the size of the stack for that thread but that call is put on the stack that is invoking the new thread call.
You cannot invoke a task, thread or fibre without an initial stack. This goes back to the OS, as the OS must have a running stack to create the stack of the image file it is about to execute. Even when the computer boots up, it has an initial stack and an entry point (stored in ROM somewhere) which will eventually be blown away when the OS boot loader takes over.
I hope this is clear, as this is a bit more detailed than I had intended to go. If you are in University, I recommend you take Operating Systems. It is a very interesting course.
Hey, you want to get technical, there has to be a base stack that needs to be created for the programme. It is not assigned by the processor as the processor doesn't care. (boy this is going to get involved)
Here is a simplified but fairly accurate step by step of what is going on:
You start off with an OS and an executable image file.
The image file is loaded into memory.
Somewhere in the image file states the size of the default stack.
This stack memory is allocated by the OS.
Somewhere in the image file states the code entry point.
The OS sets the stack pointer register to the base of the stack and then executes the code at the entry-point. (there are also registers saved prior to this so that the OS’s task system can come back and possibly pass the execution to another task if it is a multitasking system)
So, yes, the default stack isn't created by the compiler, it is defined by it. Also, every time you create a new thread, you must state the size of the stack for that thread but that call is put on the stack that is invoking the new thread call.
You cannot invoke a task, thread or fibre without an initial stack. This goes back to the OS, as the OS must have a running stack to create the stack of the image file it is about to execute. Even when the computer boots up, it has an initial stack and an entry point (stored in ROM somewhere) which will eventually be blown away when the OS boot loader takes over.
I hope this is clear, as this is a bit more detailed than I had intended to go. If you are in University, I recommend you take Operating Systems. It is a very interesting course.
TTFN,
Adrian
Thank for your valuable time... and good explanation about the stack process.
I have solved my problem by putting more nested if else if ... now that problem has been solved... my that code file is of around 6000 lines of code... that error was bcoz of if conditions.. only
Comment