Irreproducible bug while using the debugger

J

JS Bangs

This one stumped me until it spontaneously went away. Any explanations?

I was looking at this block of code in the debugger:

my $retval = $self->{VALUES}->{$feature};
# $retval should now be a scalar ref or undef
{
no strict 'refs';
no warnings 'uninitialized';

if ($self->{WANT} eq 'text') {
$retval = $self->{FEATURES}->text_form($feature, $$retval);
}
elsif ($self->{WANT} eq 'number') {
$retval = $$retval;
}
}

For a particular value of $feature, I found that $retval was consistently
set to '*' upon entering the less strict block, causing a warning about
deprecated use of $* on line 10. Examining $self->{VALUES} confirmed that
there was no key for the current value of $feature, so $retval should have
been undef, and there was no value for $retval before coming to this block
of code. In other words, everything was exactly as expected except for the
bizarre assignment of '*' to $retval where no value was expected.

As a partial explanation, '*' is the expected return from the text_form
method used on line 7 when the second argument is undef--but $self->{WANT}
was not set to 'text', and $retval contained the '*' before it even
reached that line.

This behavior was consistent in the debugger even after several restarts.
However, after quitting the debugge, I couldn't reproduce the bug in the
normal environment, and haven't been able to reproduce it in the bugger
since then.

Any insight?


--
Jesse S. Bangs (e-mail address removed)
http://students.washington.edu/jaspax/
http://students.washington.edu/jaspax/blog

Jesus asked them, "Who do you say that I am?"

And they answered, "You are the eschatological manifestation of the ground
of our being, the kerygma in which we find the ultimate meaning of our
interpersonal relationship."

And Jesus said, "What?"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top