<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Chasing a Very Elusive Warning</title>
	<atom:link href="http://www.dereferenced.com/2011/08/16/chasing-a-very-elusive-warning/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dereferenced.com/2011/08/16/chasing-a-very-elusive-warning/</link>
	<description>A preponderance of Perl, an excess of XML, and additional alliterations.</description>
	<lastBuildDate>Thu, 19 Jan 2012 08:50:49 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Tim Bunce</title>
		<link>http://www.dereferenced.com/2011/08/16/chasing-a-very-elusive-warning/comment-page-1/#comment-1111</link>
		<dc:creator>Tim Bunce</dc:creator>
		<pubDate>Wed, 17 Aug 2011 21:26:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereferenced.com/?p=184#comment-1111</guid>
		<description>I agree with Dave. The &quot;in ...&quot; part of the warning refers to the last opcode perl executed.

I wrote a blog post on how I tackle this a few years ago: http://blog.timbunce.org/2008/05/08/finding-the-cause-of-inexplicable-warnings-in-xs-code/</description>
		<content:encoded><![CDATA[<p>I agree with Dave. The &#8220;in &#8230;&#8221; part of the warning refers to the last opcode perl executed.</p>
<p>I wrote a blog post on how I tackle this a few years ago: <a href="http://blog.timbunce.org/2008/05/08/finding-the-cause-of-inexplicable-warnings-in-xs-code/" rel="nofollow">http://blog.timbunce.org/2008/05/08/finding-the-cause-of-inexplicable-warnings-in-xs-code/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed Avis</title>
		<link>http://www.dereferenced.com/2011/08/16/chasing-a-very-elusive-warning/comment-page-1/#comment-1107</link>
		<dc:creator>Ed Avis</dc:creator>
		<pubDate>Wed, 17 Aug 2011 11:06:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereferenced.com/?p=184#comment-1107</guid>
		<description>I have found the tool &#039;delta&#039; to be useful in these situations.  You first need to create a single-file test case that produces the warning, probably by concatenating all the source files (including the LibXML code) into one big program - replacing &#039;use&#039; and &#039;require&#039; statements with the contents of the files they load.  Then you write a test harness which runs the program and checks for the error message, though without requiring a particular line number.  You can now use &#039;delta&#039; to generate a minimal test case - the shortest Perl program which produces the error.

The only trouble is that &#039;Use of uninitialized value in subroutine entry&#039; might crop up anyway when running one of the minimized test files; it&#039;s not a bug in perl itself, so simply producing the shortest source file that gives this warning may not be helpful.

Nonetheless, making a test case of a single huge file and then whittling it down by hand can be a good way to find what&#039;s going on, if you have a few hours to spare.</description>
		<content:encoded><![CDATA[<p>I have found the tool &#8216;delta&#8217; to be useful in these situations.  You first need to create a single-file test case that produces the warning, probably by concatenating all the source files (including the LibXML code) into one big program &#8211; replacing &#8216;use&#8217; and &#8216;require&#8217; statements with the contents of the files they load.  Then you write a test harness which runs the program and checks for the error message, though without requiring a particular line number.  You can now use &#8216;delta&#8217; to generate a minimal test case &#8211; the shortest Perl program which produces the error.</p>
<p>The only trouble is that &#8216;Use of uninitialized value in subroutine entry&#8217; might crop up anyway when running one of the minimized test files; it&#8217;s not a bug in perl itself, so simply producing the shortest source file that gives this warning may not be helpful.</p>
<p>Nonetheless, making a test case of a single huge file and then whittling it down by hand can be a good way to find what&#8217;s going on, if you have a few hours to spare.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uwe</title>
		<link>http://www.dereferenced.com/2011/08/16/chasing-a-very-elusive-warning/comment-page-1/#comment-1105</link>
		<dc:creator>Uwe</dc:creator>
		<pubDate>Wed, 17 Aug 2011 09:57:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereferenced.com/?p=184#comment-1105</guid>
		<description>I use Carp::Always in such cases to get a stacktrace and see which line of my code is causing this warning.</description>
		<content:encoded><![CDATA[<p>I use Carp::Always in such cases to get a stacktrace and see which line of my code is causing this warning.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://www.dereferenced.com/2011/08/16/chasing-a-very-elusive-warning/comment-page-1/#comment-1102</link>
		<dc:creator>Joel</dc:creator>
		<pubDate>Wed, 17 Aug 2011 05:15:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereferenced.com/?p=184#comment-1102</guid>
		<description>I know you certainly have looked at perldiag, but if not here is the relevant warning:

Use of uninitialized value%s
(W uninitialized) An undefined value was used as if it were already defined. It was interpreted as a &quot;&quot; or a 0, but maybe it was a mistake. To suppress this warning assign a defined value to your variables.
To help you figure out what was undefined, perl will try to tell you the name of the variable (if any) that was undefined. In some cases it cannot do this, so it also tells you what operation you used the undefined value in. Note, however, that perl optimizes your program and the operation displayed in the warning may not necessarily appear literally in your program. For example, &quot;that $foo&quot; is usually optimized into &quot;that &quot; . $foo , and the warning will refer to the concatenation (.) operator, even though there is no . in your program.

You can of course call `no warnings &#039;uninititialized&#039;` somewhere just above the offending call, and/or check to see that the subroutine args are in fact what you thing they are. 

I feel silly mentioning all this since you know all of it, but sometimes I lose the trees for the forest and need someone to remind me about them. Good luck, I hope you find it!</description>
		<content:encoded><![CDATA[<p>I know you certainly have looked at perldiag, but if not here is the relevant warning:</p>
<p>Use of uninitialized value%s<br />
(W uninitialized) An undefined value was used as if it were already defined. It was interpreted as a &#8220;&#8221; or a 0, but maybe it was a mistake. To suppress this warning assign a defined value to your variables.<br />
To help you figure out what was undefined, perl will try to tell you the name of the variable (if any) that was undefined. In some cases it cannot do this, so it also tells you what operation you used the undefined value in. Note, however, that perl optimizes your program and the operation displayed in the warning may not necessarily appear literally in your program. For example, &#8220;that $foo&#8221; is usually optimized into &#8220;that &#8221; . $foo , and the warning will refer to the concatenation (.) operator, even though there is no . in your program.</p>
<p>You can of course call `no warnings &#8216;uninititialized&#8217;` somewhere just above the offending call, and/or check to see that the subroutine args are in fact what you thing they are. </p>
<p>I feel silly mentioning all this since you know all of it, but sometimes I lose the trees for the forest and need someone to remind me about them. Good luck, I hope you find it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike Doherty</title>
		<link>http://www.dereferenced.com/2011/08/16/chasing-a-very-elusive-warning/comment-page-1/#comment-1101</link>
		<dc:creator>Mike Doherty</dc:creator>
		<pubDate>Wed, 17 Aug 2011 02:56:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereferenced.com/?p=184#comment-1101</guid>
		<description>I&#039;m having a similar issue, reported here: https://rt.cpan.org/Ticket/Display.html?id=70253

If you gain any great insight, I&#039;d love to be taught how to track down this sort of thing.</description>
		<content:encoded><![CDATA[<p>I&#8217;m having a similar issue, reported here: <a href="https://rt.cpan.org/Ticket/Display.html?id=70253" rel="nofollow">https://rt.cpan.org/Ticket/Display.html?id=70253</a></p>
<p>If you gain any great insight, I&#8217;d love to be taught how to track down this sort of thing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hdp</title>
		<link>http://www.dereferenced.com/2011/08/16/chasing-a-very-elusive-warning/comment-page-1/#comment-1100</link>
		<dc:creator>hdp</dc:creator>
		<pubDate>Wed, 17 Aug 2011 02:39:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereferenced.com/?p=184#comment-1100</guid>
		<description>make test sets $^W, prove does not, and XML/LibXML.pm does not &#039;use warnings&#039;.</description>
		<content:encoded><![CDATA[<p>make test sets $^W, prove does not, and XML/LibXML.pm does not &#8216;use warnings&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Rolsky</title>
		<link>http://www.dereferenced.com/2011/08/16/chasing-a-very-elusive-warning/comment-page-1/#comment-1097</link>
		<dc:creator>Dave Rolsky</dc:creator>
		<pubDate>Wed, 17 Aug 2011 01:02:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.dereferenced.com/?p=184#comment-1097</guid>
		<description>In my experience, this warning comes when you pass an undef value to a subroutine implemented in XS that is not explicitly checking for undef internally. I&#039;d start looking into any XS code called at that particular line.</description>
		<content:encoded><![CDATA[<p>In my experience, this warning comes when you pass an undef value to a subroutine implemented in XS that is not explicitly checking for undef internally. I&#8217;d start looking into any XS code called at that particular line.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
