From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1065ea,1de1dacf4dbe02b2,start X-Google-Attributes: gid1065ea,public X-Google-Thread: fee84,1de1dacf4dbe02b2,start X-Google-Attributes: gidfee84,public From: "Jeff Tuckey" Subject: unexec'ing an image that uses pthreads ? Date: 1998/04/07 Message-ID: <6ge6dg$2ue$1@ha2.rdc1.sfba.home.com>#1/1 X-Deja-AN: 341834663 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.2106.4 Organization: Berkeley Networks Newsgroups: comp.unix.osf.osf1,alt.unix.wizards 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 ?