Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!yale!mintaka!mit-eddie!bu.edu!dartvax!northstar5.dartmouth.edu!kriso From: kriso@northstar5.dartmouth.edu (Kris Olander) Newsgroups: comp.sys.hp Subject: stdout problems on HP/UX 6.5 Keywords: fork Message-ID: <22441@dartvax.Dartmouth.EDU> Date: 31 May 90 22:16:40 GMT Sender: news@dartvax.Dartmouth.EDU Reply-To: kris.olander@Dartmouth.edu (Kris Olander) Distribution: usa Organization: Project NORTHSTAR, Dartmouth College Lines: 66 We have been porting our graphic software over to our HP9000-340 and have run into what we think is a bug in the way stdout is handled on HP/UX-6.5. All our applications run under X windows (currently running all R4 binaries and using the corresponding libraries. Our applications fork off a window and then exit. For example, prompt-> scheme (a window opens up and then... prompt-> (the prompt returns because of the exit) Ok, now here comes the problem. When the child tries to print to stdout, the application window disappears. No core file is generated. The same code has been compiled and runs fine on: IBM RTs running AIX 2.2.1 and AOS (BSD 4.3). IBM RS6000 running AIX 3.x ...and other BSD systems. Here is a sample program which produces the same situation: --------------CUT HERE-------------- #include main() { int fork_ret; printf("before fork\n"); fflush(stdout); fork_ret = fork(); if (fork_ret == -1) { printf("unable to fork a child process"); exit(0); } printf("parent and child before exit\n"); if (fork_ret) /* we are the parent - time to bow out */ { printf("parent exiting\n"); exit(0); } printf("child after fork\n"); sleep(10); /* give parent time to exit */ printf("child done\n"); } -------------CUT HERE------------- Anyone have any clues? The program above sleeps so that we can be sure that the parent exits before the child's printf. # Kris Olander ---- ---- arpa: Kris.Olander@Dartmouth.Edu # # ---------------------------------------------------------- # # System Eng. Project NORTHSTAR # # Thayer School of Eng., Dartmouth College # # Kris Olander ---- ---- arpa: Kris.Olander@Dartmouth.Edu # # ---------------------------------------------------------- # # System Eng. Project NORTHSTAR # # Thayer School of Eng., Dartmouth College #