.
D 2000-10-26T01:01:54
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s942\sBug\nVersion:\s8.1a2\nSubmitDate:\s'1998-12-10'\nLastModified:\s'1999-12-11'\nSeverity:\sMED\nStatus:\sReleased\nSubmitter:\swelch\nChangedBy:\shobbs\nRelatedBugIDs:\s2228\s1312\nOS:\sSolaris\nOSVersion:\sintel\nFixedDate:\s'1999-12-11'\nFixedInVersion:\s8.3b1\nClosedDate:\s'2000-10-25'\n\n\nOn\sSun,\s6\sDec\s1998,\sBrent\sWelch\swrote:\n\n>\sHmm\s-\sconfigure\suses\sthis\sprogram\sto\sdetect\sthe\sproblem\ssituation:\n\s\s\s\s[...]\n\n>\sIf\sthis\sprogram\sexits\swith\sstatus\sof\s1,\sthe\sbug\sis\spresent\sand\n>\svfork\sis\smapped\sto\sfork.\s\sCan\syou\stest\sthis\son\sboth\syour\sSolaris\n>\sIntel\sand\sSolaris\sSparc\splatforms\sand\ssee\swhat\shappens\sfor\syou?\n\s\s\s\s[...]\n\nI\sget\sa\sSIGSEGV\son\sSolaris\sSparc\s(with\sa\snon-zero\sexit\sstatus).\s\sOn\nSolaris\sIntel,\sthe\stest\spasses\s(zero\sexit\sstatus).\s\sI\simagine\sboth\nanswers\sare\swrong.\s\sI\stried\sit\swith\sboth\sthe\snative\sC\scompiler\sand\ngcc.\s\sAt\sthe\send\sof\sthis\smessage\sis\spasted\stranscripts\sof\sthe\stwo\nsessions.\s\sSome\sother\spossibly\srelevant\sinfo:\n\n\so\sThe\sSolaris\sSparc\sbox\sI'm\susing\sis\sa\s4-processor\sSMP\smachine.\n\so\sThe\sSolaris\sIntel\sis\sa\ssingle\sprocessor\sPentium.\n\so\sWhen\sI\shave\sthe\svfork()\sproblem\son\sSolaris\sIntel,\sI'm\susing\sPosix\n\s\s\sstyle\ssignalling.\s\sI\snoticed\sthat\sthe\stest\syou\ssent\suses\sSYSV\sstyle\n\s\s\ssignals.\n\nHere's\sa\sstack\straceback\sof\sthe\score\sdump,\splus\san\sattempt\sto\nsingle-step\sit\s(whereupon\sit\sworked\swith\sexit\sstatus\sof\szero):\n\nGNU\sgdb\s4.17\nCopyright\s1998\sFree\sSoftware\sFoundation,\sInc.\nGDB\sis\sfree\ssoftware,\scovered\sby\sthe\sGNU\sGeneral\sPublic\sLicense,\sand\syou\sare\nwelcome\sto\schange\sit\sand/or\sdistribute\scopies\sof\sit\sunder\scertain\sconditions.\nType\s"show\scopying"\sto\ssee\sthe\sconditions.\nThere\sis\sabsolutely\sno\swarranty\sfor\sGDB.\s\sType\s"show\swarranty"\sfor\sdetails.\nThis\sGDB\swas\sconfigured\sas\s"sparc-sun-solaris2.5.1"...\n(gdb)\srun\nStarting\sprogram:\s/home/isely/junk/sigtest\s\n\nProgram\sreceived\ssignal\sSIGSEGV,\sSegmentation\sfault.\n0x0\sin\s??\s()\n(gdb)\swhere\n#0\s\s0x0\sin\s??\s()\n#1\s\s<signal\shandler\scalled>\n#2\s\s0xef739628\sin\svfork\s()\n#3\s\s0x109f8\sin\smain\s()\sat\ssigtest.c:14\n(gdb)\s\n(gdb)\srun\nThe\sprogram\sbeing\sdebugged\shas\sbeen\sstarted\salready.\nStart\sit\sfrom\sthe\sbeginning?\s(y\sor\sn)\sy\nStarting\sprogram:\s/home/isely/junk/sigtest\s\n\nBreakpoint\s1,\smain\s()\sat\ssigtest.c:13\n(gdb)\snext\n(gdb)\snext\n(gdb)\snext\n(gdb)\snext\n(gdb)\snext\n\nProgram\sexited\snormally.\n(gdb)\s\n\nHere's\sthe\stranscripts\swith\sexit\sstatus:\n\nisely@ithink$\suname\s-a\nSunOS\sithink\s5.5.1\sGeneric_103640-21\ssun4u\ssparc\ssun4u\nisely@ithink$\scat\ssigtest.c\n#include\s<stdio.h>\n#include\s<signal.h>\n#include\s<sys/wait.h>\nint\sgotSignal\s=\s0;\nsigProc(sig)\n\s\s\s\sint\ssig;\n{\n\s\s\s\sgotSignal\s=\s1;\n}\nmain()\n{\n\s\s\s\sint\spid,\ssts;\n\s\s\s\s(void)\ssignal(SIGCHLD,\ssigProc);\n\s\s\s\spid\s=\svfork();\n\s\s\s\sif\s(pid\s<\s\s0)\s{\n\s\s\s\s\s\s\s\sexit(1);\n\s\s\s\s}\selse\sif\s(pid\s==\s0)\s{\n\s\s\s\s\s\s\s\s(void)\ssignal(SIGCHLD,\sSIG_DFL);\n\s\s\s\s\s\s\s\s_exit(0);\n\s\s\s\s}\selse\s{\n\s\s\s\s\s\s\s\s(void)\swait(&sts);\n\s\s\s\s}\n\s\s\s\sexit((gotSignal)\s?\s0\s:\s1);\n\n}\nisely@ithink$\scc\s-g\s-o\ssigtest\ssigtest.c\n"sigtest.c",\sline\s13:\swarning:\sargument\s#2\sis\sincompatible\swith\sprototype:\nprototype:\spointer\sto\sfunction(int)\sreturning\svoid\s:\s"/usr/include/signal.h",\sline\s37\nargument\s:\spointer\sto\sfunction(int)\sreturning\sint\nisely@ithink$\secho\s$?\n0\nisely@ithink$\s./sigtest\nSegmentation\sFault(coredump)\nisely@ithink$\secho\s$?\n139\nisely@ithink$\sgcc\s-g\s-o\ssigtest\ssigtest.c\nsigtest.c:\sIn\sfunction\s`main':\nsigtest.c:13:\swarning:\spassing\sarg\s2\sof\s`signal'\sfrom\sincompatible\spointer\stype\nisely@ithink$\secho\s$?\n0\nisely@ithink$\s./sigtest\nSegmentation\sFault(coredump)\nisely@ithink$\secho\s$?\n139\nisely@ithink$\sgcc\s-v\nReading\sspecs\sfrom\s/home/chris24/tools/lib/gcc-lib/sparc-sun-solaris2.5.1/2.8.1/specs\ngcc\sversion\s2.8.1\nisely@ithink$\s\n\nisely@ibuildx86$\suname\s-a\nSunOS\sibuildx86\s5.6\sGeneric_105182-09\si86pc\si386\si86pc\nisely@ibuildx86$\scat\ssigtest.c\n#include\s<stdio.h>\n#include\s<signal.h>\n#include\s<sys/wait.h>\nint\sgotSignal\s=\s0;\nsigProc(sig)\n\s\s\s\sint\ssig;\n{\n\s\s\s\sgotSignal\s=\s1;\n}\nmain()\n{\n\s\s\s\sint\spid,\ssts;\n\s\s\s\s(void)\ssignal(SIGCHLD,\ssigProc);\n\s\s\s\spid\s=\svfork();\n\s\s\s\sif\s(pid\s<\s\s0)\s{\n\s\s\s\s\s\s\s\sexit(1);\n\s\s\s\s}\selse\sif\s(pid\s==\s0)\s{\n\s\s\s\s\s\s\s\s(void)\ssignal(SIGCHLD,\sSIG_DFL);\n\s\s\s\s\s\s\s\s_exit(0);\n\s\s\s\s}\selse\s{\n\s\s\s\s\s\s\s\s(void)\swait(&sts);\n\s\s\s\s}\n\s\s\s\sexit((gotSignal)\s?\s0\s:\s1);\n\n}\nisely@ibuildx86$\scc\s-g\s-o\ssigtest\ssigtest.c\n"sigtest.c",\sline\s13:\swarning:\sargument\s#2\sis\sincompatible\swith\sprototype:\nprototype:\spointer\sto\sfunction(int)\sreturning\svoid\s:\s"/usr/include/signal.h",\sline\s40\nargument\s:\spointer\sto\sfunction(int)\sreturning\sint\nisely@ibuildx86$\s./sigtest\nisely@ibuildx86$\secho\s$?\n0\nisely@ibuildx86$\sgcc\s-g\s-o\ssigtest\ssigtest.c\nsigtest.c:\sIn\sfunction\s`main':\nsigtest.c:13:\swarning:\spassing\sarg\s2\sof\s`signal'\sfrom\sincompatible\spointer\stype\nisely@ibuildx86$\secho\s$?\n0\nisely@ibuildx86$\s./sigtest\nisely@ibuildx86$\secho\s$?\n0\nisely@ibuildx86$\sgcc\s-v\nReading\sspecs\sfrom\s/home/chris24/tools-i386/lib/gcc-lib/i386-pc-solaris2.6/2.8.1/specs\ngcc\sversion\s2.8.1\nisely@ibuildx86$\s\n\n\n\nWe\salso\sneed\sto\smake\svfork\sto\sfork\sif\syou\sare\susing\sTcl\sthreads.\n-----\nThis\sis\sa\sbug\sin\sthe\sconfigure\sscript\sthat\sincorrectly\sdetermines\swhich\sfork*\ssystem\scall\sto\suse.\nThe\schoice\sis\smade\sbased\son\sdetection\sof\sa\ssystem\sbug,\sor\sif\sthe\sshell\sis\sbeing\sbuilt\swith\sthreads.\nBrent\shas\sbeen\sworking\son\sthis\sbug.\s\s03/23/1999\s17:46\s-\ssurles\s-\n--\nAlso\sreportedly\sa\sproblem\sin\stclPipe.c\s(2228)\nand\sfor\sSCO\swith\sLWP\s(1312)\s\n--\s09/20/1999\shobbs\nIn\s8.3,\swe\sknow\slonger\smake\sany\schecks\sfor\svfork,\sas\swe\swon't\suse\nit.\s\sModern\sVM\ssystems\shandle\sfork\sjust\sas\sefficiently,\sand\sthis\nsolves\sa\slot\sof\sthe\snoted\sconfig\sproblems\swith\svfork.\s\n--\s12/11/1999\shobbs\n\n
J foundin obsolete:\s8.1a2
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 75.\sTutorial
J title Configure\stest\sfor\svfork\ssignal\sbug\sdoesn't\swork\son\sSolaris\s
J type Bug
K 218537ffffffffffffffffffffffffffffffffff
U nobody
Z fb1ae1c847c5747c3f857cde1980c8e5