Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: "Jeff Tuckey" <Jeff.Tuckey@BerkeleyNet.com>
Subject: unexec'ing an image that uses pthreads ?
Date: 1998/04/07	[thread overview]
Message-ID: <6ge6dg$2ue$1@ha2.rdc1.sfba.home.com> (raw)




hello,

i'm running digital unix 3.2G (Rev. 62) and i am running a verilog
simulation (vcs 4.0.1) that does save and restore by linking against an
unexec routine that i snarfed from the emacs distribution...

this works great -- except when i try to run my stimulus script interpreter
in a separate thread. then the checkpointed image (dumped by $save pli call
that uses the unexec routine) segmentation faults when i
execute it....

my interpreter in a separate thread runs nicely and is able to handshake
(via condition signalling and mutexes) just fine with the main thread...
the only problem is that the checkpointed image is unusable.

my first guess was that maybe the thread scheduling policy was unsafe if it
somehow depended on system time --  so i now create my thread with an
attribute that specifies SCHED_FIFO (which should not use any notion of
'quantum' scheduling)  however, this did not make the checkpointed image run
any better....

i can join with the interpreter thread prior to the checkpoint and this does
not fix the problem...  i can also do the checkpoint prior to even creating
the interpreter thread and this does not fix the problem.

so either the problem is related to the image's start routine or is somehow
inherently due to linking against the thread library....  hmm (or something
else?).  i know nothing about the internals of the thread library so i am at
a loss.

when i run the checkpointed image under gdb with targetdebug set to 1, i get
the following output :

target_wait (-1, status) = 5866,   status->kind = stopped, signal = SIGTRAP
target_fetch_registers (pc) = 0x12029be0 302160864
target_terminal_inferior ()
target_resume (-1, continue, 0)
target_wait (-1, status) = 5866,   status->kind = stopped, signal = SIGSEGV
target_fetch_registers (pc) = 0x1204e3bc 302310332
target_terminal_ours_for_output ()

Program received signal SIGSEGV, Segmentation fault.
target_terminal_ours ()
warning: Hit beginning of text section without finding
target_terminal_ours ()
warning: enclosing function for address 0x1204e3bc
This warning occurs if you are debugging a function without any symbols
(for example, in a stripped executable).  In that case, you may wish to
increase the size of the search with the `set heuristic-fence-post' command.

Otherwise, you told GDB there was a function where there isn't one, or
(more likely) you have encountered a bug in GDB.
target_terminal_ours ()
0x1204e3bc in ??target_xfer_memory (0xc0000000, xxx, 8, read, xxx) = 0


from a mapping file spit out by ld -m, i have the following info :
  .text    1204dbe0      bc0 /usr/ccs/lib/libpthreads.a(cma_tis_sup.o)
  .text    1204e7a0      5d0 /usr/ccs/lib/libpthreads.a(cma_dispatch.o)

it seems that the segmentation fault is always somewhere in cma_tis_sup.o
!!!!

also, i am constrained by the simulator to building only taso images.

any clues on this one are greatly appreciated.  (even something vague like
helping me to know how thick this particular brick wall is that i have found
to beatmy head against...)

thank you.

Jeff Tuckey  (pls. copy replies to jeff@BerkeleyNet.com if possible.)

p.s. we will be upgrading one of our servers to digital unix 4.0 soon --
will that help to fix this ?






                 reply	other threads:[~1998-04-07  4:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox