Re: reg /proc/self/maps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

On 22:42 Mon 27 Oct     , Preeti wrote:
> Hi
> 
> As we know the typical entries for a process looks like this (from
> /proc/self/maps)
> 
> 08048000-0804c000 r-xp 00000000 08:02 981204     /bin/cat
> 0804c000-0804d000 rwxp 00003000 08:02 981204     /bin/cat
> 0804d000-0806e000 rwxp 0804d000 00:00 0          [heap]
> b7cd7000-b7dff000 r-xp 00000000 08:02 1736405
> /usr/lib/locale/locale-archive
> b7dff000-b7e00000 rwxp b7dff000 00:00 0
> b7e00000-b7f27000 r-xp 00000000 08:02 229670     /lib/tls/i686/cmov/
> libc-2.3.6.so
> b7f27000-b7f2c000 r-xp 00127000 08:02 229670     /lib/tls/i686/cmov/
> libc-2.3.6.so
> b7f2c000-b7f2e000 rwxp 0012c000 08:02 229670     /lib/tls/i686/cmov/
> libc-2.3.6.so
> b7f2e000-b7f31000 rwxp b7f2e000 00:00 0
> b7f44000-b7f46000 rwxp b7f44000 00:00 0
> b7f46000-b7f47000 r-xp b7f46000 00:00 0          [vdso]
> b7f47000-b7f5c000 r-xp 00000000 08:02 212578     /lib/ld-2.3.6.so
> b7f5c000-b7f5e000 rwxp 00014000 08:02 212578     /lib/ld-2.3.6.so
> bfdf6000-bfe0b000 rw-p bfdf6000 00:00 0          [stack]
> 
> If I want to stop a running process and restore it later (ie checkpoint and
> restore), is it possible to do so by using these virtual memory mappings? If
> so, can someone tell how to go about it?

No, it is *much* more complex. You have to freeze the process and:
- save all registers
- dump the memory, especially anonymous pages (e.g. malloc)
- dump and restore all file descriptors; This may include e.g. TCP sockets
which are pretty hard to save+restore, especially if the other endpoint has
some state.
- invent something to handle things like "System V IPC" e.g. multiple
  processes sharing memory
- save any state the kernel not mentioned yet; Basically everything, e.g.
every character device may have some state and needs to be audited.

You also have to make sure that the relevant files on the file system are
unchanged.

I have seen some people trying to do these things. Maybe somebody can give you
references?
	-Michi
-- 
programing a layer 3+4 network protocol for mesh networks
see http://michaelblizek.twilightparadox.com


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux