Solved

Process's stack and date adress

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how can i create a game board using shell script 2 76
File system unmounted 3 155
Percona cluster member randomly crash 15 474
Openwrt vnstat 9 160
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

867 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now