finding stack location in C using program


 
Thread Tools Search this Thread
Top Forums Programming finding stack location in C using program
# 8  
Old 10-21-2006
.................................................

Last edited by jacques83; 10-22-2006 at 01:13 AM..
# 9  
Old 10-22-2006
Please read the unix.com rules, which state that homework problems are not allowed.
# 10  
Old 10-22-2006
i am sorry sir, i did not know it..will delete all my scraps
# 11  
Old 10-22-2006
Quote:
In some configurations, the stack won't overflow, it will just grow indefinitely, which case an infinite recursion will bring down the entire system instead of crashing.
how do you exactly differentiate between bringing down the system and crashing the system ?

crashing -- not working the way it is expected to work
bringing down - an essential reboot

(This question is out of curiosity and if my question is off-the topic kindly ignore my question ) Smilie Smilie
# 12  
Old 10-23-2006
Quote:
Originally Posted by matrixmadhan
how do you exactly differentiate between bringing down the system and crashing the system?
A crash is when that particular program dies.

Bringing down the system is when the fault brings down the entire system, in this case by allocating infinite amounts of memory until it's all used up and the system grinds to a halt.
# 13  
Old 10-23-2006
Some, particularly older, kernels also go into a "panic". In that state the system is completely unusable. The kernel may also initiate shutdown. Or crash and dump core.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Knowing the size and location of variables in a C program

So I need some help with this. Pardon me if I'm posting in the wrong forum, after some googling for my answer and finding nothing I found this forum. It seemed appropriate for what I was seeking. I just didnt find a forum that concerned the use of GDB. I'm learning to use the C language and GDB.... (2 Replies)
Discussion started by: Cambria
2 Replies

2. Programming

How to read max stack size -Xss that is set/default for a java program?

I need to know what is the maximum stack size i.e. -Xss my java program is running with. Is there a way to find that out from inside my java program code and outside of it. What i am looking for is to read whatever the current set max limit -Xss (stack sie) is for a particular JVM(not... (3 Replies)
Discussion started by: mohtashims
3 Replies

3. UNIX for Dummies Questions & Answers

program location

Hello all, one of application on system requires that "uname" program is in "/usr/uname" location. I can find uname in "/usr/bin/uname" location. Is it possible to present the /usr/bin/uname as that it was located in /usr/uname location? Thank you in advanced, M (1 Reply)
Discussion started by: kreno
1 Replies

4. Programming

Finding the path of the C program

Hi All, I have a c program called findPath.c in a path /home/harsh/c-Programs/. How can i find the path where the program is stored at runtime?? I have given the following #include<stdio.h> int main() { system("dirname $0"); return 0; } This is resulting in the output as . <single dot... (6 Replies)
Discussion started by: sreeharshasn
6 Replies

5. UNIX for Dummies Questions & Answers

finding my location in a string

I'm a relative newbie and apologize if this is silly... Suppose I have a file with English words and their Spanish translations. I read them in like this: while(getline < myfile > 0) { eng = $1 SPAN = $2 } Now, for every eng in SPAN, I want to scan through SPAN and search for a... (2 Replies)
Discussion started by: DrLeeDetroit
2 Replies

6. UNIX for Advanced & Expert Users

Finding register set being used in program

How can i find( or list) contents of all registers being used by my program? Is there any system call or library available for this?:confused: At runtime in my c/c++ program. At runtime using may be some assembly hack!!!!!!!!!!! (2 Replies)
Discussion started by: amit gangarade
2 Replies

7. Shell Programming and Scripting

Finding a word at specific location in a string

Hi All , I have different strings (SQL queries infact) of different lengths such as: 1. "SELECT XYZ FROM ABC WHERE ABC.DEF='123' " 2. "DELETE FROM ABC WHERE ABC.DEF='567'" 3. "SELECT * FROM ABC" I need to find out the word coming after the... (1 Reply)
Discussion started by: swapnil.nawale
1 Replies

8. Programming

access variable through program stack

I am working on garbage collector in C? How should :confused: I find the part of heap where the variable are stored. It there any compiler (GCC) support for this. (2 Replies)
Discussion started by: amit gangarade
2 Replies

9. UNIX for Dummies Questions & Answers

Finding files in subdirectories from one location

Using ssh, is there a simple command to find files in subdirectories from, let's say, the home directory on a shared server? (2 Replies)
Discussion started by: endl
2 Replies

10. Filesystems, Disks and Memory

get stack trace from C program on Solaris 8

I'm on solaris 8. I need to check the stack trace inside my C program. I don't have printstack or walkstack. I tested getcontext and it works. But how do I get the symbols from "stack_t" ? Help please. Many thanks! (4 Replies)
Discussion started by: rydahl
4 Replies
Login or Register to Ask a Question