Skip Menu |
 

This queue is for tickets about the Test-Most CPAN distribution.

Report information
The Basics
Id: 127909
Status: open
Priority: 0/
Queue: Test-Most

People
Owner: Nobody in particular
Requestors: exodist7 [...] gmail.com
Cc:
AdminCc:

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



Subject: Cycle in Test::Most's injected Test::Builder::DESTROY
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
Message-ID: <rt-4.0.18-6133-1543957725-1481.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 1910
Download (untitled) / with headers
text/plain 1.8k
Discovered via https://github.com/Test-More/test-more/issues/816 "[...] Test::Most injects a DESTROY sub into Test::Builder. This is a bad thing to do, first off it would mask any DESTROY block Test::Builder might add in the future. Second Test::Builder has no DESTROY block normally, and internal logic was written with that in mind. This causes GC issues because the object being DESTROYED is normally a singleton in a variable, but the GC has made that variable undef. This also occurs after Test2 GC has occurred. Big chain reaction." "to clarify, the new DESTROY block calls an action handler, the action handler in this case calls Test::More::BAIL_OUT, which then tries to re-create the singleton instead of using the object being DESTROYED. I think the fix needs to be made in Test::Most, but is really simple. The DESTROY it injects should localize $Test::Builder::Test to the object being destroyed: local $Test::Builder::Test = $_[0]; a simple 1-line fix that will probably solve this. But it needs to be fixed in Test::Most. This is actually a Test::Most bug, the new internals of Test::Builder simply exposed it. It was a bug to rely on Test::Builder creating a new singleton after the first is DESTROY'd" To try and be super clear: Test::Builder::DESTROY is triggered when the singleton is destroyed, meaning $Test::Builder::Test is undef now. One of the triggered behaviors however causes Test::Builder->new to build a new singleton and call methods on it. By the time this happens much of the program state has already been destroyed so it is random chance that it ever succeeded. I suspect this can be mitigated, if not completely fixed by having the injected DESTROY block localize the $Test::Builder::Test variable back to the original singleton (the one being destroyed). However it is always possible other necessary objects have been destroyed, it is is end-of-program GC afterall.
MIME-Version: 1.0
In-Reply-To: <rt-4.0.18-6133-1543957725-1481.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.18-6133-1543957725-1481.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-4019-1544227420-1527.127909-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 253
Download (untitled) / with headers
text/plain 253b
Ovid, I'd be happy to take on coming up with a patch for this if you like. Also, I noticed that you haven't had a chance to update Test::Most in a while ... I'll volunteer to take on comaintenance, if you think that would be helpful. Just let me know.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.