Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Text-Levenshtein-XS CPAN distribution.

Report information
The Basics
Id: 99413
Status: resolved
Priority: 0/
Queue: Text-Levenshtein-XS

People
Owner: UGEXE [...] cpan.org
Requestors: NGLENN [...] cpan.org
Cc:
AdminCc:

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



Subject: "Use of uninitialized value in subroutine entry" warnings
In some environments, the module generates the following warning: "Use of uninitialized value in subroutine entry at /home/perl6/.cpanplus/5.18.0/build/Text-Levenshtein-XS-0.3/blib/lib/Text/Levenshtein/XS.pm line 24." For an example of this, see this test report: http://www.cpantesters.org/cpan/report/66f4761c-e129-11e2-abc1-9d4abd71e4bb. The warning gets generated quite often, so is noisy, and also prevents me from using Test::NoWarnings for my own module.
I'm not sure what the cause of the warnings are from looking at the test reports. I'm building some perls with perlbrew's --all-variations to test against. I've also put a dev release (.30_01) to test 2 minor changes that may fix it. My only guess is it has to do with locale/utf8/encoding. There are 38 warnings, but I don't see how to divide the tests into a group that would make that many warnings: https://github.com/ugexe/Text--Levenshtein--XS/blob/c02653d3ec5c671a15d61f0654743c32bf159e5e/t/02_distance.t **22 total tests 5 utf8 tests 17 total non-utf8 tests 7 non-utf8 tests after 'use utf8' 1 test with 2 blank strings (but not undef) as arguments 2 tests with a blank string as only *one* of the arguments Will update once I have confirmed the problem. On Fri Oct 10 06:43:40 2014, NGLENN wrote: Show quoted text
> In some environments, the module generates the following warning: > "Use of uninitialized value in subroutine entry at > /home/perl6/.cpanplus/5.18.0/build/Text-Levenshtein-XS- > 0.3/blib/lib/Text/Levenshtein/XS.pm line 24." > > For an example of this, see this test report: > http://www.cpantesters.org/cpan/report/66f4761c-e129-11e2-abc1- > 9d4abd71e4bb. > > The warning gets generated quite often, so is noisy, and also prevents > me from using Test::NoWarnings for my own module.
On Fri Oct 10 15:57:02 2014, UGEXE wrote: Show quoted text
> I'm not sure what the cause of the warnings are from looking at the > test reports.
The condition for the errors was weird for me. I'm on Windows 7, and if I run my script from the command line, no warnings are generated. If, however, I run it from within Sublime Text 2 (using these directions: http://garfieldnate.github.io/blog/2013/04/07/running-perl-with-sublime-text-2/), then the warnings are generated. Also, I checked that I was never passing undef, and I installed your most recent devel release (0.30._03) and still have the same problem. This warning is apparently generated out of XS. There are a couple of helpful nodes here: http://www.perlmonks.org/bare/?node_id=415141
On Fri Oct 10 23:08:53 2014, NGLENN wrote: Show quoted text
> This warning is apparently generated out of XS. There are a couple of > helpful nodes here: http://www.perlmonks.org/bare/?node_id=415141
Actually, this looks even better, if you are able to get the warnings on your machine: http://blog.timbunce.org/2008/05/08/finding-the-cause-of-inexplicable-warnings-in-xs-code/
Fixed in 0.40 https://metacpan.org/release/UGEXE/Text-Levenshtein-XS-0.40 https://github.com/ugexe/Text--Levenshtein--XS On Fri Oct 10 23:08:53 2014, NGLENN wrote: Show quoted text
> On Fri Oct 10 15:57:02 2014, UGEXE wrote:
> > I'm not sure what the cause of the warnings are from looking at the > > test reports.
> > The condition for the errors was weird for me. I'm on Windows 7, and > if I run my script from the command line, no warnings are generated. > If, however, I run it from within Sublime Text 2 (using these > directions: http://garfieldnate.github.io/blog/2013/04/07/running- > perl-with-sublime-text-2/), then the warnings are generated. > > Also, I checked that I was never passing undef, and I installed your > most recent devel release (0.30._03) and still have the same problem. > > This warning is apparently generated out of XS. There are a couple of > helpful nodes here: http://www.perlmonks.org/bare/?node_id=415141
On Sat Oct 11 01:33:15 2014, UGEXE wrote: Show quoted text
> Fixed in 0.40
Thanks. Out of curiosity, what was the problem?
In the XS code there was an extra loop iteration calling sv2mortal when there was nothing left to av_shift. Thanks to #XS for pointing me in the right direction so I didn't have to waste much time hunting it down. <@leont> The subroutine entry thing maybe be misleading, read it as "inside an XSub, usually during argument handling" The implementation was changed entirely though; it uses the 2 row implementation instead of the str1 x str2 sized matrix. On Sat Oct 11 01:47:20 2014, NGLENN wrote: Show quoted text
> On Sat Oct 11 01:33:15 2014, UGEXE wrote:
> > Fixed in 0.40
> > Thanks. Out of curiosity, what was the problem?