An 'unreportable' perl bug

ethan on 2004-10-21T05:04:32

Over the last two days I was chasing a bug in my re-written mp3-player. Eventually with the help of Carp::confess I was able to see what was going on: A method received an additional argument although this was impossible. The line that confess included in its stacktrace was this:

    my $pattern = $self->get_input($state, $compl ? $compl : $state->search);


This call, according to confess, resulted in ActionLoop::search(ActionLoop=HASH(0x814cbb8), 1). I wonder under which contrived circumstances $obj->method can produce an additional argument. $state->search() did not fix it. The only way was passing undef explicitely.

Unfortunately, there's no obvious way for me to report this bug as the bigger picture includes three methods of which one calls the other sort of tail-recursively using goto &func. I am very sure that the bug immediately disappears when I try to strip it down enough to include it in a bug report.

On an entirely different front, I polished up my freshly installed Debian a little. I can finally watch TV. It turned out that these deadlocks were produced by an apparently buggy Nvidia driver. Using an older one fixed it. The amazing thing is that my whole Debian partition is only filled with 1.3GB of data and it can do everything that my Linux from scratch could do with 26GB. As a result, it's blazingly fast even though Debian comes with no packages that were compiled with the optimization settings that I used for Linux from scratch. Even the default perl (which is an ithreaded one) feels quicker than the non-threaded Linux-from-scratch-counterpart.


push @_, 1;

KLB on 2004-10-21T08:59:33

somebody is stacking @_, it doesn't happen spontaneously

Re:push @_, 1;

ethan on 2004-10-21T11:18:28

somebody is stacking @_, it doesn't happen spontaneously

Naturally, I also suspected @_ especially as goto &func was involved. But that's very probably not it. The line where the spurious argument was produced, was around 5 lines into the method that was called via goto. All other method calls in there behaved normally. Also, autopassing of @_ should never happen on ordinary method calls.