"Bizarre copy of HASH in sassign..." bug

K

kj

Everyone once in a while, my code produces an error message that
looks like this:

Bizarre copy of HASH in sassign at /usr/share/perl/5.10/Carp/Heavy.pm line 96

I think it's an internal bug somewhere, and I can usually find a
way around it, but still, it's puzzling.

The latest manifestation of this problem occurred while I was
writing unit tests for a module. My test script uses Test::More::throws_ok
to check some error conditions. When checking this one error
condition, it generates the message copied above. But if instead
of writing my test like this:

throws_ok { should_fail() } qr/something went awry/, "exception raised";

I write it like this:

eval { should_fail() };
ok $@ =~ qr/something went awry/, "exception raised";

everything's fine: the test passes, and the "Bizarre copy of HASH..."
error disappears.

If anyone can shed some light on this problem, I'd appreciate it.

TIA!

~K
 
I

Ilya Zakharevich

Bizarre copy of HASH in sassign at /usr/share/perl/5.10/Carp/Heavy.pm line 96
eval { should_fail() };
ok $@ =~ qr/something went awry/, "exception raised";

everything's fine: the test passes, and the "Bizarre copy of HASH..."
error disappears.

If anyone can shed some light on this problem, I'd appreciate it.

IIRC, this appears only when one inspects Perl stack, right? Well,
Perl stack is not refcounted, so anything may the there. There is no
guarantie that it contains valid values...

Yours,
Ilya
 

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,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top