Solved

Process's stack and date adress

Posted on 2000-04-26
5
199 Views
Last Modified: 2010-04-22
I want to find process's stack and date address when i stop it .
How can i take these variables?
  I start a process with another program then this program stop other and take it's stack and data address. This is the starting point of checkpointing. I have some problems with kernel 2.2 .
Thanks.
0
Comment
Question by:Parlakisik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Author Comment

by:Parlakisik
ID: 2750737
Adjusted points from 75 to 250
0
 
LVL 4

Expert Comment

by:kiffney
ID: 2751581
run it under gdb.  You have to compile the program with the -g option. then do
gdb myprogram.  You can also use gdb to attach to a running process by starting gdb, then  typing 'file myprogram' then 'attach process-id'.

To tell gdb to break at a certain point

break myproblemfunction

where myproblemfunction is the name of a function you want to stop at.

then do 'run'.

The stack commands include 'bt' which allow to you backtrack in the current stack frame; 'frame n' which allows you to switch frames, where 0 is the current frame, 1 is the next frame up, etc.

The print command will show you the contents of your data variables, and the x command will let you look at any area of memory available to the program.

There's a tutorial on gdb at
http://www.cs.utah.edu/dept/old/texinfo/gdb/gdb_toc.html
0
 

Author Comment

by:Parlakisik
ID: 2751616
Edited text of question.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2753604
If you are trying write code to "checkpoint" a task so that it can be resumed later, there's likely to be a bit more to it than just getting the program stack. You'd also have to deal with open file descriptors and possibly other things.

In the absense of system support for checkpointing, as was found on super-computers and large mainframes, most folks who need that capability build a form of checkpointing into their task, writing the "live internal data" to file so that it can be restored when the program is restarted. You do have to be careful with respect to how you handle any open files, but it's otherwise pretty straightforward. If the task is long running (days, weeks, etc) and there's a concern that a system or power failure might result in the loss of the run, the internal "checkpoint can be done a regular intervals. It can also be arrainged for the checkpoint to occur as the result of a signal being delivered to the process.
0
 

Accepted Solution

by:
liyang earned 250 total points
ID: 2851677
If you just want to checkpoint processes, have a look at esky, here: http://freshmeat.net/appindex/1999/10/05/939182194.html

OTOH, if you want to learn about how to do checkpointing, then looking through its source code would be a good idea. (Open Source is great, isn't it?)

hth
/Liyang
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question