Sisyphus schrieb: > > ----- Original Message ----- From: "Andreas Michalowski" > <[email protected]> > To: <[email protected]> > Sent: Friday, January 23, 2009 2:23 AM > Subject: [Perldl] Probably bug in convolve > > >> Hi! >> >> It seems that there is a memory bug in "convolve". On two different >> computers the short program >> >> use PDL; >> use PDL::ImageND; >> srand(); >> for ($i = 0; $i<100; $i++) >> { >> print "Iteration $i\n"; >> $a = random(200); >> $b = exp(-rvals(200)**2); >> $b = kernctr($a,$b); >> $c = convolve($a,$b); >> } >> >> reproducible leads to a computer crash after some (<10) iterations. >> Sometimes I got the error >> >> PP INTERNAL ERROR! PLEASE MAKE A BUG REPORT >> Free to wrong pool 15d3f78 not 15d3f01. >> >> I'am working on a windows machines (ActivePerl) with PDL 2.4.3 and 2.4.4 >> installed. It seems that there is some problem with the memory access!? > > Yep - I get much the same on Windows Vista with PDL-2.4.4. > I don't get the "Free to worng pool" error - I just get the segfault > when convolve() is called, and that always happens on the first > iteration. Something is clearly amiss. > > The ImageND documentation says that convolve() "is kept for backwards > compatibility with earlier scripts; for most purposes you want > L<convolveND|PDL::imageND/convolveND> instead: it runs faster and > handles a variety of boundary conditions". > > I find that the problem disappears when convolveND() is used. Can you > successfully use convolveND() instead ? > > Is there any difference between convolve and convolveND ? > If they do the same thing, then maybe we could, in ImageND.pm, simply do: > > *convolve= \&convolveND; > > and remove the convolve() XSub altogether ? > > I'll try replacing the malloc/free calls in convolve() with > New/Safefree, and see if that fixes the problem on Windows Vista. > > Cheers, > Rob Thanks a lot! Yes, convolveND should be used instead of convolve. I didn't know about this powerful command which seems to be much better than convolve. (I am PDL novice) The error disappers and what is also very important to me: The result of convolveND is exactly what I expected from an analytical convolution. This means, the question of my other contribution to the mailing list about curious results from fftconvolve and convolve is also solved.
best regards from Stuttgart, Andreas _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
