[lkml]   [1996]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectStack segment

I'm trying to port University of Wisconsin Condor to Linux-ELF. Condor
is a package that does job batching, process migration and process
checkpoint/restore in user level.

In order to checkpoint a running process, condor needs to save its stack
and data segments.

In an earlier port to a.out, there are two methods of finding the
address of the stack:

1) Stack end address : Always assumed to be 0xc0000000;

2) Stack start address :

a. Looking up proc/pid/stat, tsk->mm->start_stack, or
b. Using SETJMP :

jmp_buf env;

(void)SETJMP( env );
return JMP_BUF_SP(env) & ~1023;

The two methods give different results, that differ by around 2084 bytes.
(why should they?).

There is some test code that checks if a typical stack address (the address
of a local data object) is located inside the bounds of the addresses
previously found.

Using method a., I get a stack_start address that is higher than the typical
stack address (strange?). Which is the correct way of finding the stack

Also. I need nlist() for ELF. nlist() in libc is commented out. Somebody
mentioned somewhat called elflib, however I couldn't find anything related.

Christos Ricudis

 \ /
  Last update: 2005-03-22 13:38    [W:0.040 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site