Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: New to me crash message

by gone2015 (Deacon)
on Apr 22, 2009 at 14:33 UTC ( [id://759294]=note: print w/replies, xml ) Need Help??


in reply to New to me crash message

Poking around in the source, I find that the error:

Can't coerce UNKNOWN to string in aelem ... line 68 ...
is generated when Perl_sv_pvn_force_flags is presented with a value which is an Array, Hash, Code or IO or some completely bogus type: (SvTYPE(sv) > SVt_PVLV && SvTYPE(sv) != SVt_PVFM).

The lines around the reported error location are:

67: if (defined($text->[0])) { 68: my @text = collapse(@$text); 69: print $fh_ERR "$url|", join( ",", @text ), "\n"; 70: }

The aelem suggests that the error is in an array element look up... however, things are all a bit mysterious:

  • there an array look up on line 67, but not on line 68.

  • I'm not convinced I can think of a case where aelem would be doing a force to string (PV).

  • I cannot see anywhere where defined would set about forcing to PV

  • the join on line 69 looks like the best candidate for forcing to PV -- but I don't see a good reason for the error being reported on the wrong line or in the wrong operation...

  • the reported UNKNOWN type is a BIG WORRY... because it indicates that whatever the SV is that is being forced to string, it's not of any type known to Perl -- which suggests something has gang awry in an omigod-could-this-be-a-bug-in-Perl sort of a way.

It could be time to get out the debugger and place a breakpoint on the:

if (SvTYPE(sv) > SVt_PVLV && SvTYPE(sv) != SVt_PVFM) Perl_croak(aTHX_ "Can't coerce %s to string in %s", sv_reftype(sv,0), OP_NAME(PL_op));
in Perl_sv_pvn_force_flags and having a poke around in the entrails.

Replies are listed 'Best First'.
Re^2: New to me crash message
by ikegami (Patriarch) on Apr 22, 2009 at 15:00 UTC

    the join on line 69 looks like the best candidate for forcing to PV -- but I don't see a good reason for the error being reported on the wrong line or in the wrong operation...

    He's using at least one source filter. As previously suggested, the first act should be to see if the bug occurs without loading any modules.

      Am about to fire off a 'use' free version of the code. Am anxious myself to see what happens--- hope it perturbs the dime for me.

      --hsm

      "Never try to teach a pig to sing...it wastes your time and it annoys the pig."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://759294]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-03-28 21:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found