This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Problem with saving whole process data on user level


Hello,

I have a question regarding glibc-2.3.2 version.

I have written a simple process checkpointer for myself, integrateid into
dynamic loader of glibc (elf/rtld.c file) - it works on user level.
Basically, on checkpoint
it saves user-space text and data segments (both of the process itself and
accessed shared objects, including libc.so.6) so no process data shall
be lost. The process is saved in a checkpoint file of ELF executable format
so restart is as easy as re-executing the file (with modified ld.so of
course).

It worked fine for my previous system, RedHat 7.3 with Kernel
2.4.23-ict1_7 and glibc-2.2.5-44.

When I try to port it to RedHat 9 (Kernel 2.4.22-ict5_9) with
glibc-2.3.2-27.9.7, there are some problems. The checkpointing goes well
and when I restart the program from checkpoint file, it computes correctly
until exiting, when it SegFaults on "_IO_flush_all_lockp" libc call.

Also, when the checkpointed process calls some glibc routines (like
"printf" or "atoi"), after checkpoint/restart it always crashes with
SegFault inside the very first call of these functions. Even when I
want to access "errno" value, the same occures.

I have discovered that this new glibc is (by default) compiled with TLS
support (in fact, my libc.so.6 library has new PT_TLS ELF program header).
Please tell me, is my problem related to thread-local storage? Even when
my program doesn't use nptl library, is there some process-related data
stored in kernel-space for threading reasons (i.e. outside user data
space) which I fail to save in checkpoint file? When I simply print
"errno"  address (before checkpointing) it indicates an address inside
process-space (exactely, an anonymous memory mapping just following
libc.so.6 data segment in /proc/self/maps file).

One more observation: when I try to use a glibc routine which does not
access any glibc-internal data (I've found "strcpy" is such a function)
it works well even past the checkpoint/restart. And that made me think about
data...

Please, respond also directly to my address as I'm not subscribed to the
list.

Sorry for a long mail and thanks in advance.

Tomasz Gubala
(gubala@science.uva.nl)
University of Amsterdam
Institute of Computer Science




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]