[comp.unix.ultrix] Ultrix 3.1 and SIGSEGV

larryd1@attctc.Dallas.TX.US (Larry Clark) (09/01/89)

      We recently up graded our 8810 to ultrix 3.1 from ultrix 3.0 (rev 64)
      and several of our applications ceased working.   The applications
      either involved popen() or system() and signal(SIGSEGV, SIG_IGN). The
      following code hangs forever with the signal(SIGSEGV, SIG_IGN) compiled
      in it.

      Maybe this will save someone some time looking for the reason an
      application ceased to work.  I've called DEC and will file an SPR.


      Larry Clark

      #include <stdio.h>
      #include <signal.h>

      main()
      {

          FILE *fp;

          char command[128];

          int i;

#ifdef IN
          signal(SIGSEGV, SIG_IGN);
#endif

          sprintf(command, "sh -c lp -d lp0");

          fp = popen(command, "w");

          if (fp == NULL) {
              printf("It's null\n");
              exit(-1);
          }
      
          for (i = 0; i < 56; i++) {
              sprintf(command, "line %03d\n", i);
              fprintf(fp, "%s", command);
              fflush(fp);
          }

          pclose(fp);
      
      }