Skip Menu |

This queue is for tickets about the Geo-Proj4 CPAN distribution.

Report information
The Basics
Id: 125298
Status: open
Priority: 0/
Queue: Geo-Proj4

People
Owner: MARKOV [...] cpan.org
Requestors: alexey [...] zhilchikov.ru
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: Memory leak in module Geo-Proj4-1.09
The "transform" method has a memory leak: one lost REF after every call of function. I used Devel::MAT::Dumper and pmat-diff util 1.pmat contain memory dump before transform 2.pmat contain memory dump after transform: # pmat-diff 1.pmat 2.pmat A B SCALAR(PV) at 0x564997cb16b0 SCALAR(NV) at 0x564997cb16c8 (this is coordinate X) SCALAR(PV) at 0x564997cb1728 (this is dump file name) SCALAR(NV) at 0x564997cb1770 (this is coordinate Y) REF() at 0x564997cb1908 (LOST REF! Interpreter can't access it anymore) ARRAY(2) at 0x564997cb19b0 (this is coordinates, array ref) --- 1 unique to A 5 unique to B 6925 common "REF() at 0x564997cb1908" have a refcount, but actually thereis no objects, referencing on it: Show quoted text
pmat> show 0x564997cb1908
REF() at 0x564997cb1908 with refcount 1 size 24 bytes Show quoted text
pmat> identify 0x564997cb1908
REF() at 0x564997cb1908 is: └─not found I used your *.t files to make a dumps: add a Dumper::dump, then "make test". Dumps are attached. "inverse" and "forward" methods are OK.
Subject: pmatdumps.tgz
Download pmatdumps.tgz
application/x-compressed-tar 964.4k

Message body not shown because it is not plain text.

CC: ;
Subject: Re: [rt.cpan.org #125298] Memory leak in module Geo-Proj4-1.09
Date: Fri, 11 May 2018 23:38:12 +0200
To: "alexey [...] zhilchikov.ru via RT" <bug-Geo-Proj4 [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* alexey@zhilchikov.ru via RT (bug-Geo-Proj4@rt.cpan.org) [180510 22:14]: Show quoted text
> Thu May 10 18:14:28 2018: Request 125298 was acted upon. > Transaction: Ticket created by alexey@zhilchikov.ru > Queue: Geo-Proj4 > Subject: Memory leak in module Geo-Proj4-1.09 > Requestors: alexey@zhilchikov.ru > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=125298 > > > The "transform" method has a memory leak: one lost REF after every > call of function. > I used Devel::MAT::Dumper and pmat-diff util > 1.pmat contain memory dump before transform > 2.pmat contain memory dump after transform:
Transform is implemented by Proj4.xs function transform_proj4() Show quoted text
> # pmat-diff 1.pmat 2.pmat > A B > SCALAR(PV) at 0x564997cb16b0 > SCALAR(NV) at 0x564997cb16c8 (this is coordinate X) > SCALAR(PV) at 0x564997cb1728 (this is dump file name) > SCALAR(NV) at 0x564997cb1770 (this is coordinate Y) > REF() at 0x564997cb1908 (LOST REF! Interpreter can't access it anymore) > ARRAY(2) at 0x564997cb19b0 (this is coordinates, array ref)
When I look at lines 180 - 196, I see that it constructs a stack: - IV(0) no error - PV('no error') - ARRAY(2) one or more times So, I have no idea what you see with 'pmat'. Apparently, you have a lot more knowledge about this than I have. Please supply a patch ;-) -- greetz, MarkOv ------------------------------------------------------------------------ drs Mark A.C.J. Overmeer MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net