www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/10/03/04:02:00

Xref: news-dnh.mv.net comp.os.msdos.djgpp:2343
Path: news-dnh.mv.net!mv!news.sprintlink.net!dnaco.net!eheft
From: eheft AT sisko DOT dnaco DOT net (eheft)
Newsgroups: comp.os.msdos.djgpp
Subject: Stupped : V2.0 bug?
Date: 3 Oct 1995 05:55:22 GMT
Organization: The Dayton Network Access Company (DNACo)
Lines: 44
Nntp-Posting-Host: eheft AT kirk DOT dnaco DOT net
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Dj-Gateway: from newsgroup comp.os.msdos.djgpp

I've got a project I'd like to move from Version 1.12.4 (pretty sure
this is the release on it) to Version 2.0 but ....

under 1.12.4 run's w/o error

under 2.0 gets a nasty SEGFAULT while accessing a 2d array of floats. 
using gdb I've tracked do the exect point of the crash and can't
see any diffenence.

-------------------------

Psudo-Code 


View(Buffer,dx,dy);     /* Good here - performs read access ok */
Shift(Buffer,dx,dy);    /* Crashes in this function */
.....

-------------------------

void Shift(float *data,int dx,int dy)
{
   int x,y,v,i;

   for (y=0; y<dy; y++)
     for (x=0; x<dx; x++)
     {
         i=2 * ( y * dx + x );
         v = (x+y) % 2 * 2 - 1;
         data[i + 0] *= v;
         data[i + 1] *= v;
      }
}

------------------------------

btw: data is a 2-d array of complex numbers.

crashes when y = 33 , x = 250 (ish) 


Thanks for any ideas.
-- Eric [ Stumped ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019