Patch Name: PHSS_6087 Patch Description: s700_800 10.X Cumulative DDE patch Creation Date: 96/01/22 Post Date: 96/02/12 Hardware Platforms - OS Releases: s700: 10.00 10.01 10.10 s800: 10.00 10.01 10.10 Products: DDE v3.25 Filesets: DDE.DDE Automatic Reboot?: No Status: General Release Critical: No Path Name: /hp-ux_patches/s700_800/10.X/PHSS_6087 Symptoms: PHSS_6087: The following symptoms correspond to the descriptions in the defect descriptions field for PHSS_6087: Note: some of these lines were wrapped to fit into a (required) 60 column format. 1. DDE core dumps on 'restart' 2. Incorrect message: Cannot determine information about shared library /lib/dld.sl 3. Call to main function while in shared library causes problems Strange behavior can occur after a cmd line call from within a shared library. 4. "call" does not save/restore the floating point regs The floating point registers may be incorrect after a cmd line call. 5. C++ member functions in shlibA are not known in shlibB 6. "call" to functions returning user-defined type returns nothing 7. "list image -full" should show if image has debug info 8. "call" command on C++ routines does not work correctly 9. Signals get lost with fork/restart on 10.01 systems. 10. DDE 'env' command stops working after make/restart. 11. DDE SEGV's after fix/restart. 12. DDE gets lost when target does shl_load of lib with dependencies 13. DDE hangs ('go' does nothing) on 10.X after vfork. 14. Can't print return value of cmdline pcall if no debug info. 15. Watchpoint on C++ ref parm is broken. 16. DDE hangs when debugging a program with missing shared libs on 10.X 17. Fake stars bug to push out this patch. Defect Description: PHSS_6087: The following defect descriptions are for PHSS_6087: Note: some of these lines were wrapped to fit into a (required) 60 column format. This will make some message text look different from how it appears to the user. 1. dde core dumps on 'restart' - start up softdebug - debug an executable "test" - using "fix and restart" the following effectively happens: rename the executable "test" to "test.fix" rebuild "test" - Issue the DDE command: "restart -input -default -output -default -error -default -noargs" - DDE dumps core 2. Incorrect message: Cannot determine information about shared library /lib/dld.sl The message: Cannot determine information about shared library /lib/dld.sl. occures when using the 'debug' command. This is very hard to reproduce. 3. Call to main function while in shared library causes problems. Step into a shared library routine. env to the main image. Call a main image function. env to the current 8run location. step -over. The step will complete somewhere in the main image (not in the shared library function where it was supposed to complete). Typically it will stop at the statement following the shared library function call. However, it has been seen it step to the called function. Anyway, things seem to be left in an unreliable state because we have occasionally seen the target program SIGSEGV shortly after, where we believe it would not have SIGSEGVd if we had not made the call. dde> cd ~dan/bugs/3.1 dde> prop flags tgt_shlib_debug dde> prop lib r* dde> deb tenchi ... junk removed ... dde> go -unt ryouko (Warning) Date-Time-Modified of source found (Fri Jun 2 09:40:47 1995) doesn't match expected DTM from object module (Fri Jun 2 06:37:15 1995). Stopped at: \\ryoohki\ryouko\3 dde> env `env(-1) Environment: \\tenchi\main\14 (00001EB4) (frame `main(3)) Stopped at: \\ryoohki\ryouko\3 dde> call kagato() (Warning) For function calls between images, the caller must reside in the main image. dde> env `run Environment: \\ryoohki\ryouko\3 (frame `main(4)) Stopped at: \\ryoohki\ryouko\3 dde> step -over Stepped to: \\tenchi\main\16 (00001EC0) 4. "call" does not save/restore the floating point regs. Thus, a "call" from any point where there are live values in scratch fp registers will mess up the debugee. Example: In the following, a print of an expression containing a function call messed up the values in fr4, fr5, and others: cd ~title/callbugs dde -ui line float dde> fregs fr0l: 00000000 00000000 00000000 00000000 fr2l: 00000000 00000000 00000000 00000000 fr4: 0.0 -2.01960957053611 -2.009401440653299 -2.011644482645488 fr8: 4.031792002834017e-313 4.243991581930545e-314 2.0 25.73990101230499 fr12: 0.0 33554432.0 3.395193266334941e-313 0.0 fr16: -8.617333664912913e+307 131072.0 512.0 -8.617333664912913e+307 fr20: 131072.0 -8.617333664912913e+307 380.2277205838092 0.0 fr24: 28.0 72.0 400.0 0.25 fr28: 100.0 4.0 0.0 0.0 dde> print fpsubr(5.0,6.0) -5.5 14 B> x1 = 1.0; Stopped at: \\float\main\14 dde> fregs fr0l: 00000000 00000000 00000000 00000000 fr2l: 00856E06 00000000 00000000 00000000 fr4: -4096.0 2.0 -5.5 -0.007812501897205948 fr8: -1048576.754638672 -4096.0 2.0 25.73990101230499 fr12: 0.0 33554432.0 3.395193266334941e-313 0.0 fr16: -8.617333664912913e+307 131072.0 512.0 -8.617333664912913e+307 fr20: 131072.0 -8.617333664912913e+307 380.2277205838092 0.0 fr24: 28.0 72.0 400.0 0.25 fr28: 100.0 4.0 0.0 0.0 5. C++ member functions in shlibA are not known in shlibB If libA.sl defines a class CC, with member funtion "func". If we are currently in main program, and use "pro lib", then we can "break CC::func" If we are in another sharedlibrary, and use "pro lib", cannot "break CC::func", it says "location not found" "break -in CC" works though. If we use "env" to go to libA.sl, then we can 'break CC::func' 6. "call" to functions returning user-defined type returns nothing The problem can be illustrated with a simple example: typedef foo int; main() { } foo subr_foo(foo x) { return x*2; } dde> print subr_foo(1) 8 B> a = subr_int(1); Stopped at: \\userdef\main\8 (i.e., no return value shown) This only happens if the return type is a typedef. I.e., change program to "int subr_foo..." and it works. 7. "list image -full" should show if image has debug info users woulld actually like to know the following for "list image -full": 1. Is the library (image) compiled with -g? Note that an image may contain a mixture of -g and non-g object files. 2. Has the debugger loaded symbol/debug info for this image yet? (thru "pro lib") 8. "call" command on C++ routines does not work correctly C++ Symbols in shared libraries are not being found [SEE 3 {Call to main function...} above, problems are related] 9. Signals get lost with fork/restart on 10.01 systems. This small program demonstrates a problem with dde on 10.01. Signals do not seem to be handled correctly by dde. With the test program, the signals are delivered correctly the first time, but after restarting, they are not. Here's how to duplicate the problem: Compile the source: cc -g forker.c -o forker10 Run it inside of dde: debug forker10 bogus # bogus does not exist, so exec fails break 27 # break before printf in parent prop fork -parent # we're just going to follow the # parent go # go until breakpoint, after fork step # should get a SIGCHLD intercept # after this go # should get a SIGALRM after two # seconds restart # now restart the target program go # go until breakpoint, after fork step # should get a SIGCHLD, but we don't go # now process appears hung; we never # get SIGALRM [note: program modified to fit 60 columns, sigh] #include #include main(argc, argv) int argc; char *argv[]; { pid_t parentpid, childpid; if (argc < 2) exit(); parentpid = getpid(); printf("(%d) Before the fork...\n", parentpid); if ((childpid=fork()) == 0) { childpid = getpid(); printf( "(%d) In child, pid is: %d parent pid is %d\n", childpid, childpid, getppid()); printf( "(%d) Child will exec %s\n", childpid, argv[1]); execvp(argv[1], &argv[1]); /* we only get here if the exec fails... */ printf("(%d) Can't exec %s!\n", childpid, argv[1]); } else { printf( "(%d) In parent process, pid is: %d child pid is: %d\n", parentpid, parentpid, childpid); sleep(2); } } 10. DDE 'env' command stops working after make/restart. 0) Compile the attached program by typing 'make' 1) Debug the attached program: dde> debug Blackjack Executing image in process 21785: "/users/jww/dde_test_programs/Blackjack/Blackjack". Break at: \\BlackJack\main\40 2) Note the version: dde> ver dde, version 3.25A.P1 User interface manager ui_motif: X/Motif UI, version 3.25A Target manager tgt_hpux_pa: HP-UX PA-RISC, version 3.25A.P1 DBGK 3.25A.P1 Object manager obj_som_som: HP SOM, version 3.25A Language manager lang_c++: C++, version 3.25A 3) Set the env to a specific source file: dde> env "Card.C"\1 Environment: \\Card (inactive routine) Stopped at: \\BlackJack\main\40 4) Do a softbench "fix" (in a shell do this): - rename the exectuable "mv Blackjack Blackjack.fix" - rebuild it "make" 5) Now do a 'restart': dde> restart Restarting: /users/jww/dde_test_programs/Blackjack/Blackjack Executing image in process 21802: "/users/jww/dde_test_programs/Blackjack/Blackjack". (Warning) Program /users/jww/dde_test_programs/Blackjack/Blackjack has been modified; monitors may not be restored correctly. Break at: \\BlackJack\main\40 6) Try to set the env back to that source file: dde> env "Card.C"\1 ?(dde) File "Card.C" not found. ?(dde) Statement "1" not found in specified environment. BUG --- DDE no longer knows about that file! 11. DDE SEGV's after fix/restart. DDE has a segv after a make/restart. 1) Load program into dde 2) Set breakpoints, run, step, etc. 3) Touch source file, use "Fix Executable" - move the old executable to a new name - make the exectuable again. 4) Upon restarting, dde hit the first breakpoint in main, then got a segv. 12. DDE gets lost when target does shl_load of lib with dependencies DDE gets temporarily lost when debugging applications that call shl_load with libraries that have a list of dependent libraries (i.e. transitive loads). The behavior is very confusing. DDE has no idea where the target program is and gives no indication to the user what is going on. It turns out that if the user executes the program enough times it will eventually get out of the shl_load and continue normal execution. Workaround: With this bug, DDE is stuck within the shl_load. The user must execute the program (i.e. go) once for each shared library being loaded. Thus, if the library being shl_loaded has 3 libraries in its dependent library list, then the user must issue a 'go' at least 4 times to get out of the shl_load. 13. DDE hangs ('go' does nothing) on 10.X after vfork. The problem was in DDE's handling of vfork. However, the user often ran into this problem when calling routines such as 'system' or 'popen'. These routines in turn call 'vfork'. Thus, the use doesn't may not even realize why the problem is occuring. With 'system' and 'popen' calls, they are vforking and execing a system shell, which does not have any debug information. DDE was unneccesarily trying to load debug information for the vforked shell, even though it was not actually going to debug it (prop fork -parent). 14. Can't print return value of cmdline pcall if no debug info. You can not print the value of a command line pcall if there is no debug info for the value. dde> prop lib -add libc.sl dde> print malloc(10) (dde) Unexpected error in dcp package. The code was fixed to be able to call routines without debug info, but not to print the return values. This happens with any non-debuggable code, not just code in shared libs. You should assume a return value of "int" and construct a dummy sym record to display it. 15. Watchpoint on C++ ref parm is broken. [no example given] 16. DDE hangs when debugging a program with missing shared libs on 10.X 1) Create a program that uses shared libraries. 2) Link the program 3) Remove one of the shared libraries 4) Run the program You get the following message: /usr/lib/dld.sl: Can't find path for shared library: liblserver-5.sl /usr/lib/dld.sl: No such file or directory core dump Now try and try and load the program in DDE. You get the same msgs from dld.sl to your terminal window, but DDE never does anything. It just sits there. You can't interrupt it. 17. Fake stars bug to push out this patch. SR: 5003298778 Patch Files: /opt/langtools/bin/dde /opt/langtools/dde/mgrs/obj_som_som /opt/langtools/dde/mgrs/tgt_hpux_pa /opt/langtools/dde/mgrs/ui_motif /opt/langtools/dde/lib/nls/msg/C/tgt_hpux_pa.cat /opt/langtools/dde/lib/nls/msg/C/ui_softdde.cat.P0 what(1) Output: /opt/langtools/bin/dde: HP Distributed Debugging Environment (HP/DDE) - Vers ion 3.25.P3 Series 700 B3477AA Series 800 B3472AA REV: 950209.102443, 9000/7 /opt/langtools/dde/mgrs/obj_som_som: HP/DDE Object manager obj_som_som: HP SOM - Version 3.25.P3 Series 700 B3477AA Series 800 B3472AA /opt/langtools/dde/mgrs/tgt_hpux_pa: HP/DDE Target manager tgt_hpux_pa: HP-UX PA-RISC - V ersion 3.25.P3 Series 700 B3477AA Series 800 B3472AA /opt/langtools/dde/mgrs/ui_motif: HP/DDE User interface manager ui_motif: X/Motif UI - Version 3.25.P3 Series 700 B3477AA Series 800 B3472AA /opt/langtools/dde/lib/nls/msg/C/tgt_hpux_pa.cat: None /opt/langtools/dde/lib/nls/msg/C/ui_softdde.cat.P0: None cksum(1) Output: 1423182762 1576960 /opt/langtools/bin/dde 3037896241 135168 /opt/langtools/dde/mgrs/obj_som_som 2481657390 462848 /opt/langtools/dde/mgrs/tgt_hpux_pa 4238935516 237568 /opt/langtools/dde/mgrs/ui_motif 2157187197 9679 /opt/langtools/dde/lib/nls/msg/C/ tgt_hpux_pa.cat 2675396353 2300 /opt/langtools/dde/lib/nls/msg/C/ ui_softdde.cat.P0 Patch Conflicts: None Patch Dependencies: None Hardware Dependencies: None Other Dependencies: None Supersedes: None Equivalent Patches: PHSS_6086: s700: 9.01 9.03 9.05 9.07 s800: 9.00 9.04 9.08 Patch Package Size: 2460 Kbytes Installation Instructions: Please review all instructions and the Hewlett-Packard SupportLine User Guide or your Hewlett-Packard support terms and conditions for precautions, scope of license, restrictions, and, limitation of liability and warranties, before installing this patch. ------------------------------------------------------------ 1. Back up your system before installing a patch. 2. Login as root. 3. Copy the patch to the /tmp directory. 4. Move to the /tmp directory and unshar the patch: cd /tmp sh PHSS_6087 5a. For a standalone system, run swinstall to install the patch: swinstall -x autoreboot=true -x match_target=true \ -s /tmp/PHSS_6087.depot 5b. For a homogeneous NFS Diskless cluster run swcluster on the server to install the patch on the server and the clients: swcluster -i -b This will invoke swcluster in the interactive mode and force all clients to be shut down. WARNING: All cluster clients must be shut down prior to the patch installation. Installing the patch while the clients are booted is unsupported and can lead to serious problems. The swcluster command will invoke an swinstall session in which you must specify: alternate root path - default is /export/shared_root/OS_700 source depot path - /tmp/PHSS_6087.depot To complete the installation, select the patch by choosing "Actions -> Match What Target Has" and then "Actions -> Install" from the Menubar. 5c. For a heterogeneous NFS Diskless cluster: - run swinstall on the server as in step 5a to install the patch on the cluster server. - run swcluster on the server as in step 5b to install the patch on the cluster clients. The cluster clients must be shut down as described in step 5b. By default swinstall will archive the original software in /var/adm/sw/patch/PHSS_6087. If you do not wish to retain a copy of the original software, you can create an empty file named /var/adm/sw/patch/PATCH_NOSAVE. Warning: If this file exists when a patch is installed, the patch cannot be deinstalled. Please be careful when using this feature. It is recommended that you move the PHSS_6087.text file to /var/adm/sw/patch for future reference. To put this patch on a magnetic tape and install from the tape drive, use the command: dd if=/tmp/PHSS_6087.depot of=/dev/rmt/0m bs=2k Special Installation Instructions: None