🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #180

g++-2.2.2 bug on hp9k730 with HPUX 8.07

#180
From: George Momma
Date: Wed, 05 Aug 1992 21:52
236 lines
8050 bytes
Hello, FSF people.

I got a fatal error signal from gcc when compiling a short filter program.
I'm not sure it's a known bug or not, so I decided to report this anyway.
My system is hp9000 model 730 with HP-UX 8.07 running with 80MB of memory.
I'm using gcc-2.2.2, which was installed with "configure hp9k730", compiled
with debugging information generation enabled. (I'm not using this -g option
so far, as gdb seems not to support HP-UX PA-RISC)
I'm also using gas-1.36 ported to PA-RISC1.1 by the Utah-univ. group for gcc.
The version of my libg++ is 2.1.

Below is the code and the output from the compiler.

// betatoppm - A filter command to convert from Z's staff Kid 98 
// BETA-file format to the ppm format.
//
// Written by George Momma 1992, Aug.
//
// Version 1.0

#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
#define BETASIZE 96000
char outputbuf[70];
unsigned char mask[8]={0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
void usage(void){

  cerr << "Usage:\nbetatoppm [inputfile]" << endl;
  exit(1);
}

FILE* fileopen(char* filename){
  FILE* filep;
  if(0 == (filep = fopen(filename, "rb"))){
    cerr << "\ncannot open input file." << endl;
    exit(1);
  }
  return filep;
}

char* ppmform(char buf[],
	      unsigned int r_byte,
	      unsigned int g_byte,
	      unsigned int b_byte){
  char* ptr=buf;  

  for(int i=0; i<8; i++){
    *ptr++=(r_byte&mask[i])?'1':'0';
    *ptr++=' ';
    *ptr++=(g_byte&mask[i])?'1':'0';
    *ptr++=' ';
    *ptr++=(g_byte&mask[i])?'1':'0';
    *ptr++=' ';
    *ptr++=' ';
  }
  *ptr++='\n';
  *ptr++='\0';
  return buf;
}


int main(int argc, char* argv[]){

  FILE* infile = stdin;
  
  switch (argc){
  case 1:
    break;
  case 2:
    if ((0 == strcmp(argv[1], "-help"))||(0 == strcmp(argv[1], "-h"))){
      usage();
    } else {
      infile = fileopen(argv[1]);
    }
    break;
  default:
    usage();
  }
  
  if(BETASIZE != fread(rgb_buffer, sizeof(unsigned char), BETASIZE, infile)){
    cerr << "file read error." << endl;
    exit(1);
  }
  
  unsigned char* rgb_buffer = new unsigned char[BETASIZE];
  cout << "P3\n";  //magic number for ppm file format.
  cout << "#ppm file generated by betatoppm" << endl;
  cout << "640 400\n"; // size of a PC graphics memory.
  cout << "1\n"; // depth of each plane.
  unsigned char* baseptr, b_baseptr;
  for(baseptr=rgb_buffer; baseptr < rgb_buffer+BETASIZE; rgbbuffer+=BETASIZE/4){
    for(b_baseptr=baseptr, b_baseptr < BETASIZE/12, b_baseptr++){
      cout << ppmform(outputbuf, *(b_baseptr+BETASIZE/12),
		      *(b_baseptr+2*BETASIZE/12), *(b_baseptr));
    }  
  }
  flcose(infile);
  return 0;
}

// end of my code.

cd /home/theory/momma/lib/betatoppm/
g++ -v -O -c betatoppm.cc -o betatoppm
Reading specs from /usr/local/lib/gcc-lib/hp9k730/2.2.2/specs
gcc version 2.2.2
 /usr/local/lib/gcc-lib/hp9k730/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D_HPUX_SOURCE -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__PWB__ -D__hpux__ -D__unix__ -D___HPUX_SOURCE__ -D__hppa -D__hp9000s800 -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux -D__unix -D___HPUX_SOURCE -D__OPTIMIZE__ betatoppm.cc /usr/tmp/cca25242.i
GNU CPP version 2.2.2 (hp9000s800)
 /usr/local/lib/gcc-lib/hp9k730/2.2.2/cc1plus /usr/tmp/cca25242.i -quiet -dumpbase betatoppm.cc -O -version -o /usr/tmp/cca25242.s
GNU C++ version 2.2.2 (hp9000s800) compiled by GNU C version 2.2.2.
/usr/local/bin/gcc: Internal compiler error: program cc1plus got fatal signal 6

Compilation exited abnormally with code 1 at Thu Aug  6 06:12:28

I hope this report would be helpful.
To: bug-g++@prep.ai.mit.edu
cc:
Subject: g++-2.2.2 bug on hp9k730 with HPUX 8.07
--------
Hello, FSF people.

I got a fatal error signal from gcc when compiling a short filter program.
I'm not sure it's a known bug or not, so I decided to report this anyway.
My system is hp9000 model 730 with HP-UX 8.07 running with 80MB of memory.
I'm using gcc-2.2.2, which was installed with "configure hp9k730", compiled
with debugging information generation enabled. (I'm not using this -g option
so far, as gdb seems not to support HP-UX PA-RISC)
I'm also using gas-1.36 ported to PA-RISC1.1 by the Utah-univ. group for gcc.
The version of my libg++ is 2.1.

Below is the code and the output from the compiler.

// betatoppm - A filter command to convert from Z's staff Kid 98 
// BETA-file format to the ppm format.
//
// Written by George Momma 1992, Aug.
//
// Version 1.0

#include <iostream.h>
#include <stdlib.h>
#include <stdio.h>
#define BETASIZE 96000
char outputbuf[70];
unsigned char mask[8]={0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
void usage(void){

  cerr << "Usage:\nbetatoppm [inputfile]" << endl;
  exit(1);
}

FILE* fileopen(char* filename){
  FILE* filep;
  if(0 == (filep = fopen(filename, "rb"))){
    cerr << "\ncannot open input file." << endl;
    exit(1);
  }
  return filep;
}

char* ppmform(char buf[],
	      unsigned int r_byte,
	      unsigned int g_byte,
	      unsigned int b_byte){
  char* ptr=buf;  

  for(int i=0; i<8; i++){
    *ptr++=(r_byte&mask[i])?'1':'0';
    *ptr++=' ';
    *ptr++=(g_byte&mask[i])?'1':'0';
    *ptr++=' ';
    *ptr++=(g_byte&mask[i])?'1':'0';
    *ptr++=' ';
    *ptr++=' ';
  }
  *ptr++='\n';
  *ptr++='\0';
  return buf;
}


int main(int argc, char* argv[]){

  FILE* infile = stdin;
  
  switch (argc){
  case 1:
    break;
  case 2:
    if ((0 == strcmp(argv[1], "-help"))||(0 == strcmp(argv[1], "-h"))){
      usage();
    } else {
      infile = fileopen(argv[1]);
    }
    break;
  default:
    usage();
  }
  
  if(BETASIZE != fread(rgb_buffer, sizeof(unsigned char), BETASIZE, infile)){
    cerr << "file read error." << endl;
    exit(1);
  }
  
  unsigned char* rgb_buffer = new unsigned char[BETASIZE];
  cout << "P3\n";  //magic number for ppm file format.
  cout << "#ppm file generated by betatoppm" << endl;
  cout << "640 400\n"; // size of a PC graphics memory.
  cout << "1\n"; // depth of each plane.
  unsigned char* baseptr, b_baseptr;
  for(baseptr=rgb_buffer; baseptr < rgb_buffer+BETASIZE; rgbbuffer+=BETASIZE/4){
    for(b_baseptr=baseptr, b_baseptr < BETASIZE/12, b_baseptr++){
      cout << ppmform(outputbuf, *(b_baseptr+BETASIZE/12),
		      *(b_baseptr+2*BETASIZE/12), *(b_baseptr));
    }  
  }
  flcose(infile);
  return 0;
}

// end of my code.

cd /home/theory/momma/lib/betatoppm/
g++ -v -O -c betatoppm.cc -o betatoppm
Reading specs from /usr/local/lib/gcc-lib/hp9k730/2.2.2/specs
gcc version 2.2.2
 /usr/local/lib/gcc-lib/hp9k730/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D_HPUX_SOURCE -D__hppa__ -D__hp9000s800__ -D__hp9000s800 -D__hp9k8__ -D__PWB__ -D__hpux__ -D__unix__ -D___HPUX_SOURCE__ -D__hppa -D__hp9000s800 -D__hp9000s800 -D__hp9k8 -D__PWB -D__hpux -D__unix -D___HPUX_SOURCE -D__OPTIMIZE__ betatoppm.cc /usr/tmp/cca25242.i
GNU CPP version 2.2.2 (hp9000s800)
 /usr/local/lib/gcc-lib/hp9k730/2.2.2/cc1plus /usr/tmp/cca25242.i -quiet -dumpbase betatoppm.cc -O -version -o /usr/tmp/cca25242.s
GNU C++ version 2.2.2 (hp9000s800) compiled by GNU C version 2.2.2.
/usr/local/bin/gcc: Internal compiler error: program cc1plus got fatal signal 6

Compilation exited abnormally with code 1 at Thu Aug  6 06:12:28

I hope this report would be helpful.
Technical Details
Message-ID: <9208052153.AA29295@life.ai.mit.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!theory.kek.jp!momma

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!usc!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!theory.kek.jp!momma
From: momma@theory.kek.jp (George Momma)
Subject: g++-2.2.2 bug on hp9k730 with HPUX 8.07
Message-ID: <9208052153.AA29295@life.ai.mit.edu>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Wed, 5 Aug 1992 21:52:14 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 237