Skip Menu |

This queue is for tickets about the PDF-TableX CPAN distribution.

Report information
The Basics
Id: 122399
Status: open
Priority: 0/
Queue: PDF-TableX

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc: ssimms [...] cpan.org
AdminCc:

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



CC: ssimms [...] cpan.org
Subject: Tests fail (with PDF::API2 2.032?)
The test suite started to fail on my smokers: ... Can't call method "new_obj" on unblessed reference at /home/cpansand/.cpan/build/2017070806/PDF-API2-2.033-wjlkU2/blib/lib/PDF/API2/Page.pm line 270. # Looks like your test exited with 255 just after 10. t/01-simple-mesh.t ................ Dubious, test returned 255 (wstat 65280, 0xff00) All 10 subtests passed Can't call method "new_obj" on unblessed reference at /home/cpansand/.cpan/build/2017070806/PDF-API2-2.033-wjlkU2/blib/lib/PDF/API2/Page.pm line 270. # Looks like your test exited with 255 just after 4. t/02-place-text.t ................. Dubious, test returned 255 (wstat 65280, 0xff00) All 4 subtests passed ... (etc) ... Statistical analysis suggests that the problem started with PDF::API2 2.032 (negative theta means "bad"): **************************************************************** Regression 'mod:PDF::API2' **************************************************************** Name Theta StdErr T-stat [0='const'] 1.0000 0.0000 13926610897106302.00 [1='eq_2.022'] -0.0000 0.0000 -2.87 [2='eq_2.023'] -0.0000 0.0000 -1.54 [3='eq_2.025'] -0.0000 0.0000 -4.49 [4='eq_2.027'] -0.0000 0.0000 -3.89 [5='eq_2.028'] -0.0000 0.0000 -4.16 [6='eq_2.030'] -0.0000 0.0000 -3.97 [7='eq_2.031'] -0.0000 0.0000 -5.79 [8='eq_2.032'] -1.0000 0.0000 -6963305448553149.00 [9='eq_2.033'] -1.0000 0.0000 -11371030181398106.00 R^2= 1.000, N= 131, K= 10 ****************************************************************
Hi, PDF::API2 maintainer here, TL;DR -- In PDF::TableX::Cell, if you change the code to create and store just one PDF::API2 object, everything should work fine. PDF::API2 version 2.032 dealt with a lot of circular reference issues that were causing memory leaks. (2.033, released a few days later, fixed a couple of bugs related to that, but they don't seem to be relevant here.) Right now, there are four places in that file where you're calling PDF::API2->new() and then immediately discarding the resulting object, returning an inner part of its data structure instead. That happened to work because of the circular reference issues which kept things from getting garbage-collected, but it was unintentional. It's an easy fix, though -- just keep the PDF::API2 object around as part of the Cell object (or wherever it makes sense to keep it), and call it whenever you need a page or font object.