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
Solved

Process's stack and date adress

Posted on 2000-04-26
5
198 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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
whats a headless user in linux 3 313
Automating a set of commands run on linux 7 100
How to use docker to run your java program on a linux box 9 109
awk file 6 78
Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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