🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.interviews
Article #1254

Problems with Raster::poke on sun sparc

#1254
From: Maximilian Ott
Date: Tue, 29 Dec 1992 21:09
139 lines
4061 bytes
Hi,

I'm trying to write a class to read PPM files similar to the
TIFFRaster class. Last night I got a crude version running and tried
to massage it a little bit today. 

And all of a sudden I ran into this crazy bug and have no idea what is
going on. I stripped it down to the small program below. All it does
is to create a Raster (256x256) and set every pixel to 0. Whenever I
ran it it core dumps when trying to poke 206@0 (!!). For reasons
beyond my understanding dbx crashes with 

dbx: internal error: unexpected value 90 at line 2620 in file
../common/object.c 

when looking at the core.

As a crude debugging hack I put a printf as first statement into
(xraster.c)Raster::poke 

    void Raster::poke(
	unsigned long x, unsigned long y,
	ColorIntensity red, ColorIntensity green, ColorIntensity blue, float
    ) {
        printf("...... Raster::poke\n");
	RasterRep* r = rep();
	...

and it doesn't even print anything when it attempts the mysterious
poke(206,0). If I run the program I get

..
.... write col: 205 of: 256
...... Raster::poke
...... poked!
.... write col: 206 of: 256
Segmentation fault (core dumped)

Any ideas?

I'm using AT 2.1 from SUN on a sparc 2. All the example programs
including the one calling TIFFRaster compile and execute perfectly. We
also have Saber C++ installed but I hope I avoided mixing the incs and
libs.

Thanks,

max

----
Max Ott                 max@ccrl.nj.nec.com         phone: (609)951-2469
NEC C&C Research        Princeton, NJ, 08540        fax:   (609)951-2499
--------------
/*@  make
 * screwy.c -- trying to figure out Ratser::poke
 * Author          : Maximilian Ott
 * Created On      : Tue Dec 29 15:10:05 1992
 * Last Modified On: Tue Dec 29 16:02:05 1992
 *+********************************************************************/
#include <IV-look/kit.h>
#include <InterViews/background.h>
#include <InterViews/image.h>
#include <InterViews/layout.h>
#include <InterViews/session.h>
#include <InterViews/style.h>
#include <InterViews/color.h>
#include <InterViews/raster.h>
#include <stdlib.h>

Raster* 
test_load()

{
  int     width, height;
  int     x, y;

  width = height = 256;
  printf(".. alloc raster %dx%d\n", width, height);
  Raster* r = new Raster((u_long)width, (u_long)height);
  printf(".... after alloc\n");

  for (y = 0; y < height; ++y) {
    for (x = 0; x < width; ++x) {
      printf(".... write col: %d of: %d\n", x, width);
      r->poke(
          (u_long)x, (u_long)(height - y),
          (ColorIntensity)0.0, 
          (ColorIntensity)0.0, 
          (ColorIntensity)0.0, 
	  1.0
      );
      printf("...... poked!\n");
    }
  }
  return r;
} /* end of PPMRasterImpl::load */

int 
main(int argc, char** argv) 

{
  Session* session = new Session("Image", argc, argv);
  WidgetKit& kit = *WidgetKit::instance();
  const LayoutKit& layout = *LayoutKit::instance();

  printf("calling load\n");
  Raster* r = test_load();
} /* end of main */

----- Imakefile ------

#mk#
# Imakefile -- 
# Author          : Maximilian Ott
# Created On      : Tue Dec 29 15:13:43 1992
# Last Modified On: Tue Dec 29 15:45:38 1992
##################################################################

#ifdef InObjectCodeDir

/* APP_CCLDFLAGS  = -L/usr/lang/SC1.0 */

Use_libInterViews()
ComplexProgramTarget(test)

MakeObjectFromSrc(screwy)

#else

MakeInObjectCodeDir()

#endif




-- 
Max Ott                 max@ccrl.nj.nec.com         phone: (609)951-2469
NEC C&C Research        Princeton, NJ, 08540        fax:   (609)951-2499
Technical Details
Message-ID: <1992Dec29.210927.23562@research.nj.nec.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!darwin.sura.net!jvnc.net!nj.nec.com!max

Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.interviews
Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!darwin.sura.net!jvnc.net!nj.nec.com!max
From: max@ccrl.nj.nec.com (Maximilian Ott)
Subject: Problems with Raster::poke on sun sparc
Message-ID: <1992Dec29.210927.23562@research.nj.nec.com>
Sender: news@research.nj.nec.com
Organization: C&C Research Labs, NEC USA, Princeton, N.J.
Date: Tue, 29 Dec 92 21:09:27 GMT
Lines: 139